Merged in feature/upgrade_cypress (pull request #76)

Upgrade to Cypress 12

* Upgrade cypress

* Several fixes

* Fix cypress tests


Approved-by: Daniel Egger
This commit is contained in:
Elia Bieri 2023-05-10 10:16:40 +00:00 committed by Daniel Egger
parent aab9373c3e
commit 09d56091f1
6 changed files with 1901 additions and 336 deletions

View File

@ -13,7 +13,7 @@ e2e: &e2e
- vbvpip - vbvpip
- cypress - cypress
script: script:
- export CURRENTS_KEY=etzp5VXtJcSX8Z4H - export CURRENTS_RECORD_KEY=etzp5VXtJcSX8Z4H
- export IT_SERVE_VUE=false - export IT_SERVE_VUE=false
- export IT_ALLOW_LOCAL_LOGIN=true - export IT_ALLOW_LOCAL_LOGIN=true
- source ./env/bitbucket/prepare_for_test.sh - source ./env/bitbucket/prepare_for_test.sh

4
currents.config.js Normal file
View File

@ -0,0 +1,4 @@
module.exports = {
projectId: "RVEZS1",
recordKey: "etzp5VXtJcSX8Z4H",
};

View File

@ -1,7 +1,8 @@
const { defineConfig } = require('cypress') const { defineConfig } = require("cypress");
const { cloudPlugin } = require("cypress-cloud/plugin");
module.exports = defineConfig({ module.exports = defineConfig({
projectId: 'RVEZS1', projectId: "RVEZS1",
watchForFileChanges: false, watchForFileChanges: false,
video: false, video: false,
viewportWidth: 1280, viewportWidth: 1280,
@ -10,18 +11,16 @@ module.exports = defineConfig({
runMode: 1, runMode: 1,
openMode: 0, openMode: 0,
}, },
reporter: 'junit', reporter: "junit",
reporterOptions: { reporterOptions: {
mochaFile: 'cypress/test-reports/cypress-results-[hash].xml', mochaFile: "cypress/test-reports/cypress-results-[hash].xml",
toConsole: true, toConsole: true,
}, },
e2e: { e2e: {
// experimentalSessionAndOrigin: true, // experimentalSessionAndOrigin: true,
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) { setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config) return cloudPlugin(on, config);
}, },
baseUrl: 'http://localhost:8001', baseUrl: "http://localhost:8001",
}, },
}) });

View File

@ -13,9 +13,11 @@ describe("notifications page", () => {
cy.get('[data-cy="no-notifications"]').should("not.exist"); cy.get('[data-cy="no-notifications"]').should("not.exist");
cy.get("[data-cy^=notification-idx-]").should("have.length", 7); cy.get("[data-cy^=notification-idx-]").should("have.length", 7);
// All notifications shall be marker as unread // All notifications shall be marker as unread
cy.get("[data-cy^=notification-idx-]").within(() => { cy.get("[data-cy^=notification-idx-]")
cy.get('[data-cy="unread"]').should("exist"); .first()
}); .within(() => {
cy.get('[data-cy="unread"]').should("exist");
});
// We load additional 7 notifications // We load additional 7 notifications
cy.get('[data-cy="load-more-notifications"]').click(); cy.get('[data-cy="load-more-notifications"]').click();
@ -28,9 +30,11 @@ describe("notifications page", () => {
}); });
} }
for (let i = 7; i < 13; i++) { for (let i = 7; i < 13; i++) {
cy.get(`[data-cy=notification-idx-${i}]`).within(() => { cy.get(`[data-cy=notification-idx-${i}]`)
cy.get('[data-cy="unread"]').should("exist"); .first()
}); .within(() => {
cy.get('[data-cy="unread"]').should("exist");
});
} }
}); });

2192
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,13 +5,13 @@
"build": "npm install --prefix client && npm run build --prefix client && npm run build:tailwind --prefix client", "build": "npm install --prefix client && npm run build --prefix client && npm run build:tailwind --prefix client",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"cypress:open": "cypress open", "cypress:open": "cypress open",
"cypress:ci": "currents run --parallel --record --key $CURRENTS_KEY", "cypress:ci": "cypress-cloud run --parallel --record",
"prettier": "npm run prettier --prefix client", "prettier": "npm run prettier --prefix client",
"vue-i18n-extract": "npm run vue-i18n-extract --prefix client" "vue-i18n-extract": "npm run vue-i18n-extract --prefix client"
}, },
"devDependencies": { "devDependencies": {
"@currents/cli": "^3.1.3", "cypress": "^12.12.0",
"cypress": "^10.6.0" "cypress-cloud": "^1.7.4"
}, },
"dependencies": { "dependencies": {
"pa11y": "^6.2.3" "pa11y": "^6.2.3"