Skip to content

Commit

Permalink
Merge pull request #724 from LINCnil/dependabot/npm_and_yarn/cypress/…
Browse files Browse the repository at this point in the history
…request-and-cypress-3.0.0

chore(deps): bump @cypress/request and cypress
  • Loading branch information
kevin-atnos authored Nov 22, 2023
2 parents 78308fb + c01abd9 commit b33007a
Show file tree
Hide file tree
Showing 22 changed files with 35,695 additions and 11,784 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '18 8 * * 3'
- cron: "18 8 * * 3"

jobs:
analyze:
Expand All @@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ['javascript']
language: ["javascript"]
# CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby']
# Learn more about CodeQL language support at https://git.io/codeql-language-support

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ on: [push]
jobs:
cypress-run:
runs-on: ubuntu-latest
container: cypress/browsers:node14.7.0-chrome84
container:
image: cypress/browsers:node16.18.0-chrome90-ff88
options: --user 1001
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cypress
uses: cypress-io/github-action@v4
uses: cypress-io/github-action@v6
with:
start: yarn start
browser: chrome
Expand Down
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarn 1.22.19
nodejs 16.17.0
22 changes: 22 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defineConfig } from 'cypress';

export default defineConfig({
// projectId: 'w4expe',
viewportWidth: 1200,
viewportHeight: 660,
// experimentalSourceRewriting: false,
// trashAssetsBeforeRuns: true,
downloadsFolder: './cypress/download',
defaultCommandTimeout: 10000,
// video: false,
retries: 5,
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config);
},
baseUrl: 'http://localhost:4200',
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}'
}
});
13 changes: 0 additions & 13 deletions cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("Client-Server", () => {
* Go to Entries page pia-navigationBlock-withsub pia-navigationBlock-dropdown
*/
context("Start", () => {
it("Go on serveur URL configuration", () => {
it("Go on serveur URL configuration and set var and save", () => {
cy.visit("/");
cy.get(".pia-navigationBlock-dropdown")
.eq(0)
Expand All @@ -23,28 +23,11 @@ describe("Client-Server", () => {
.eq(0)
.click({ force: true });
cy.wait(500);
});
});

context("Write URL ID and SECRET", () => {
it("Write URL", () => {
cy.get("#server_url").type(Cypress.env("URL"));
});
it("Write ID", () => {
cy.get("#client_id").type(Cypress.env("ID"));
});
it("Write SECRET", () => {
cy.get("#client_secret").type(Cypress.env("SECRET"));
});
});

context("Redirection", () => {
it("Click on save", () => {
cy.get(".btn-green").click();
cy.wait(5000);
});

it("Go back home", () => {
cy.get(".pia-modalBlock-buttons-choice button[type=button]").click();
cy.url().should("include", "/");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export function context_edit_eval() {
});

it("should valid evaluation", () => {
cy.validateEval();
});

it("should valid modal for evaluation", () => {
cy.validateModal();
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 1, 1);
cy.validateEval();
cy.validateModal();
});
});
});

Expand All @@ -40,11 +40,11 @@ export function context_edit_eval() {
});

it("should valid evaluation", () => {
cy.validateEval();
});

it("should valid modal for evaluation", () => {
cy.validateModal();
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 1, 2);
cy.validateEval();
cy.validateModal();
});
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,24 @@ describe("Validation", () => {
});

it("should valid pia", () => {
cy.validatePia();
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 4, 3).then(() => {
cy.validatePia();
cy.closeValidationEvaluationModal();
});
});
});

