Skip to content

Commit 404f4e6

Browse files
committed
Scroll boolean toggle into view before clicking in cy.flip()
Add scrollIntoView() to cy.flip() so the bootstrap switch label is always visible before the click, preventing failures when the element is obscured by an open dropdown above it. Also applies pending Prettier formatting to workflow files and README.
1 parent ffa4a49 commit 404f4e6

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/manual-test-matrix-workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
- name: "Check docker status"
7676
run: systemctl status docker
7777
- name: "Run npm install"
78-
run: "npm install --ignore-scripts --before=\"$(date -d '7 days ago' --iso-8601=seconds)\""
78+
run: 'npm install --ignore-scripts --before="$(date -d ''7 days ago'' --iso-8601=seconds)"'
7979
- name: "Install Cypress binary"
8080
run: "npx cypress install"
8181
- name: "Run compile"

.github/workflows/reusable-build-project-workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
firefox-version: "latest-esr"
3838
- name: "Run npm install"
39-
run: "npm install --ignore-scripts --before=\"$(date -d '7 days ago' --iso-8601=seconds)\""
39+
run: 'npm install --ignore-scripts --before="$(date -d ''7 days ago'' --iso-8601=seconds)"'
4040
- name: "Install Cypress binary"
4141
run: "npx cypress install"
4242
- name: "Run compile"

.github/workflows/scheduled-run-all-tests-workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
- name: "Check docker status"
7171
run: "systemctl status docker"
7272
- name: "Run npm install"
73-
run: "npm install --ignore-scripts --before=\"$(date -d '7 days ago' --iso-8601=seconds)\""
73+
run: 'npm install --ignore-scripts --before="$(date -d ''7 days ago'' --iso-8601=seconds)"'
7474
- name: "Install Cypress binary"
7575
run: "npx cypress install"
7676
- name: "Run compile"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ npm install
4646
in the root directory to download all of the NPM dependencies specified in `package.json`
4747

4848
> **Security note:** To protect against npm supply chain attacks, it is recommended to use the following flags:
49+
>
4950
> - `--ignore-scripts` — prevents pre/post install scripts of dependencies from executing (main attack vector)
5051
> - `--before` — limits package resolution to versions published more than 7 days ago, relying on security teams removing compromised packages within that window
5152
>
@@ -54,6 +55,7 @@ in the root directory to download all of the NPM dependencies specified in `pack
5455
> ```
5556
>
5657
> Note: `--ignore-scripts` also skips the project's own `postinstall` hook and the Cypress binary download. Run the following steps manually afterwards:
58+
>
5759
> ```
5860
> npx cypress install
5961
> npm run compile

packages/testsuite/cypress/support/form-editing.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ Cypress.Commands.add("flip", (formId, attributeName, value) => {
114114
} else {
115115
cy.formInput(formId, attributeName).wait(1000).should("not.be.checked");
116116
}
117-
cy.get('div[data-form-item-group="' + formId + "-" + attributeName + '-editing"] .bootstrap-switch-label:visible')
117+
cy.get('div[data-form-item-group="' + formId + "-" + attributeName + '-editing"]')
118+
.scrollIntoView()
119+
.find(".bootstrap-switch-label")
118120
.click()
119121
.wait(1000);
120122
if (value) {

0 commit comments

Comments
 (0)