From 0f8302988033e2a820560df2e081c2ff72890a1b Mon Sep 17 00:00:00 2001 From: Ihor Dluhosh Date: Tue, 31 May 2022 12:26:33 +0200 Subject: [PATCH 1/4] test: update accessibility test --- cypress/integration/accessibility/a11y-eighth-part.test.js | 3 +++ cypress/integration/accessibility/a11y-fifth-part.test.js | 2 +- cypress/integration/accessibility/a11y-first-part.test.js | 2 +- cypress/integration/accessibility/a11y-fourth-part.test.js | 2 +- cypress/integration/accessibility/a11y-ninth-part.test.js | 3 +++ cypress/integration/accessibility/a11y-second-part.test.js | 2 +- cypress/integration/accessibility/a11y-seventh-part.test.js | 3 +++ cypress/integration/accessibility/a11y-sixth-part.test.js | 2 +- cypress/integration/accessibility/a11y-tenth-part.test.js | 3 +++ cypress/integration/accessibility/a11y-third-part.test.js | 2 +- 10 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 cypress/integration/accessibility/a11y-eighth-part.test.js create mode 100644 cypress/integration/accessibility/a11y-ninth-part.test.js create mode 100644 cypress/integration/accessibility/a11y-seventh-part.test.js create mode 100644 cypress/integration/accessibility/a11y-tenth-part.test.js diff --git a/cypress/integration/accessibility/a11y-eighth-part.test.js b/cypress/integration/accessibility/a11y-eighth-part.test.js new file mode 100644 index 0000000000..bb293ce453 --- /dev/null +++ b/cypress/integration/accessibility/a11y-eighth-part.test.js @@ -0,0 +1,3 @@ +import tests from "../../support/accessibility/a11y-utils"; + +tests(626, 750); diff --git a/cypress/integration/accessibility/a11y-fifth-part.test.js b/cypress/integration/accessibility/a11y-fifth-part.test.js index 0bac909536..a7b9ef31f5 100644 --- a/cypress/integration/accessibility/a11y-fifth-part.test.js +++ b/cypress/integration/accessibility/a11y-fifth-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(601, 750); +tests(351, 425); diff --git a/cypress/integration/accessibility/a11y-first-part.test.js b/cypress/integration/accessibility/a11y-first-part.test.js index aa10c18f76..b27274a979 100644 --- a/cypress/integration/accessibility/a11y-first-part.test.js +++ b/cypress/integration/accessibility/a11y-first-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(0, 150); +tests(0, 75); diff --git a/cypress/integration/accessibility/a11y-fourth-part.test.js b/cypress/integration/accessibility/a11y-fourth-part.test.js index 0b8615b969..b8ceb0d7c8 100644 --- a/cypress/integration/accessibility/a11y-fourth-part.test.js +++ b/cypress/integration/accessibility/a11y-fourth-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(451, 600); +tests(226, 350); diff --git a/cypress/integration/accessibility/a11y-ninth-part.test.js b/cypress/integration/accessibility/a11y-ninth-part.test.js new file mode 100644 index 0000000000..a7d426092c --- /dev/null +++ b/cypress/integration/accessibility/a11y-ninth-part.test.js @@ -0,0 +1,3 @@ +import tests from "../../support/accessibility/a11y-utils"; + +tests(751, 800); diff --git a/cypress/integration/accessibility/a11y-second-part.test.js b/cypress/integration/accessibility/a11y-second-part.test.js index 1053a35c5c..7378ee25a4 100644 --- a/cypress/integration/accessibility/a11y-second-part.test.js +++ b/cypress/integration/accessibility/a11y-second-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(151, 300); +tests(76, 150); diff --git a/cypress/integration/accessibility/a11y-seventh-part.test.js b/cypress/integration/accessibility/a11y-seventh-part.test.js new file mode 100644 index 0000000000..c88a710e2a --- /dev/null +++ b/cypress/integration/accessibility/a11y-seventh-part.test.js @@ -0,0 +1,3 @@ +import tests from "../../support/accessibility/a11y-utils"; + +tests(551, 625); diff --git a/cypress/integration/accessibility/a11y-sixth-part.test.js b/cypress/integration/accessibility/a11y-sixth-part.test.js index 70c23cea79..addd4f46ce 100644 --- a/cypress/integration/accessibility/a11y-sixth-part.test.js +++ b/cypress/integration/accessibility/a11y-sixth-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(751); +tests(426, 550); diff --git a/cypress/integration/accessibility/a11y-tenth-part.test.js b/cypress/integration/accessibility/a11y-tenth-part.test.js new file mode 100644 index 0000000000..2381dc0f5c --- /dev/null +++ b/cypress/integration/accessibility/a11y-tenth-part.test.js @@ -0,0 +1,3 @@ +import tests from "../../support/accessibility/a11y-utils"; + +tests(801); diff --git a/cypress/integration/accessibility/a11y-third-part.test.js b/cypress/integration/accessibility/a11y-third-part.test.js index dff4d0a012..4fc4f3824d 100644 --- a/cypress/integration/accessibility/a11y-third-part.test.js +++ b/cypress/integration/accessibility/a11y-third-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(301, 450); +tests(151, 225); From d8939e690f89a859f08fac5febba842fd33f0c10 Mon Sep 17 00:00:00 2001 From: Ihor Dluhosh Date: Tue, 31 May 2022 12:34:54 +0200 Subject: [PATCH 2/4] test: remove delay --- src/components/decimal/decimal.test.js | 8 ++++++-- .../grouped-character/grouped-character.test.js | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/decimal/decimal.test.js b/src/components/decimal/decimal.test.js index e389b9edd8..0d269b70bd 100644 --- a/src/components/decimal/decimal.test.js +++ b/src/components/decimal/decimal.test.js @@ -96,7 +96,9 @@ context("Tests for Decimal component", () => { (precision, inputValue, outputValue) => { CypressMountWithProviders(); - commonDataElementInputPreview().type(inputValue).blur({ force: true }); + commonDataElementInputPreview() + .type(inputValue, { delay: 0 }) + .blur({ force: true }); commonDataElementInputPreview().should("have.value", outputValue); } ); @@ -127,7 +129,9 @@ context("Tests for Decimal component", () => { (locale, inputValue, outputValue) => { CypressMountWithProviders(); - commonDataElementInputPreview().type(inputValue).blur({ force: true }); + commonDataElementInputPreview() + .type(inputValue, { delay: 0 }) + .blur({ force: true }); commonDataElementInputPreview() .invoke("val") .then(($el) => { diff --git a/src/components/grouped-character/grouped-character.test.js b/src/components/grouped-character/grouped-character.test.js index 39107b612a..280e534708 100644 --- a/src/components/grouped-character/grouped-character.test.js +++ b/src/components/grouped-character/grouped-character.test.js @@ -61,7 +61,9 @@ context("Tests for GroupedCharacter component", () => { (group, inputValue, outputValue) => { CypressMountWithProviders(); - commonDataElementInputPreview().type(inputValue).blur({ force: true }); + commonDataElementInputPreview() + .type(inputValue, { delay: 0 }) + .blur({ force: true }); commonDataElementInputPreview() .invoke("val") .then(($el) => { @@ -87,7 +89,9 @@ context("Tests for GroupedCharacter component", () => { ); - commonDataElementInputPreview().type(inputValue).blur({ force: true }); + commonDataElementInputPreview() + .type(inputValue, { delay: 0 }) + .blur({ force: true }); commonDataElementInputPreview() .invoke("val") .then(($el) => { @@ -197,7 +201,7 @@ context("Tests for GroupedCharacter component", () => { ); commonDataElementInputPreview() - .type(inputValue) + .type(inputValue, { delay: 0 }) .blur({ force: true }) .then(() => { // eslint-disable-next-line no-unused-expressions From 52244dd4f7e8878db82bf89028962f80aab5db6b Mon Sep 17 00:00:00 2001 From: Ihor Dluhosh Date: Tue, 31 May 2022 12:35:15 +0200 Subject: [PATCH 3/4] ci: rearrange the amount of containers --- .github/workflows/cypress.yml | 20 +++++++++---------- .../accessibility/a11y-eighth-part.test.js | 2 +- .../accessibility/a11y-eleventh-part.test.js | 3 +++ .../accessibility/a11y-fifth-part.test.js | 2 +- .../accessibility/a11y-fourth-part.test.js | 2 +- .../accessibility/a11y-ninth-part.test.js | 2 +- .../accessibility/a11y-seventh-part.test.js | 2 +- .../accessibility/a11y-sixth-part.test.js | 2 +- .../accessibility/a11y-tenth-part.test.js | 2 +- .../accessibility/a11y-twelfth-part.test.js | 3 +++ 10 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 cypress/integration/accessibility/a11y-eleventh-part.test.js create mode 100644 cypress/integration/accessibility/a11y-twelfth-part.test.js diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 8775801f47..fabb1093e4 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -20,7 +20,7 @@ jobs: # https://github.com/cypress-io/github-action/issues/48 fail-fast: false matrix: - # run 20 copies of the current job in parallel + # run 15 copies of the current job in parallel containers: [ 1, @@ -38,11 +38,6 @@ jobs: 13, 14, 15, - 16, - 17, - 18, - 19, - 20, ] container: cypress/browsers:node14.17.6-slim-chrome100-ff99-edge steps: @@ -117,10 +112,11 @@ jobs: # https://github.com/cypress-io/github-action/issues/48 fail-fast: false matrix: - # run 1 copy of the current job in parallel + # run 2 copy of the current job in parallel containers: [ - 1 + 1, + 2, ] container: cypress/browsers:node14.17.6-slim-chrome100-ff99-edge steps: @@ -188,7 +184,7 @@ jobs: # https://github.com/cypress-io/github-action/issues/48 fail-fast: false matrix: - # run 6 copies of the current job in parallel + # run 10 copies of the current job in parallel containers: [ 1, @@ -196,7 +192,11 @@ jobs: 3, 4, 5, - 6 + 6, + 7, + 8, + 9, + 10, ] container: cypress/browsers:node14.17.6-slim-chrome100-ff99-edge steps: diff --git a/cypress/integration/accessibility/a11y-eighth-part.test.js b/cypress/integration/accessibility/a11y-eighth-part.test.js index bb293ce453..61a614a149 100644 --- a/cypress/integration/accessibility/a11y-eighth-part.test.js +++ b/cypress/integration/accessibility/a11y-eighth-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(626, 750); +tests(526, 600); diff --git a/cypress/integration/accessibility/a11y-eleventh-part.test.js b/cypress/integration/accessibility/a11y-eleventh-part.test.js new file mode 100644 index 0000000000..fabc573776 --- /dev/null +++ b/cypress/integration/accessibility/a11y-eleventh-part.test.js @@ -0,0 +1,3 @@ +import tests from "../../support/accessibility/a11y-utils"; + +tests(751, 825); diff --git a/cypress/integration/accessibility/a11y-fifth-part.test.js b/cypress/integration/accessibility/a11y-fifth-part.test.js index a7b9ef31f5..b5d1c106a7 100644 --- a/cypress/integration/accessibility/a11y-fifth-part.test.js +++ b/cypress/integration/accessibility/a11y-fifth-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(351, 425); +tests(301, 375); diff --git a/cypress/integration/accessibility/a11y-fourth-part.test.js b/cypress/integration/accessibility/a11y-fourth-part.test.js index b8ceb0d7c8..8e6fbc354a 100644 --- a/cypress/integration/accessibility/a11y-fourth-part.test.js +++ b/cypress/integration/accessibility/a11y-fourth-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(226, 350); +tests(226, 300); diff --git a/cypress/integration/accessibility/a11y-ninth-part.test.js b/cypress/integration/accessibility/a11y-ninth-part.test.js index a7d426092c..8da268ef9a 100644 --- a/cypress/integration/accessibility/a11y-ninth-part.test.js +++ b/cypress/integration/accessibility/a11y-ninth-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(751, 800); +tests(601, 675); diff --git a/cypress/integration/accessibility/a11y-seventh-part.test.js b/cypress/integration/accessibility/a11y-seventh-part.test.js index c88a710e2a..f1188551b1 100644 --- a/cypress/integration/accessibility/a11y-seventh-part.test.js +++ b/cypress/integration/accessibility/a11y-seventh-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(551, 625); +tests(451, 525); diff --git a/cypress/integration/accessibility/a11y-sixth-part.test.js b/cypress/integration/accessibility/a11y-sixth-part.test.js index addd4f46ce..3f4c10e501 100644 --- a/cypress/integration/accessibility/a11y-sixth-part.test.js +++ b/cypress/integration/accessibility/a11y-sixth-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(426, 550); +tests(376, 450); diff --git a/cypress/integration/accessibility/a11y-tenth-part.test.js b/cypress/integration/accessibility/a11y-tenth-part.test.js index 2381dc0f5c..527d7fbd9c 100644 --- a/cypress/integration/accessibility/a11y-tenth-part.test.js +++ b/cypress/integration/accessibility/a11y-tenth-part.test.js @@ -1,3 +1,3 @@ import tests from "../../support/accessibility/a11y-utils"; -tests(801); +tests(676, 750); diff --git a/cypress/integration/accessibility/a11y-twelfth-part.test.js b/cypress/integration/accessibility/a11y-twelfth-part.test.js new file mode 100644 index 0000000000..de26344480 --- /dev/null +++ b/cypress/integration/accessibility/a11y-twelfth-part.test.js @@ -0,0 +1,3 @@ +import tests from "../../support/accessibility/a11y-utils"; + +tests(826); From fcb88c0e067dcf678883bee4ae1f75dc04b45cdf Mon Sep 17 00:00:00 2001 From: Ihor Dluhosh Date: Wed, 1 Jun 2022 12:08:52 +0200 Subject: [PATCH 4/4] test(date): fix failing test --- src/components/date/date.test.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/components/date/date.test.js b/src/components/date/date.test.js index 75b18e749e..3a348a2954 100644 --- a/src/components/date/date.test.js +++ b/src/components/date/date.test.js @@ -45,11 +45,14 @@ import { verifyRequiredAsterisk } from "../../../cypress/support/component-helpe import CypressMountWithProviders from "../../../cypress/support/component-helper/cypress-mount"; const DAY_PICKER_PREFIX = "DayPicker-Day--"; -const TODAY_CALENDAR = Cypress.dayjs().format("ddd D MMM YYYY"); +const TODAY = Cypress.dayjs().format("ddd D MMM YYYY"); +const DATE_INPUT = Cypress.dayjs("2022-05-01").format("DD/MM/YYYY"); const TODAY_DATE_INPUT = Cypress.dayjs().format("DD/MM/YYYY"); -const NEXT_MONTH = Cypress.dayjs().add(1, "months").format("MMMM YYYY"); -const ACTUAL_MONTH = Cypress.dayjs().format("MMMM YYYY"); -const PREVIOUS_MONTH = Cypress.dayjs() +const NEXT_MONTH = Cypress.dayjs("2022-05-01") + .add(1, "months") + .format("MMMM YYYY"); +const ACTUAL_MONTH = Cypress.dayjs("2022-05-01").format("MMMM YYYY"); +const PREVIOUS_MONTH = Cypress.dayjs("2022-05-01") .subtract(1, "months") .format("MMMM YYYY"); const MIN_DATE = "04/04/2030"; @@ -158,13 +161,13 @@ context("Test for DateInput component", () => { dateInput().clear().type(TODAY_DATE_INPUT); - dayPickerDay(TODAY_CALENDAR) + dayPickerDay(TODAY) .should("have.attr", "aria-label") - .and("contains", TODAY_CALENDAR); - dayPickerDay(TODAY_CALENDAR) + .and("contains", TODAY); + dayPickerDay(TODAY) .should("have.attr", "class") .and("contains", `${DAY_PICKER_PREFIX}today`); - dayPickerDay(TODAY_CALENDAR) + dayPickerDay(TODAY) .should("have.attr", "class") .and("contains", `${DAY_PICKER_PREFIX}selected`); }); @@ -223,7 +226,7 @@ context("Test for DateInput component", () => { (arrow, month) => { CypressMountWithProviders(); - dateInput().clear().type(TODAY_DATE_INPUT); + dateInput().clear().type(DATE_INPUT); dateInputParent().click(); getDataElementByValue(arrow).click(); @@ -246,7 +249,7 @@ context("Test for DateInput component", () => { (arrow, month, key) => { CypressMountWithProviders(); - dateInput().clear().type(TODAY_DATE_INPUT); + dateInput().clear().type(DATE_INPUT); dateInputParent().click(); dayPickerWrapper().focus();