it("should show report", () => {
cy.closeValidationEvaluationModal();
cy.get(".pia-entryContentBlock-header a.btn.pia-previewBlock").click();

cy.url().should("include", "/preview/" + visit_id);

cy.get(".pia-fullPreviewBlock-data").should("exist");
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 4, 3).then(() => {
cy.get(
".pia-entryContentBlock-header a.btn.pia-previewBlock"
).click();
cy.url().should("include", "/preview/" + 2);
cy.get(".pia-fullPreviewBlock-data").should("exist");
});
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,18 @@ describe("Entries_table", () => {
beforeEach(() => {
// Skip tutorial
cy.disable_onboarding();
cy.visit(`/#/entries`);
cy.get(".pia-filtersBlock-switch").click();
});

/**
* Table
*/
context("entries_table", () => {
it("change display", () => {
cy.init();
cy.click_on_start();
cy.get(".pia-filtersBlock-switch").click();
});

it("verify if is there a table", () => {
it("change display and check if there is a table", () => {
cy.get("table").should("exist");
});

/**
* Create pia
*/
Expand All @@ -47,9 +44,6 @@ describe("Entries_table", () => {
* Edit pia
*/
it("should edit pia", () => {
// Redirect into entries
cy.visit(`/#/entries`);
cy.get(".pia-filtersBlock-switch").click();
//Edit Title
cy.wait(500);
cy.get(".pia-list-table tbody tr td:eq(1) div")
Expand Down Expand Up @@ -80,7 +74,7 @@ describe("Entries_table", () => {
* Duplicate pia
*/
it("should duplicate pia", () => {
cy.get(".pia-list-table tbody tr").should("have.length", 1);
// cy.get(".pia-list-table tbody tr").should("have.length", 1);
cy.get(".pia-list-table tbody tr:eq(0) td:eq(0) .fa-files-o").click();
cy.get(".pia-list-table tbody tr:eq(1)");
cy.get(".pia-list-table tbody tr").should("have.length", 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,11 @@ export function fundamental_principle_edit_eval() {
* Validate data
*/
it("should valid evaluation", () => {
cy.validateEval();
});

/**
* Close Popup
*/
it("should valid modal for evaluation", () => {
cy.validateModal();
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 2, 1);
cy.validateEval();
cy.validateModal();
});
});
});

Expand All @@ -60,14 +57,11 @@ export function fundamental_principle_edit_eval() {
* Validate data
*/
it("should valid evaluation", () => {
cy.validateEval();
});

/**
* Close Popup
*/
it("should valid modal for evaluation", () => {
cy.validateModal();
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 2, 2);
cy.validateEval();
cy.validateModal();
});
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ describe("Home", () => {
});

// ->
it("click on start", () => {
it("click on start and check url", () => {
cy.visit("/");
cy.get(".btn-green").click();
});

// test l'url, verifier que ça soit bien /entries
it("verify url", () => {
cy.url().should("include", "/entries");
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ export function risk_edit_eval() {
});

it("on click on btn.green, go back to section 3, 1", () => {
cy.get(".btn-green").click();
cy.url().should("include", "section/3/item/1");
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 3, 3);
cy.get(".btn-green").click();
cy.url().should("include", "section/3/item/1");
});
});
});

Expand All @@ -51,16 +54,19 @@ export function risk_edit_eval() {
});

it("set Measures with + ", () => {
cy.test_add_measure();
cy.wait(200);
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 3, 1);
cy.test_add_measure();
cy.wait(200);
});
});

it("should valid evaluation", () => {
cy.validateEval();
});

it("should valid modal for evaluation", () => {
cy.validateModal();
cy.get_current_pia_id(id => {
cy.go_edited_pia(id, 3, 1);
cy.validateEval();
cy.validateModal();
});
});
});

Expand All @@ -76,11 +82,12 @@ export function risk_edit_eval() {
});

it("should valid evaluation", () => {
cy.validateEval();
});

it("should valid modal for evaluation", () => {
cy.validateModal();
cy.get_current_pia_id(id => {
// change section and item
cy.go_edited_pia(id, 3, 2);
cy.validateEval();
cy.validateModal();
});
});
});

Expand All @@ -92,17 +99,22 @@ export function risk_edit_eval() {
cy.test_add_tags_next();
cy.test_move_gauges();
cy.test_writing_on_textarea_gauges();
cy.validateEval();
cy.validateModal();
});
});
});
//
it("should valid evaluation", () => {
cy.validateEval();
});

it("should valid modal for evaluation", () => {
cy.validateModal();
});
//
// it("should valid evaluation", () => {
// cy.get_current_pia_id(id => {
// // change section and item
// cy.go_edited_pia(id, 3, 3).then(() => {
// cy.validateEval();
// cy.validateModal();
// });
// });
// });
});

context("Disparition de données", () => {
Expand All @@ -115,11 +127,14 @@ export function risk_edit_eval() {
cy.test_writing_on_textarea_gauges();
});
});

it("should valid evaluation", () => {
cy.validateEval();
});
it("should valid modal for evaluation", () => {
cy.validateModalComplete();
cy.get_current_pia_id(id => {
// change section and item
cy.go_edited_pia(id, 3, 4);
cy.validateEval();
cy.validateModalComplete();
});
});
});
});
Expand Down
Loading

0 comments on commit b33007a

Please sign in to comment.