diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 32d499f92b..8d24db4cd4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -49,7 +49,7 @@ jobs: run: | if [[ "${{ github.event_name }}" == "push" ]] && [[ "${{ github.ref }}" == "refs/heads/master" ]]; then - matrix='{"browser":["chrome", "edge", "electron"],"containers":[1,2,3]}' + matrix='{"browser":["chrome", "edge", "electron", "firefox"],"containers":[1,2,3]}' else matrix='{"browser":["chrome"],"containers":[1,2,3]}' fi diff --git a/e2e/Dockerfile b/e2e/Dockerfile index 0c7f8898e4..028c3e618f 100644 --- a/e2e/Dockerfile +++ b/e2e/Dockerfile @@ -1,4 +1,4 @@ -FROM cypress/included:9.6.1 +FROM cypress/included:12.3.0 # Install testing dependencies RUN apt-get install --no-install-recommends -y python diff --git a/e2e/cypress.config.js b/e2e/cypress.config.js new file mode 100644 index 0000000000..b912eb5548 --- /dev/null +++ b/e2e/cypress.config.js @@ -0,0 +1,28 @@ +const { defineConfig } = require('cypress') + +module.exports = defineConfig({ + projectId: 'd8hk55', + experimentalFetchPolyfill: true, + numTestsKeptInMemory: 25, + includeShadowDom: true, + defaultCommandTimeout: 10000, + pageLoadTimeout: 80000, + viewportWidth: 1500, + viewportHeight: 800, + videoUploadOnPasses: false, + retries: { + runMode: 3, + }, + env: { + home_path: '/', + }, + e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + setupNodeEvents(on, config) { + return require('./cypress/plugins/index.js')(on, config) + }, + baseUrl: 'http://kitspace.test:3000', + specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}', + }, +}) diff --git a/e2e/cypress.json b/e2e/cypress.json deleted file mode 100644 index f7bdd30280..0000000000 --- a/e2e/cypress.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/cypress-io/cypress/develop/cli/schema/cypress.schema.json", - "projectId": "d8hk55", - "baseUrl": "http://kitspace.test:3000", - "experimentalFetchPolyfill": true, - "numTestsKeptInMemory": 25, - "includeShadowDom": true, - "defaultCommandTimeout": 10000, - "pageLoadTimeout": 80000, - "viewportWidth": 1500, - "viewportHeight": 800, - "videoUploadOnPasses": false, - "retries": { - "runMode": 3 - }, - "env": { - "home_path": "/" - } -} diff --git a/e2e/cypress/integration/IBOM.spec.js b/e2e/cypress/e2e/IBOM.spec.js similarity index 100% rename from e2e/cypress/integration/IBOM.spec.js rename to e2e/cypress/e2e/IBOM.spec.js diff --git a/e2e/cypress/integration/IBOM.visual.spec.js b/e2e/cypress/e2e/IBOM.visual.spec.js similarity index 100% rename from e2e/cypress/integration/IBOM.visual.spec.js rename to e2e/cypress/e2e/IBOM.visual.spec.js diff --git a/e2e/cypress/integration/errorPage.spec.js b/e2e/cypress/e2e/errorPage.spec.js similarity index 100% rename from e2e/cypress/integration/errorPage.spec.js rename to e2e/cypress/e2e/errorPage.spec.js diff --git a/e2e/cypress/integration/legacyRedirect.spec.js b/e2e/cypress/e2e/legacyRedirect.spec.js similarity index 100% rename from e2e/cypress/integration/legacyRedirect.spec.js rename to e2e/cypress/e2e/legacyRedirect.spec.js diff --git a/e2e/cypress/integration/multiProject.spec.js b/e2e/cypress/e2e/multiProject.spec.js similarity index 95% rename from e2e/cypress/integration/multiProject.spec.js rename to e2e/cypress/e2e/multiProject.spec.js index c9e11cb359..769521dcf9 100644 --- a/e2e/cypress/integration/multiProject.spec.js +++ b/e2e/cypress/e2e/multiProject.spec.js @@ -88,10 +88,12 @@ describe('Render project cards', () => { cy.get('nav [data-cy=search-form]').submit() // Click on a subproject project card - cy.get('[data-cy=project-card]').within(() => { - cy.contains(user.username) - cy.contains(multiProjectName).click({ force: true }) - }) + cy.get('[data-cy=project-card]') + .first() + .within(() => { + cy.contains(user.username) + cy.contains(multiProjectName).click({ force: true }) + }) // Should redirect to the `[user.username]/[projectName]/[multiProject]` cy.url({ timeout: 20_000 }).should( @@ -190,10 +192,12 @@ describe('Multi project page', () => { cy.get('nav [data-cy=search-form]').submit() // Click on a multiproject project card - cy.get('[data-cy=project-card]').within(() => { - cy.contains(user.username) - cy.contains(multiProjectName).click({ force: true }) - }) + cy.get('[data-cy=project-card]') + .first() + .within(() => { + cy.contains(user.username) + cy.contains(multiProjectName).click({ force: true }) + }) cy.url({ timeout: 20_000 }).should( 'contain', `${user.username}/${multiProjectsRepoName}/${multiProjectName}`, diff --git a/e2e/cypress/integration/readme.spec.js b/e2e/cypress/e2e/readme.spec.js similarity index 100% rename from e2e/cypress/integration/readme.spec.js rename to e2e/cypress/e2e/readme.spec.js diff --git a/e2e/cypress/integration/search.spec.js b/e2e/cypress/e2e/search.spec.js similarity index 100% rename from e2e/cypress/integration/search.spec.js rename to e2e/cypress/e2e/search.spec.js diff --git a/e2e/cypress/integration/syncRepo.spec.js b/e2e/cypress/e2e/syncRepo.spec.js similarity index 100% rename from e2e/cypress/integration/syncRepo.spec.js rename to e2e/cypress/e2e/syncRepo.spec.js diff --git a/e2e/cypress/support/index.js b/e2e/cypress/support/e2e.js similarity index 100% rename from e2e/cypress/support/index.js rename to e2e/cypress/support/e2e.js diff --git a/e2e/package.json b/e2e/package.json index 26571258d0..1fb856bd78 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -9,10 +9,10 @@ "license": "AGPL-3.0", "dependencies": { "@types/faker": "^5.1.0", - "cypress": "^9.4.1", - "cypress-fail-fast": "^3.3.0", + "cypress": "^12.17.2", + "cypress-fail-fast": "^7.0.0", "cypress-image-snapshot": "^4.0.1", - "cypress-terminal-report": "^3.4.1", + "cypress-terminal-report": "^5.0.0", "cypress-wait-until": "^1.7.2", "eslint": ">=7.0.0", "eslint-config-prettier": "8.3.0", diff --git a/e2e/yarn.lock b/e2e/yarn.lock index d507de7ca0..902cb18f58 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@cypress/request@^2.88.10": - version "2.88.10" - resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.10.tgz#b66d76b07f860d3a4b8d7a0604d020c662752cce" - integrity sha512-Zp7F+R93N0yZyG34GutyTNr+okam7s/Fzc1+i3kcqOP8vk6OuajuE9qZJ6Rs+10/1JFtXFYMdyarnU1rZuJesg== +"@cypress/request@^2.88.11": + version "2.88.11" + resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.11.tgz#5a4c7399bc2d7e7ed56e92ce5acb620c8b187047" + integrity sha512-M83/wfQ1EkspjkE2lNWNV5ui2Cv7UCv1swW1DqljahbzLVWltcsexQh8jYtuS/vzFXP+HySntGM83ZXA9fn17w== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -20,7 +20,7 @@ json-stringify-safe "~5.0.1" mime-types "~2.1.19" performance-now "^2.1.0" - qs "~6.5.2" + qs "~6.10.3" safe-buffer "^5.1.2" tough-cookie "~2.5.0" tunnel-agent "^0.6.0" @@ -347,14 +347,6 @@ chalk@^2.4.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - check-more-types@^2.24.0: version "2.24.0" resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" @@ -435,10 +427,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.2" @@ -475,10 +467,10 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2: shebang-command "^2.0.0" which "^2.0.1" -cypress-fail-fast@^3.3.0: - version "3.4.1" - resolved "https://registry.yarnpkg.com/cypress-fail-fast/-/cypress-fail-fast-3.4.1.tgz#3c4e0647f374ac02fdd4cb8154a3047471ceaad6" - integrity sha512-74UoLLRSNL9hbNqW4JVTEh7S1BKigrZmLmcxdntDmIDZrZFezb1A7BiSKSEXV8naLJ5xt8zK8YrEctpf0NZn3Q== +cypress-fail-fast@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/cypress-fail-fast/-/cypress-fail-fast-7.0.0.tgz#d50c58a6807df3df14e4c9154ce9d9b01c3b4b24" + integrity sha512-N8ei7clcqSWD4jrRMO6zPzSWcQTabGdnkIJBPCcnYYrlNyqsO3xFSGo6x796cR5soqetv10LCTJyCbvqNniUyA== dependencies: chalk "4.1.2" @@ -494,14 +486,13 @@ cypress-image-snapshot@^4.0.1: pkg-dir "^3.0.0" term-img "^4.0.0" -cypress-terminal-report@^3.4.1: - version "3.5.0" - resolved "https://registry.yarnpkg.com/cypress-terminal-report/-/cypress-terminal-report-3.5.0.tgz#688fd75621ed9c8d4e747bc1d41f81a6729cbe6a" - integrity sha512-dfjsOwVm5cGXdxwsMTx/C/zi66n9+rfflRKyZEhDXyqZPC6ffYV9pmr7kazVJuwJ2ws2jt8La3zVrJMeRKnCFQ== +cypress-terminal-report@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cypress-terminal-report/-/cypress-terminal-report-5.0.0.tgz#a9c8efc1200b63e8a7ce3e93a768adea28ab6f12" + integrity sha512-X5JVRB2fs/KbZJU19qLjzcLidA2TO4g5dm4ya4XDXLoGvtEDI9XWSX+E8CFC25wzbvczIboWGBxLKSsDRZrTBw== dependencies: - chalk "^3.0.0" - fs-extra "^9.0.1" - methods "^1.1.2" + chalk "^4.0.0" + fs-extra "^10.1.0" semver "^7.3.5" tv4 "^1.3.0" @@ -510,12 +501,12 @@ cypress-wait-until@^1.7.2: resolved "https://registry.yarnpkg.com/cypress-wait-until/-/cypress-wait-until-1.7.2.tgz#7f534dd5a11c89b65359e7a0210f20d3dfc22107" integrity sha512-uZ+M8/MqRcpf+FII/UZrU7g1qYZ4aVlHcgyVopnladyoBrpoaMJ4PKZDrdOJ05H5RHbr7s9Tid635X3E+ZLU/Q== -cypress@^9.4.1: - version "9.5.3" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.5.3.tgz#7c56b50fc1f1aa69ef10b271d895aeb4a1d7999e" - integrity sha512-ItelIVmqMTnKYbo1JrErhsGgQGjWOxCpHT1TfMvwnIXKXN/OSlPjEK7rbCLYDZhejQL99PmUqul7XORI24Ik0A== +cypress@^12.17.2: + version "12.17.2" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.2.tgz#040ac55de1e811f6e037d231a2869d5ab8c29c85" + integrity sha512-hxWAaWbqQBzzMuadSGSuQg5PDvIGOovm6xm0hIfpCVcORsCAj/gF2p0EvfnJ4f+jK2PCiDgP6D2eeE9/FK4Mjg== dependencies: - "@cypress/request" "^2.88.10" + "@cypress/request" "^2.88.11" "@cypress/xvfb" "^1.2.4" "@types/node" "^14.14.31" "@types/sinonjs__fake-timers" "8.1.1" @@ -529,12 +520,12 @@ cypress@^9.4.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.3" + eventemitter2 "6.4.7" execa "4.1.0" executable "^4.1.1" extract-zip "2.0.1" @@ -547,12 +538,12 @@ cypress@^9.4.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" @@ -584,7 +575,7 @@ debug@^3.1.0, debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.1.1, debug@^4.3.2: +debug@^4.1.1, debug@^4.3.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== @@ -845,10 +836,10 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -eventemitter2@^6.4.3: - version "6.4.5" - resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.5.tgz#97380f758ae24ac15df8353e0cc27f8b95644655" - integrity sha512-bXE7Dyc1i6oQElDG0jMRZJrRAn9QR2xyyFGmBdZleNmyQX0FqGYmhZIrIrpPfm/w//LTo4tVQGOGQcGCb5q9uw== +eventemitter2@6.4.7: + version "6.4.7" + resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.7.tgz#a7f6c4d7abf28a14c1ef3442f21cb306a054271d" + integrity sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg== execa@4.1.0: version "4.1.0" @@ -998,6 +989,15 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" +fs-extra@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -1007,7 +1007,7 @@ fs-extra@^7.0.1: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.0.1, fs-extra@^9.1.0: +fs-extra@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== @@ -1560,11 +1560,6 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -methods@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - mime-db@1.52.0: version "1.52.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" @@ -1594,6 +1589,11 @@ minimist@^1.2.0, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== +minimist@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + mkdirp@^0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" @@ -1874,10 +1874,12 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== +qs@~6.10.3: + version "6.10.5" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.5.tgz#974715920a80ff6a262264acd2c7e6c2a53282b4" + integrity sha512-O5RlPh0VFtR78y79rgcgKK4wbAI0C5zGVLztOIdpWX6ep368q5Hv6XRxDvXuZ9q3C6v+e3n8UfZZJw7IIG27eQ== + dependencies: + side-channel "^1.0.4" regexpp@^3.2.0: version "3.2.0" @@ -1954,7 +1956,7 @@ semver@^5.5.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -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==