From 7d4d9f72c816218545f6f77e6cb2ee513b681229 Mon Sep 17 00:00:00 2001 From: Karoline Tufte Lien Date: Mon, 7 Sep 2026 18:54:14 +0200 Subject: [PATCH] chore: gate the sharing dialog search box and keep e2e failure artifacts `you change the sharing settings` clicked "Share view" and typed into the dialog's search box with nothing in between. The box is disabled while the dialog loads the object's sharing state, and `cy.type()` does not wait for that to clear - the CI error carries no "Timed out retrying" prefix, so it threw immediately rather than after the command timeout. `cy.get` only retried until the input existed, which it does while still disabled. Gate it with a retrying `should('be.enabled')` and scope the lookup to the dialog, the way the newer WorkingListsSharing step already does - the bare `[placeholder="Search"]` would match any search box on the page. This is the failure seen on `cypress (2.42, 5)` and, on another branch, on `cypress (2.43, 5)` - same scenario, same error, different version, so it is a race rather than anything version specific. Neither cypress job kept its screenshots or videos: recording to Cypress Cloud is opt-in through `[e2e record]` or the `e2e record` label, and nothing uploaded the local artifacts, so a failing shard left nothing to look at. Upload them on failure only, with a short retention. Verified against play stable-2-43-1: both sharing scenarios pass with the gate in place. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/e2e-tests.yml | 10 ++++++++++ .github/workflows/verify-app.yml | 10 ++++++++++ cypress/e2e/WorkingLists/sharedSteps.js | 5 ++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index e838d1ae2c..ecd8cb5086 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -147,6 +147,16 @@ jobs: CYPRESS_dhis2Password_trackerAutoTestRestricted: ${{ secrets.CYPRESS_DHIS2_PASSWORD_TRACKER_AUTO_TEST_RESTRICTED }} NODE_OPTIONS: "--openssl-legacy-provider" + - uses: actions/upload-artifact@v7 + if: failure() + with: + name: cypress-failure-${{ matrix.versions }}-${{ matrix.spec-group.id }} + path: | + cypress/screenshots + cypress/videos + if-no-files-found: ignore + retention-days: 7 + call-e2e-tests-result: needs: cypress uses: ./.github/workflows/e2e-tests-result.yml diff --git a/.github/workflows/verify-app.yml b/.github/workflows/verify-app.yml index 9e3b485fc9..50f1efdf99 100644 --- a/.github/workflows/verify-app.yml +++ b/.github/workflows/verify-app.yml @@ -158,6 +158,16 @@ jobs: CYPRESS_dhis2Password_trackerAutoTestRestricted: ${{ secrets.CYPRESS_DHIS2_PASSWORD_TRACKER_AUTO_TEST_RESTRICTED }} NODE_OPTIONS: "--openssl-legacy-provider" + - uses: actions/upload-artifact@v7 + if: failure() + with: + name: cypress-failure-dev-${{ matrix.spec-group.id }} + path: | + cypress/screenshots + cypress/videos + if-no-files-found: ignore + retention-days: 7 + build: runs-on: ubuntu-latest needs: [lint, typescript, unit-tests] diff --git a/cypress/e2e/WorkingLists/sharedSteps.js b/cypress/e2e/WorkingLists/sharedSteps.js index 5a4f48c094..003aa086b5 100644 --- a/cypress/e2e/WorkingLists/sharedSteps.js +++ b/cypress/e2e/WorkingLists/sharedSteps.js @@ -235,7 +235,10 @@ Then(/^you can load the view with the name ?(.*)$/, (name) => { When('you change the sharing settings', () => { cy.get('[data-test="list-view-menu-button"]').click(); cy.contains('Share view').click(); - cy.get('[placeholder="Search"]').type('Boateng'); + cy.get('[data-test="sharing-dialog"]') + .find('[placeholder="Search"]') + .should('be.enabled') + .type('Boateng'); cy.contains('Kevin Boateng').click(); cy.contains('Choose a level').click(); cy.contains('View and edit').click({ force: true });