Skip to content

Commit

Permalink
e2e: updated to cypress 11
Browse files Browse the repository at this point in the history
  • Loading branch information
karolina-siemieniuk-morawska committed Aug 15, 2023
1 parent 01152fa commit 8b87713
Show file tree
Hide file tree
Showing 129 changed files with 46 additions and 38 deletions.
4 changes: 3 additions & 1 deletion e2e/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ module.exports = defineConfig({
return require('./cypress/plugins/index.js')(on, config)
},
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
experimentalRunAllSpecs: true
experimentalRunAllSpecs: true,
experimentalMemoryManagement: true,
numTestsKeptInMemory: 0
},
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
2 changes: 1 addition & 1 deletion e2e/cypress/e2e/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('settings', () => {
.click();

cy.waitForRoute('/api/accounts/settings/update-email')
.its('status')
.its('response.statusCode')
.should('equal', 200);
});
});
12 changes: 6 additions & 6 deletions e2e/cypress/e2e/user.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { onlyOn } from '@cypress/skip-test';

describe('user', () => {
it('logs in via local login form and then logs out', () => {
it.only('logs in via local login form and then logs out', () => {
const username = `cataloger@inspirehep.net`;
const password = '123456';
cy.visit('/user/login/local');
Expand All @@ -16,16 +16,16 @@ describe('user', () => {
.get('[data-test-id=password]')
.type(password)
.get('[data-test-id=login]')
.click();
.click();;

cy.waitForRoute('/api/accounts/login').its('status').should('equal', 200);
cy.waitForRoute('/api/accounts/login').its('response.statusCode').should('equal', 200);

cy.registerRoute('/api/accounts/logout');

cy.get('.ant-menu-title-content').contains('Account').trigger('mouseover')
cy.get('[data-test-id="logout"]').children().first().click();

cy.waitForRoute('/api/accounts/logout').its('status').should('equal', 200);
cy.waitForRoute('/api/accounts/logout').its('response.statusCode').should('equal', 200);
});

onlyOn('headless', () => {
Expand All @@ -47,14 +47,14 @@ describe('user', () => {
.get('[data-test-id=login]')
.click();

cy.waitForRoute('/api/accounts/login').its('status').should('equal', 200);
cy.waitForRoute('/api/accounts/login').its('statusCode').should('equal', 200);

cy.clearCookies();
cy.request({
url: '/api/accounts/me',
failOnStatusCode: false,
})
.its('status')
.its('statusCode')
.should('equal', 401);

cy.window().trigger('mouseover', 'topRight');
Expand Down
3 changes: 1 addition & 2 deletions e2e/cypress/support/commands/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ Cypress.Commands.add('registerRoute', (optionsOrRoute = '/api/**') => {
route = optionsOrRoute.url;
}

cy.server();
cy.route(optionsOrRoute).as(route);
cy.intercept(optionsOrRoute).as(route);
});

Cypress.Commands.add('waitForRoute', (route = '/api/**') => {
Expand Down
8 changes: 4 additions & 4 deletions e2e/cypress/support/commands/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ Cypress.Commands.add(
const mapIdToRequest = () => {
if (xhr.response.body.pid_value) {
return {
status: cy.wrap(xhr).its('status').should('equal', 201),
status: cy.wrap(xhr.response).its('statusCode').should('equal', 201),
request: cy.requestRecord({ collection, recordId: xhr.response.body.pid_value }),
};
} else if (xhr.response.body.control_number) {
return {
status: cy.wrap(xhr).its('status').should('equal', 201),
status: cy.wrap(xhr.response).its('statusCode').should('equal', 201),
request: cy.requestEditor({ collection, recordId: xhr.response.body.control_number }),
};
} else {
return {
status: cy.wrap(xhr).its('status').should('equal', 200),
status: cy.wrap(xhr.response).its('statusCode').should('equal', 200),
request: cy.requestWorkflow({ workflowId: xhr.response.body.workflow_object_id }),
}
}
Expand Down Expand Up @@ -74,7 +74,7 @@ Cypress.Commands.add(
});
cy.submitForm(formData);

cy.waitForRoute(apiRoute).its('status').should('equal', 200);
cy.waitForRoute(apiRoute).its('statusCode').should('equal', 200);

cy.requestRecord({ collection, recordId })
.its('metadata')
Expand Down
4 changes: 2 additions & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"main": "index.js",
"scripts": {
"test:dev": "cypress open",
"test": "cypress run",
"test": "cypress run --browser chrome",
"cypress": "cypress"
},
"author": "",
"license": "ISC",
"dependencies": {
"@cypress/skip-test": "^2.5.0",
"chai-like": "^1.1.1",
"cypress": "^11.0.1",
"cypress": "^12.17.3",
"cypress-image-snapshot": "^4.0.1",
"cypress-terminal-report": "^4.1.2",
"moment": "^2.24.0"
Expand Down
51 changes: 29 additions & 22 deletions e2e/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==

"@cypress/request@^2.88.10":
"@cypress/request@^2.88.11":
version "2.88.12"
resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.12.tgz#ba4911431738494a85e93fb04498cb38bc55d590"
integrity sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==
Expand Down Expand Up @@ -54,10 +54,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.12.tgz#961e3091f263e6345d2d84afab4e047a60b4b11b"
integrity sha512-zxrTNFl9Z8boMJXs6ieqZP0wAhvkdzmHSxTlJabM16cf5G9xBc1uPRH5Bbv2omEDDiM8MzTfqTJXBf0Ba4xFWA==

"@types/node@^14.14.31":
version "14.17.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.9.tgz#b97c057e6138adb7b720df2bd0264b03c9f504fd"
integrity sha512-CMjgRNsks27IDwI785YMY0KLt3co/c0cQ5foxHYv/shC2w8oOnVwz5Ubq1QG5KzrcW+AXk6gzdnxIkDnTvzu3g==
"@types/node@^16.18.39":
version "16.18.40"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.40.tgz#968d64746d20cac747a18ca982c0f1fe518c031c"
integrity sha512-+yno3ItTEwGxXiS/75Q/aHaa5srkpnJaH+kdkTVJ3DtJEwv92itpKbxU+FjPoh2m/5G9zmUQfrL4A4C13c+iGA==

"@types/sinonjs__fake-timers@8.1.1":
version "8.1.1"
Expand Down Expand Up @@ -373,10 +373,10 @@ combined-stream@^1.0.6, combined-stream@~1.0.6:
dependencies:
delayed-stream "~1.0.0"

commander@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae"
integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==
commander@^6.2.1:
version "6.2.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c"
integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==

common-tags@^1.8.0:
version "1.8.0"
Expand Down Expand Up @@ -435,14 +435,14 @@ cypress-terminal-report@^4.1.2:
semver "^7.3.5"
tv4 "^1.3.0"

cypress@^11.0.1:
version "11.2.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-11.2.0.tgz#63edef8c387b687066c5493f6f0ad7b9ced4b2b7"
integrity sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==
cypress@^12.17.3:
version "12.17.3"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.3.tgz#1e2b19037236fc60e4a4b3a14f0846be17a1fc0e"
integrity sha512-/R4+xdIDjUSLYkiQfwJd630S81KIgicmQOLXotFxVXkl+eTeVO+3bHXxdi5KBh/OgC33HWN33kHX+0tQR/ZWpg==
dependencies:
"@cypress/request" "^2.88.10"
"@cypress/request" "^2.88.11"
"@cypress/xvfb" "^1.2.4"
"@types/node" "^14.14.31"
"@types/node" "^16.18.39"
"@types/sinonjs__fake-timers" "8.1.1"
"@types/sizzle" "^2.3.2"
arch "^2.2.0"
Expand All @@ -454,10 +454,10 @@ cypress@^11.0.1:
check-more-types "^2.24.0"
cli-cursor "^3.1.0"
cli-table3 "~0.6.1"
commander "^5.1.0"
commander "^6.2.1"
common-tags "^1.8.0"
dayjs "^1.10.4"
debug "^4.3.2"
debug "^4.3.4"
enquirer "^2.3.6"
eventemitter2 "6.4.7"
execa "4.1.0"
Expand All @@ -472,12 +472,12 @@ cypress@^11.0.1:
listr2 "^3.8.3"
lodash "^4.17.21"
log-symbols "^4.0.0"
minimist "^1.2.6"
minimist "^1.2.8"
ospath "^1.2.2"
pretty-bytes "^5.6.0"
proxy-from-env "1.0.0"
request-progress "^3.0.0"
semver "^7.3.2"
semver "^7.5.3"
supports-color "^8.1.1"
tmp "~0.2.1"
untildify "^4.0.0"
Expand All @@ -502,13 +502,20 @@ debug@^3.1.0:
dependencies:
ms "^2.1.1"

debug@^4.1.1, debug@^4.3.2:
debug@^4.1.1:
version "4.3.2"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==
dependencies:
ms "2.1.2"

debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"

delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
Expand Down Expand Up @@ -1064,7 +1071,7 @@ minimist@^1.2.5:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==

minimist@^1.2.6:
minimist@^1.2.8:
version "1.2.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
Expand Down Expand Up @@ -1324,7 +1331,7 @@ semver@^5.5.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==

semver@^7.3.2, semver@^7.3.5:
semver@^7.3.5, semver@^7.5.3:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
Expand Down

0 comments on commit 8b87713

Please sign in to comment.