Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ projects/*

.idea
.env
.yarn
dev-app-update.yml
cypress.env.json
electron/releases/
cypress/screenshots/
16 changes: 7 additions & 9 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"input": "node_modules/ng2-pdfjs-viewer/pdfjs",
"output": "/assets/pdfjs"
},
{
"glob": "**/*",
"input": "node_modules/tinymce",
"output": "/tinymce/"
},
"src/assets",
"src/android-chrome-192x192.png",
"src/android-chrome-256x256.png",
Expand All @@ -43,17 +48,10 @@
"src/safari-pinned-tab.svg",
"src/manifest.webmanifest"
],
"styles": [
"src/styles.scss",
"node_modules/intro.js/introjs.css",
"node_modules/tinymce/skins/lightgray/skin.min.css"
],
"styles": ["src/styles.scss", "node_modules/intro.js/introjs.css"],
"scripts": [
"node_modules/save-svg-as-png/lib/saveSvgAsPng.js",
"node_modules/tinymce/tinymce.js",
"node_modules/tinymce/themes/modern/theme.js",
"node_modules/tinymce/plugins/lists/plugin.js",
"node_modules/tinymce/plugins/autoresize/plugin.js",
"node_modules/tinymce/tinymce.min.js",
"node_modules/intro.js/intro.js"
],
"extractLicenses": false,
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/pia-angular/context/validation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function context_validation() {
});

