Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9771 from matrix-org/renovate/cypress-12.x
Browse files Browse the repository at this point in the history
Update dependency cypress to v12
  • Loading branch information
andybalaam authored Jan 13, 2023
2 parents 3874314 + 683b092 commit b9e9878
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ jobs:
COMMIT_INFO_MESSAGE: ${{ needs.prepare.outputs.commit_message }}
COMMIT_INFO_AUTHOR: ${{ needs.prepare.outputs.commit_author }}
COMMIT_INFO_EMAIL: ${{ needs.prepare.outputs.commit_email }}
CYPRESS_PULL_REQUEST_ID: ${{ needs.prepare.outputs.pr_id }}
CYPRESS_PULL_REQUEST_URL: https://github.com/${{ github.repository }}/pull/${{ needs.prepare.outputs.pr_id }}

# pass the Percy token as an environment variable
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
Expand Down
1 change: 0 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default defineConfig({
return require("./cypress/plugins/index.ts").default(on, config);
},
baseUrl: "http://localhost:8080",
experimentalSessionAndOrigin: true,
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
},
env: {
Expand Down
22 changes: 20 additions & 2 deletions cypress/e2e/integration-manager/kick.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,27 @@ function sendActionFromIntegrationManager(integrationManagerUrl: string, targetR
});
}

function clickUntilGone(selector: string, attempt = 0) {
if (attempt === 11) {
throw new Error("clickUntilGone attempt count exceeded");
}

cy.get(selector)
.last()
.click()
.then(($button) => {
const exists = Cypress.$(selector).length > 0;
if (exists) {
clickUntilGone(selector, ++attempt);
}
});
}

function expectKickedMessage(shouldExist: boolean) {
// Expand any event summaries
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=false]").click({ multiple: true });
// Expand any event summaries, we can't use a click multiple here because clicking one might de-render others
// This is quite horrible but seems the most stable way of clicking 0-N buttons,
// one at a time with a full re-evaluation after each click
clickUntilGone(".mx_GenericEventListSummary_toggle[aria-expanded=false]");

// Check for the event message (or lack thereof)
cy.contains(".mx_EventTile_line", `${USER_DISPLAY_NAME} removed ${BOT_DISPLAY_NAME}: ${KICK_REASON}`).should(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
"babel-jest": "^29.0.0",
"blob-polyfill": "^7.0.0",
"chokidar": "^3.5.1",
"cypress": "^11.0.0",
"cypress": "^12.0.0",
"cypress-axe": "^1.0.0",
"cypress-multi-reporters": "^1.6.1",
"cypress-real-events": "^1.7.1",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3555,10 +3555,10 @@ cypress-real-events@^1.7.1:
resolved "https://registry.yarnpkg.com/cypress-real-events/-/cypress-real-events-1.7.4.tgz#87780ee0f6669ee30ce52016c4bfc94d094a6e3d"
integrity sha512-bAlIf3w6uJa72hcbLFpQIl/hBoNGYnSVzFMgohefWcooyZz2WbFZdFAEDOl5qOPATtAU01o92sWvc2QW9eT8aA==

cypress@^11.0.0:
version "11.2.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-11.2.0.tgz#63edef8c387b687066c5493f6f0ad7b9ced4b2b7"
integrity sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==
cypress@^12.0.0:
version "12.3.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.3.0.tgz#ae3fb0540aef4b5eab1ef2bcd0760caf2992b8bf"
integrity sha512-ZQNebibi6NBt51TRxRMYKeFvIiQZ01t50HSy7z/JMgRVqBUey3cdjog5MYEbzG6Ktti5ckDt1tfcC47lmFwXkw==
dependencies:
"@cypress/request" "^2.88.10"
"@cypress/xvfb" "^1.2.4"
Expand Down

0 comments on commit b9e9878

Please sign in to comment.