context("Validation for 'Vue d'ensemble'", () => {
it("should acept evaluation", () => {
it("should accept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 1, 1);
cy.acceptEval();
Expand All @@ -28,7 +28,7 @@ export function context_validation() {
});

context("Validation for 'Données, processus et supports'", () => {
it("should acept evaluation", () => {
it("should accept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 1, 2);
cy.acceptEval();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function fundamental_principle_validation() {
*/

context("Validation for 'Proportionnalité et nécessité'", () => {
it("should acept evaluation", () => {
it("should accept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 2, 1);
cy.acceptMultipleEval();
Expand All @@ -31,7 +31,7 @@ export function fundamental_principle_validation() {
});

context("Validation for 'Mesures protectrices des droits'", () => {
it("should acept evaluation", () => {
it("should accept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 2, 2);
cy.acceptMultipleEval();
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/pia-angular/risk/validation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function risk_validation() {
*/

context("Validation for 'Mesures existantes ou prévues'", () => {
it("should acept evaluation", () => {
it("should accept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 3, 1);
cy.acceptMultipleEval();
Expand All @@ -31,7 +31,7 @@ export function risk_validation() {
});

context("Validation for 'Accès illégitime à des données'", () => {
it("should acept evaluation", () => {
it("should accept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 3, 2);
cy.acceptEval();
Expand All @@ -51,7 +51,7 @@ export function risk_validation() {
});

context("Validation for 'Modification non désirées de données'", () => {
it("should acept evaluation", () => {
it("should accept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 3, 3);
cy.acceptEval();
Expand All @@ -71,7 +71,7 @@ export function risk_validation() {
});

context("Validation for 'Disparition de données'", () => {
it("should acept evaluation", () => {
it("should accept evaluation", () => {
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 3, 4);
cy.acceptEval();
Expand Down
113 changes: 67 additions & 46 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ Cypress.Commands.add("test_writing_on_textarea", () => {
.find(`textarea`)
.first()
.click({ force: true });

// Wait for TinyMCE iframe to be ready
cy.wait(1000);

cy.wrap($el)
.find("iframe")
.then($iframe => {
Expand All @@ -118,14 +122,16 @@ Cypress.Commands.add("test_writing_on_textarea", () => {
)
.trigger("blur", { force: true });
});
cy.wait(500);

// Wait for editor to save and remove
cy.wait(2000);
});
cy.get(".pia-questionBlock").each($el => {
cy.wrap($el)
.find(`textarea`)
.first()
.click({ force: true });
cy.wait(500);
cy.wait(1000);
});
cy.focus_out();
});
Expand All @@ -134,11 +140,14 @@ Cypress.Commands.add("test_writing_on_textarea_gauges", () => {
cy.get(".pia-gaugeBlock")
.parent()
.each($el => {
cy.wait(500);
cy.wrap($el)
.find(`textarea`)
.last()
.click({ force: true });

// Wait for TinyMCE iframe to be ready
cy.wait(1000);

cy.wrap($el)
.find("iframe")
.then($iframe => {
Expand All @@ -147,17 +156,21 @@ Cypress.Commands.add("test_writing_on_textarea_gauges", () => {
.clear({ force: true })
.type(
"Nam tincidunt sem vel pretium scelerisque. Aliquam tincidunt commodo magna, vitae rutrum massa. Praesent lobortis porttitor gravida. Fusce nulla libero, feugiat eu sodales at, semper ac diam. Morbi sit amet luctus libero, eu sagittis neque"
);
)
.trigger("blur", { force: true });
});

// Wait for editor to save and remove
cy.wait(2000);
});
cy.get(".pia-gaugeBlock")
.parent()
.each($el => {
cy.wait(500);
cy.wrap($el)
.find(`textarea`)
.last()
.click({ force: true });
cy.wait(1000);
});
cy.focus_out();
});
Expand All @@ -179,6 +192,10 @@ Cypress.Commands.add("test_add_measure", () => {
.find(`textarea`)
.first()
.click({ force: true });

// Wait for TinyMCE iframe to be ready
cy.wait(1000);

cy.wrap($el)
.find("iframe")
.then($iframe => {
Expand All @@ -187,8 +204,12 @@ Cypress.Commands.add("test_add_measure", () => {
.clear({ force: true })
.type(
"Nam tincidunt sem vel pretium scelerisque. Aliquam tincidunt commodo magna, vitae rutrum massa. Praesent lobortis porttitor gravida. Fusce nulla libero, feugiat eu sodales at, semper ac diam. Morbi sit amet luctus libero, eu sagittis neque"
);
)
.trigger("blur", { force: true });
});

// Wait for editor to save and remove
cy.wait(2000);
});
cy.focus_out();
});
Expand Down Expand Up @@ -216,54 +237,52 @@ Cypress.Commands.add("test_add_tags", () => {
cy.get("[aria-label='Enter the potential impacts']")
.type("Tag 1")
.type("{enter}");
cy.get("[aria-label='Enter the potential impacts']")
.type("Tag 1.1")
.type("{enter}");
cy.get("[aria-label='Enter the threats']")
.type("Tag 2")
.type("{enter}");
cy.get("[aria-label='Enter the threats']")
.type("Tag 2.1")
.type("{enter}");
cy.get("[aria-label='Enter the risk sources']")
.type("Tag 3")
.type("{enter}");
cy.get("[aria-label='Click here to select controls which address the risk.']")
.type("Measure")
.then(() => {
cy.wait(500);
cy.get(".ng2-menu-item")
.first()
.click({ force: true });
});
cy.get("[aria-label='Enter the risk sources']")
.type("Tag 3.1")
.type("{enter}");
cy.get(
"[aria-label='Click here to select controls which address the risk.']"
).type("Measure");
cy.wait(500);
cy.get(".ng2-menu-item")
.first()
.click({ force: true });
});
Cypress.Commands.add("test_add_tags_next", () => {
cy.get("[aria-label='Enter the potential impacts']")
.type("Tag")
.then(() => {
cy.wait(500);
cy.get(".ng2-menu-item")
.first()
.click({ force: true });
});
cy.get("[aria-label='Enter the threats']")
.type("Tag")
.then(() => {
cy.wait(500);
cy.get(".ng2-menu-item")
.first()
.click({ force: true });
});
cy.get("[aria-label='Enter the risk sources']")
.type("Tag")
.then(() => {
cy.wait(500);
cy.get(".ng2-menu-item")
.first()
.click({ force: true });
});
cy.get("[aria-label='Click here to select controls which address the risk.']")
.type("Measure")
.then(() => {
cy.wait(500);
cy.get(".ng2-menu-item")
.first()
.click({ force: true });
});
cy.get("[aria-label='Enter the potential impacts']").type("Tag");
cy.wait(500);
cy.get(".ng2-menu-item")
.first()
.click({ force: true });
cy.get("[aria-label='Enter the threats']").type("Tag");
cy.wait(500);
cy.get(".ng2-menu-item")
.first()
.click({ force: true });
cy.get("[aria-label='Enter the risk sources']").type("Tag");
cy.wait(500);
cy.get(".ng2-menu-item")
.first()
.click({ force: true });
cy.get(
"[aria-label='Click here to select controls which address the risk.']"
).type("Measure");
cy.wait(500);
cy.get(".ng2-menu-item")
.first()
.click({ force: true });
});

Cypress.Commands.add("test_move_gauges", () => {
Expand All @@ -277,12 +296,14 @@ Cypress.Commands.add("test_move_gauges", () => {

Cypress.Commands.add("validateEval", () => {
cy.focus_out();
cy.wait(2000);
cy.get(".pia-entryContentBlock-footer .btn-green")
.should("have.class", "btn-active")
.click({ force: true });
});

Cypress.Commands.add("acceptEval", () => {
cy.wait(2000);
cy.get(".pia-evaluationBlock .btn-green").click({ force: true });
cy.get(".pia-entryContentBlock-footer .btn-green")
.should("have.class", "btn-active")
Expand Down
36 changes: 0 additions & 36 deletions e2e/protractor.conf.js

This file was deleted.

28 changes: 0 additions & 28 deletions e2e/src/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions e2e/src/app.po.ts

This file was deleted.

Loading