diff --git a/cypress-common/package.json b/cypress-common/package.json index f6fe50b03..525edf872 100644 --- a/cypress-common/package.json +++ b/cypress-common/package.json @@ -5,6 +5,6 @@ "license": "MIT", "devDependencies": { "chai-colors": "1.0.1", - "cypress": "9.7.0" + "cypress": "12.17.1" } } diff --git a/cypress-common/yarn.lock b/cypress-common/yarn.lock index e31a3dd85..7863fe63b 100644 --- a/cypress-common/yarn.lock +++ b/cypress-common/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" @@ -193,6 +193,14 @@ cachedir@^2.3.0: resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8" integrity sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw== +call-bind@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -281,10 +289,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" @@ -310,12 +318,12 @@ cross-spawn@^7.0.0: shebang-command "^2.0.0" which "^2.0.1" -cypress@9.7.0: - version "9.7.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.7.0.tgz#bf55b2afd481f7a113ef5604aa8b693564b5e744" - integrity sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q== +cypress@12.17.1: + version "12.17.1" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.1.tgz#777fdcceec4ecd642fc90795f5994853b6ea03f8" + integrity sha512-eKfBgO6t8waEyhegL4gxD7tcI6uTCGttu+ZU7y9Hq8BlpMztd7iLeIF4AJFAnbZH1xjX+wwgg4cRKFNSvv3VWQ== 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" @@ -329,12 +337,12 @@ cypress@9.7.0: 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" @@ -347,12 +355,12 @@ cypress@9.7.0: 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" @@ -377,13 +385,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.3" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== 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" @@ -421,10 +436,10 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -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" @@ -517,6 +532,21 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +get-intrinsic@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-proto "^1.0.1" + has-symbols "^1.0.3" + get-stream@^5.0.0, get-stream@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" @@ -567,6 +597,23 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + http-signature@~1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.3.6.tgz#cb6fbfdf86d1c974f343be94e87f7fc128662cf9" @@ -776,10 +823,10 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== +minimist@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== ms@2.1.2, ms@^2.1.1: version "2.1.2" @@ -793,6 +840,11 @@ npm-run-path@^4.0.0: dependencies: path-key "^3.0.0" +object-inspect@^1.9.0: + version "1.12.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== + once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -877,10 +929,12 @@ 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" request-progress@^3.0.0: version "3.0.0" @@ -926,10 +980,10 @@ safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver@^7.3.2: - version "7.5.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" - integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== +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== dependencies: lru-cache "^6.0.0" @@ -945,6 +999,15 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + signal-exit@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" diff --git a/functional-test/cypress.config.js b/functional-test/cypress.config.js new file mode 100644 index 000000000..12bca756f --- /dev/null +++ b/functional-test/cypress.config.js @@ -0,0 +1,19 @@ +const { defineConfig } = require('cypress') + +module.exports = defineConfig({ + defaultCommandTimeout: 5000, + videoUploadOnPasses: false, + reporter: 'junit', + reporterOptions: { + mochaFile: 'test-results/cypress-[hash].xml', + outputs: 'true', + }, + chromeWebSecurity: false, + 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) + }, + }, +}) diff --git a/functional-test/cypress.json b/functional-test/cypress.json deleted file mode 100644 index c16168d83..000000000 --- a/functional-test/cypress.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "defaultCommandTimeout": 5000, - "videoUploadOnPasses": false, - "reporter": "junit", - "reporterOptions": { - "mochaFile": "test-results/cypress-[hash].xml", - "outputs": "true" - }, - "chromeWebSecurity": false -} diff --git a/functional-test/cypress/integration/admin_failures.spec.js b/functional-test/cypress/e2e/admin_failures.cy.js similarity index 100% rename from functional-test/cypress/integration/admin_failures.spec.js rename to functional-test/cypress/e2e/admin_failures.cy.js diff --git a/functional-test/cypress/integration/attachments.spec.js b/functional-test/cypress/e2e/attachments.cy.js similarity index 100% rename from functional-test/cypress/integration/attachments.spec.js rename to functional-test/cypress/e2e/attachments.cy.js diff --git a/functional-test/cypress/integration/code_quality.spec.js b/functional-test/cypress/e2e/code_quality.cy.js similarity index 100% rename from functional-test/cypress/integration/code_quality.spec.js rename to functional-test/cypress/e2e/code_quality.cy.js diff --git a/functional-test/cypress/integration/coverage.spec.js b/functional-test/cypress/e2e/coverage.cy.js similarity index 100% rename from functional-test/cypress/integration/coverage.spec.js rename to functional-test/cypress/e2e/coverage.cy.js diff --git a/functional-test/cypress/integration/grouped_test_suites.spec.js b/functional-test/cypress/e2e/grouped_test_suites.cy.js similarity index 100% rename from functional-test/cypress/integration/grouped_test_suites.spec.js rename to functional-test/cypress/e2e/grouped_test_suites.cy.js diff --git a/functional-test/cypress/integration/organization_coverage.spec.js b/functional-test/cypress/e2e/organization_coverage.cy.js similarity index 100% rename from functional-test/cypress/integration/organization_coverage.spec.js rename to functional-test/cypress/e2e/organization_coverage.cy.js diff --git a/functional-test/cypress/integration/performance.spec.js b/functional-test/cypress/e2e/performance.cy.js similarity index 100% rename from functional-test/cypress/integration/performance.spec.js rename to functional-test/cypress/e2e/performance.cy.js diff --git a/functional-test/cypress/integration/pin.spec.js b/functional-test/cypress/e2e/pin.cy.js similarity index 100% rename from functional-test/cypress/integration/pin.spec.js rename to functional-test/cypress/e2e/pin.cy.js diff --git a/functional-test/cypress/integration/repository_coverage.spec.js b/functional-test/cypress/e2e/repository_coverage.cy.js similarity index 100% rename from functional-test/cypress/integration/repository_coverage.spec.js rename to functional-test/cypress/e2e/repository_coverage.cy.js diff --git a/functional-test/cypress/integration/repository_flaky_tests.spec.js b/functional-test/cypress/e2e/repository_flaky_tests.cy.js similarity index 100% rename from functional-test/cypress/integration/repository_flaky_tests.spec.js rename to functional-test/cypress/e2e/repository_flaky_tests.cy.js diff --git a/functional-test/cypress/integration/repository_timeline.spec.js b/functional-test/cypress/e2e/repository_timeline.cy.js similarity index 100% rename from functional-test/cypress/integration/repository_timeline.spec.js rename to functional-test/cypress/e2e/repository_timeline.cy.js diff --git a/functional-test/cypress/integration/test_case.spec.js b/functional-test/cypress/e2e/test_case.cy.js similarity index 100% rename from functional-test/cypress/integration/test_case.spec.js rename to functional-test/cypress/e2e/test_case.cy.js diff --git a/functional-test/cypress/integration/test_failure.spec.js b/functional-test/cypress/e2e/test_failure.cy.js similarity index 100% rename from functional-test/cypress/integration/test_failure.spec.js rename to functional-test/cypress/e2e/test_failure.cy.js diff --git a/functional-test/cypress/integration/test_failure_cypress_attachments.spec.js b/functional-test/cypress/e2e/test_failure_cypress_attachments.cy.js similarity index 100% rename from functional-test/cypress/integration/test_failure_cypress_attachments.spec.js rename to functional-test/cypress/e2e/test_failure_cypress_attachments.cy.js diff --git a/functional-test/cypress/integration/test_run_summary.spec.js b/functional-test/cypress/e2e/test_run_summary.cy.js similarity index 100% rename from functional-test/cypress/integration/test_run_summary.spec.js rename to functional-test/cypress/e2e/test_run_summary.cy.js diff --git a/functional-test/cypress/integration/test_run_url.spec.js b/functional-test/cypress/e2e/test_run_url.cy.js similarity index 100% rename from functional-test/cypress/integration/test_run_url.spec.js rename to functional-test/cypress/e2e/test_run_url.cy.js diff --git a/functional-test/cypress/integration/test_suites_in_package.spec.js b/functional-test/cypress/e2e/test_suites_in_package.cy.js similarity index 100% rename from functional-test/cypress/integration/test_suites_in_package.spec.js rename to functional-test/cypress/e2e/test_suites_in_package.cy.js diff --git a/functional-test/cypress/support/index.js b/functional-test/cypress/support/e2e.js similarity index 100% rename from functional-test/cypress/support/index.js rename to functional-test/cypress/support/e2e.js diff --git a/functional-test/package.json b/functional-test/package.json index 19a5140b8..744b597b7 100644 --- a/functional-test/package.json +++ b/functional-test/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@testing-library/cypress": "8.0.7", "chai-colors": "1.0.1", - "cypress": "9.7.0", + "cypress": "12.17.1", "lodash": "4.17.21", "prettier": "2.8.8", "rimraf": "4.4.1" diff --git a/functional-test/yarn.lock b/functional-test/yarn.lock index 5f87831e7..7e95a5d37 100644 --- a/functional-test/yarn.lock +++ b/functional-test/yarn.lock @@ -37,10 +37,10 @@ dependencies: regenerator-runtime "^0.13.4" -"@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" @@ -55,7 +55,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" @@ -321,6 +321,14 @@ cachedir@^2.3.0: resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8" integrity sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw== +call-bind@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -430,10 +438,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" @@ -459,12 +467,12 @@ cross-spawn@^7.0.0: shebang-command "^2.0.0" which "^2.0.1" -cypress@9.7.0: - version "9.7.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.7.0.tgz#bf55b2afd481f7a113ef5604aa8b693564b5e744" - integrity sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q== +cypress@12.17.1: + version "12.17.1" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.1.tgz#777fdcceec4ecd642fc90795f5994853b6ea03f8" + integrity sha512-eKfBgO6t8waEyhegL4gxD7tcI6uTCGttu+ZU7y9Hq8BlpMztd7iLeIF4AJFAnbZH1xjX+wwgg4cRKFNSvv3VWQ== 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" @@ -478,12 +486,12 @@ cypress@9.7.0: 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" @@ -496,12 +504,12 @@ cypress@9.7.0: 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" @@ -526,13 +534,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.3" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== 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" @@ -575,10 +590,10 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -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" @@ -671,6 +686,21 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +get-intrinsic@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-proto "^1.0.1" + has-symbols "^1.0.3" + get-stream@^5.0.0, get-stream@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" @@ -736,6 +766,23 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + http-signature@~1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.3.6.tgz#cb6fbfdf86d1c974f343be94e87f7fc128662cf9" @@ -961,10 +1008,10 @@ minimatch@^8.0.2: dependencies: brace-expansion "^2.0.1" -minimist@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== +minimist@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== minipass@^4.2.4: version "4.2.8" @@ -988,6 +1035,11 @@ npm-run-path@^4.0.0: dependencies: path-key "^3.0.0" +object-inspect@^1.9.0: + version "1.12.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== + once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -1095,10 +1147,12 @@ 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" react-is@^17.0.1: version "17.0.2" @@ -1161,10 +1215,10 @@ safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver@^7.3.2: - version "7.5.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" - integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== +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== dependencies: lru-cache "^6.0.0" @@ -1180,6 +1234,15 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + signal-exit@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" diff --git a/ui/cypress.config.ts b/ui/cypress.config.ts new file mode 100644 index 000000000..f26e1c7b4 --- /dev/null +++ b/ui/cypress.config.ts @@ -0,0 +1,28 @@ +import { defineConfig } from 'cypress' +const fs = require('fs') + +export default defineConfig({ + reporter: 'junit', + reporterOptions: { + mochaFile: 'test-results/cypress-[hash].xml', + }, + videoUploadOnPasses: false, + defaultCommandTimeout: 10000, + e2e: { + setupNodeEvents(on, config) { + // from https://docs.cypress.io/guides/guides/screenshots-and-videos#Delete-videos-for-specs-without-failing-or-retried-tests + on('after:spec', (spec, results) => { + if (results && results.video) { + // Do we have failures for any retry attempts? + const failures = results.tests.some((test) => + test.attempts.some((attempt) => attempt.state === 'failed') + ) + if (!failures) { + // delete the video if the spec passed and no tests retried + fs.unlinkSync(results.video) + } + } + }) + }, + }, +}) diff --git a/ui/cypress.json b/ui/cypress.json deleted file mode 100644 index 7f5c192a3..000000000 --- a/ui/cypress.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "reporter": "junit", - "reporterOptions": { - "mochaFile": "test-results/cypress-[hash].xml" - }, - "videoUploadOnPasses": false, - "defaultCommandTimeout": 10000 -} \ No newline at end of file diff --git a/ui/cypress/integration/admin_failures.spec.js b/ui/cypress/e2e/admin_failures.cy.js similarity index 86% rename from ui/cypress/integration/admin_failures.spec.js rename to ui/cypress/e2e/admin_failures.cy.js index 9149b7a0f..97d12890a 100644 --- a/ui/cypress/integration/admin_failures.spec.js +++ b/ui/cypress/e2e/admin_failures.cy.js @@ -2,13 +2,9 @@ context("admin failures", () => { it("should display recent failures", () => { - cy.server(); - - cy.route( - "GET", - `failures/recent?count=10`, - "fixture:admin/recent_failures_2.json" - ); + cy.intercept("GET", `failures/recent?count=10`, { + fixture: "admin/recent_failures_2.json", + }); cy.visit(`http://localhost:1234/admin`); @@ -54,19 +50,13 @@ context("admin failures", () => { }); it("should support changing the number of failures that are loaded", () => { - cy.server(); + cy.intercept("GET", `failures/recent?count=10`, { + fixture: "admin/recent_failures_2.json", + }); - cy.route( - "GET", - `failures/recent?count=10`, - "fixture:admin/recent_failures_2.json" - ); - - cy.route( - "GET", - `failures/recent?count=20`, - "fixture:admin/recent_failures_20.json" - ); + cy.intercept("GET", `failures/recent?count=20`, { + fixture: "admin/recent_failures_20.json", + }); cy.visit(`http://localhost:1234/admin`); diff --git a/ui/cypress/integration/attachments.spec.js b/ui/cypress/e2e/attachments.cy.js similarity index 64% rename from ui/cypress/integration/attachments.spec.js rename to ui/cypress/e2e/attachments.cy.js index 769ed9350..257da65ed 100644 --- a/ui/cypress/integration/attachments.spec.js +++ b/ui/cypress/e2e/attachments.cy.js @@ -4,21 +4,17 @@ context("test run with attachments", () => { it("should list attachments on attachments page", () => { const publicId = "12345"; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "attachments/test_run_summary_with_attachments.json", + }); - cy.route( - "GET", - `run/${publicId}/summary`, - "fixture:attachments/test_run_summary_with_attachments.json" - ); - - cy.route("GET", `run/${publicId}`, "fixture:test_run.json"); + cy.intercept("GET", `run/${publicId}`, { + fixture: "test_run.json", + }); - cy.route( - "GET", - `run/${publicId}/attachments`, - "fixture:attachments/attachments.json" - ); + cy.intercept("GET", `run/${publicId}/attachments`, { + fixture: "attachments/attachments.json", + }); cy.visit(`http://localhost:1234/tests/${publicId}`); @@ -51,21 +47,17 @@ context("test run with attachments", () => { it("should not show attachments nav link when run has no attachments", () => { const publicId = "12345"; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "attachments/test_run_summary_with_attachments.json", + }); - cy.route( - "GET", - `run/${publicId}/summary`, - "fixture:attachments/test_run_summary_with_attachments.json" - ); - - cy.route("GET", `run/${publicId}`, "fixture:test_run.json"); + cy.intercept("GET", `run/${publicId}`, { + fixture: "test_run.json", + }); - cy.route( - "GET", - `run/${publicId}/attachments`, - "fixture:attachments/attachments_empty.json" - ); + cy.intercept("GET", `run/${publicId}/attachments`, { + fixture: "attachments/attachments_empty.json", + }); cy.visit(`http://localhost:1234/tests/${publicId}`); diff --git a/ui/cypress/integration/code_quality.spec.js b/ui/cypress/e2e/code_quality.cy.js similarity index 100% rename from ui/cypress/integration/code_quality.spec.js rename to ui/cypress/e2e/code_quality.cy.js diff --git a/ui/cypress/integration/coverage.spec.js b/ui/cypress/e2e/coverage.cy.js similarity index 80% rename from ui/cypress/integration/coverage.spec.js rename to ui/cypress/e2e/coverage.cy.js index b6eba9a15..a031099f8 100644 --- a/ui/cypress/integration/coverage.spec.js +++ b/ui/cypress/e2e/coverage.cy.js @@ -4,8 +4,6 @@ context("test run with coverage data", () => { it("should show overall coverage stats on home page", () => { const publicId = "192301"; - cy.server(); - cy.intercept("GET", `run/${publicId}/summary`, { fixture: "test_run_summary.json", }); @@ -41,21 +39,17 @@ context("test run with coverage data", () => { it("should show overall coverage stats on home page with previous run", () => { const publicId = "13438"; - cy.server(); - - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route( - "GET", - `run/${publicId}/cases/failed`, - "fixture:failed_test_cases.json" - ); + cy.intercept("GET", `run/${publicId}/cases/failed`, { + fixture: "failed_test_cases.json", + }); - cy.route( - "GET", - `run/${publicId}/coverage`, - "fixture:coverage/coverage-three-groups-previous-run.json" - ); + cy.intercept("GET", `run/${publicId}/coverage`, { + fixture: "coverage/coverage-three-groups-previous-run.json", + }); cy.visit(`http://localhost:1234/tests/${publicId}`); @@ -78,27 +72,21 @@ context("test run with coverage data", () => { it("should show coverage stats on coverage page", () => { const publicId = "12345"; - cy.server(); - - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route( - "GET", - `run/${publicId}/cases/failed`, - "fixture:failed_test_cases.json" - ); + cy.intercept("GET", `run/${publicId}/cases/failed`, { + fixture: "failed_test_cases.json", + }); - cy.route( - "GET", - `run/${publicId}/coverage/exists`, - "fixture:coverage/coverage-exists.json" - ); + cy.intercept("GET", `run/${publicId}/coverage/exists`, { + fixture: "coverage/coverage-exists.json", + }); - cy.route( - "GET", - `run/${publicId}/coverage`, - "fixture:coverage/coverage-three-groups.json" - ); + cy.intercept("GET", `run/${publicId}/coverage`, { + fixture: "coverage/coverage-three-groups.json", + }); cy.visit(`http://localhost:1234/tests/${publicId}`); @@ -121,8 +109,6 @@ context("test run with coverage data", () => { it("should not show coverage section when no coverage data available", () => { const publicId = "10832"; - cy.server(); - cy.intercept("GET", `run/${publicId}/summary`, { fixture: "test_run_summary.json", }); diff --git a/ui/cypress/integration/coverage_files.spec.js b/ui/cypress/e2e/coverage_files.cy.js similarity index 70% rename from ui/cypress/integration/coverage_files.spec.js rename to ui/cypress/e2e/coverage_files.cy.js index 7a98a86fc..0b775e178 100644 --- a/ui/cypress/integration/coverage_files.spec.js +++ b/ui/cypress/e2e/coverage_files.cy.js @@ -4,33 +4,25 @@ describe("file-level coverage", () => { it("should show file-level coverage on page", () => { const publicId = "18932"; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); + cy.intercept("GET", `run/${publicId}/cases/failed`, { + fixture: "failed_test_cases.json", + }); - cy.route( - "GET", - `run/${publicId}/cases/failed`, - "fixture:failed_test_cases.json" - ); - - cy.route( - "GET", - `run/${publicId}/coverage`, - "fixture:coverage/coverage-three-groups.json" - ); + cy.intercept("GET", `run/${publicId}/coverage`, { + fixture: "coverage/coverage-three-groups.json", + }); - cy.route( - "GET", - `run/${publicId}/coverage/exists`, - "fixture:coverage/coverage-exists.json" - ); + cy.intercept("GET", `run/${publicId}/coverage/exists`, { + fixture: "coverage/coverage-exists.json", + }); - cy.route( - "GET", - `run/${publicId}/coverage/server-app/files`, - "fixture:coverage/coverage-files-server-app.json" - ); + cy.intercept("GET", `run/${publicId}/coverage/server-app/files`, { + fixture: "coverage/coverage-files-server-app.json", + }); cy.visit(`http://localhost:1234/tests/${publicId}`); @@ -65,39 +57,29 @@ describe("file-level coverage", () => { it("should show links to files in GitHub when GitHub base URL and coverage file paths set", () => { const publicId = "21i31"; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); + cy.intercept("GET", `run/${publicId}/cases/failed`, { + fixture: "failed_test_cases.json", + }); - cy.route( - "GET", - `run/${publicId}/cases/failed`, - "fixture:failed_test_cases.json" - ); + cy.intercept("GET", `run/${publicId}/metadata/git`, { + fixture: "metadata/git-metadata-with-github-base-url.json", + }); - cy.route( - "GET", - `run/${publicId}/metadata/git`, - "fixture:metadata/git-metadata-with-github-base-url.json" - ); + cy.intercept("GET", `run/${publicId}/coverage`, { + fixture: "coverage/coverage-three-groups.json", + }); - cy.route( - "GET", - `run/${publicId}/coverage`, - "fixture:coverage/coverage-three-groups.json" - ); + cy.intercept("GET", `run/${publicId}/coverage/exists`, { + fixture: "coverage/coverage-exists.json", + }); - cy.route( - "GET", - `run/${publicId}/coverage/exists`, - "fixture:coverage/coverage-exists.json" - ); - - cy.route( - "GET", - `run/${publicId}/coverage/server-app/files`, - "fixture:coverage/coverage-files-with-file-path.json" - ); + cy.intercept("GET", `run/${publicId}/coverage/server-app/files`, { + fixture: "coverage/coverage-files-with-file-path.json", + }); cy.visit(`http://localhost:1234/tests/${publicId}`); diff --git a/ui/cypress/integration/dashboard.spec.js b/ui/cypress/e2e/dashboard.cy.js similarity index 97% rename from ui/cypress/integration/dashboard.spec.js rename to ui/cypress/e2e/dashboard.cy.js index f3ae79362..62c3844eb 100644 --- a/ui/cypress/integration/dashboard.spec.js +++ b/ui/cypress/e2e/dashboard.cy.js @@ -4,8 +4,6 @@ context("dashboard", () => { it("should show test run summary data on dashboard page", () => { const publicId = "3818"; - cy.server(); - cy.intercept("GET", `run/${publicId}/summary`, { fixture: "test_run_summary.json", }); @@ -32,8 +30,6 @@ context("dashboard", () => { it("should show failed test case summaries on dashboard page", () => { const publicId = "1382"; - cy.server(); - cy.intercept("GET", `run/${publicId}/summary`, { fixture: "test_run_summary.json", }); @@ -64,8 +60,6 @@ context("dashboard", () => { it("when tests all passed should show test suite list on dashboard", () => { const publicId = "13821"; - cy.server(); - cy.intercept("GET", `run/${publicId}/summary`, { fixture: "one_passing/test_run_summary.json", }); @@ -88,8 +82,6 @@ context("dashboard", () => { it("when fetching test run fails should render error message", () => { const publicId = "18932"; - cy.server(); - cy.intercept("GET", `run/${publicId}/summary`, { fixture: "one_passing/test_run_summary.json", }); diff --git a/ui/cypress/integration/dashboard_git.spec.js b/ui/cypress/e2e/dashboard_git.cy.js similarity index 99% rename from ui/cypress/integration/dashboard_git.spec.js rename to ui/cypress/e2e/dashboard_git.cy.js index 969cb674d..10e4bb524 100644 --- a/ui/cypress/integration/dashboard_git.spec.js +++ b/ui/cypress/e2e/dashboard_git.cy.js @@ -2,8 +2,6 @@ context("dashboard git metadata", () => { it("should show Git pull request number and commit SHA on dashboard", () => { const publicId = "1234567"; - cy.server(); - cy.intercept("GET", `run/${publicId}/metadata/git`, { fixture: "metadata/git-metadata-with-pr-and-commit.json", }); diff --git a/ui/cypress/integration/failed_tests.spec.js b/ui/cypress/e2e/failed_tests.cy.js similarity index 99% rename from ui/cypress/integration/failed_tests.spec.js rename to ui/cypress/e2e/failed_tests.cy.js index c6d590221..880908486 100644 --- a/ui/cypress/integration/failed_tests.spec.js +++ b/ui/cypress/e2e/failed_tests.cy.js @@ -4,8 +4,6 @@ describe("test run with failed test cases", () => { it("should show failed test case summaries on failed tests page", () => { const publicId = "123io1"; - cy.server(); - cy.intercept("GET", `run/${publicId}/summary`, { fixture: "test_run_summary.json", }); @@ -54,8 +52,6 @@ describe("test run with failed test cases", () => { const testSuiteIdx = 1; const testCaseIdx = 2; - cy.server(); - cy.intercept("GET", `run/${publicId}/summary`, { fixture: "test_run_summary.json", }); diff --git a/ui/cypress/e2e/messages.cy.js b/ui/cypress/e2e/messages.cy.js new file mode 100644 index 000000000..e30704f68 --- /dev/null +++ b/ui/cypress/e2e/messages.cy.js @@ -0,0 +1,48 @@ +/// + +context("test run messages", () => { + it("when one message should show it on dashboard page", () => { + const publicId = "12345"; + + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "one_passing/test_run_summary.json", + }); + + cy.intercept("GET", `run/${publicId}`, { + fixture: "one_passing/test_run.json", + }); + + cy.intercept("GET", `run/${publicId}/messages`, { + fixture: "messages/one_message.json", + }); + + cy.visit(`http://localhost:1234/tests/${publicId}`); + + cy.getByTestId("test-run-message-1").should( + "contain", + "Here is one message" + ); + }); + + it("when no messages should not display any dashboard page", () => { + const publicId = "12345"; + + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "one_passing/test_run_summary.json", + }); + + cy.intercept("GET", `run/${publicId}`, { + fixture: "one_passing/test_run.json", + }); + + cy.intercept("GET", `run/${publicId}/messages`, { + fixture: "messages/no_messages.json", + }); + + cy.visit(`http://localhost:1234/tests/${publicId}`); + + cy.testIdShouldExist("test-run-messages"); + + cy.testIdShouldNotExist("test-run-message-1"); + }); +}); diff --git a/ui/cypress/integration/nav.spec.js b/ui/cypress/e2e/nav.cy.js similarity index 66% rename from ui/cypress/integration/nav.spec.js rename to ui/cypress/e2e/nav.cy.js index e752ca7a0..e0a634a62 100644 --- a/ui/cypress/integration/nav.spec.js +++ b/ui/cypress/e2e/nav.cy.js @@ -4,17 +4,17 @@ context("side nav", () => { it("should link to failed test cases", () => { const publicId = "12345"; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); + cy.intercept("GET", `run/${publicId}`, { fixture: "test_run.json" }); - cy.route("GET", `run/${publicId}`, "fixture:test_run.json"); + cy.intercept("GET", `run/${publicId}/cases/failed`, { + fixture: "failed_test_cases.json", + }); - cy.route( - "GET", - `run/${publicId}/cases/failed`, - "fixture:failed_test_cases.json" - ); + cy.interceptTestRunBasicRequests(publicId); cy.visit(`http://localhost:1234/tests/${publicId}`); diff --git a/ui/cypress/integration/organization_coverage.spec.js b/ui/cypress/e2e/organization_coverage.cy.js similarity index 59% rename from ui/cypress/integration/organization_coverage.spec.js rename to ui/cypress/e2e/organization_coverage.cy.js index 0a219d911..7e5d55028 100644 --- a/ui/cypress/integration/organization_coverage.spec.js +++ b/ui/cypress/e2e/organization_coverage.cy.js @@ -5,19 +5,13 @@ context("organization coverage", () => { const orgName = "cov-org"; const repoName = "cov-org/cov-repo"; - cy.server(); + cy.intercept("GET", `org/${orgName}/coverage`, { + fixture: "organization/organization_coverage.json", + }); - cy.route( - "GET", - `org/${orgName}/coverage`, - "fixture:organization/organization_coverage.json" - ); - - cy.route( - "GET", - `repo/${repoName}/coverage/timeline`, - "fixture:repository/coverage_timeline.json" - ); + cy.intercept("GET", `repo/${repoName}/coverage/timeline`, { + fixture: "repository/coverage_timeline.json", + }); cy.visit(`http://localhost:1234/organization/${orgName}`); @@ -34,15 +28,10 @@ context("organization coverage", () => { it("should display coverage for each repo and link to latest test run page", () => { const orgName = "cov-org"; - const repoName = "cov-org/cov-repo"; - - cy.server(); - cy.route( - "GET", - `org/${orgName}/coverage`, - "fixture:organization/organization_coverage.json" - ); + cy.intercept("GET", `org/${orgName}/coverage`, { + fixture: "organization/organization_coverage.json", + }); cy.visit(`http://localhost:1234/organization/${orgName}`); @@ -50,15 +39,17 @@ context("organization coverage", () => { const publicId = "AF5EZOPSKX2K"; - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); + cy.intercept("GET", `run/${publicId}`, { + fixture: "test_run.json", + }); - cy.route("GET", `run/${publicId}`, "fixture:test_run.json"); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route( - "GET", - `run/${publicId}/cases/failed`, - "fixture:failed_test_cases.json" - ); + cy.intercept("GET", `run/${publicId}/cases/failed`, { + fixture: "failed_test_cases_6.json", + }); cy.getByTestId("line-coverage-row-1-covered-percentage-link").click(); diff --git a/ui/cypress/e2e/pin.cy.js b/ui/cypress/e2e/pin.cy.js new file mode 100644 index 000000000..b2190e426 --- /dev/null +++ b/ui/cypress/e2e/pin.cy.js @@ -0,0 +1,107 @@ +/// + +context("tests with pins", () => { + it("when cleanup enabled should allow pinning of report from side menu", () => { + const publicId = "12345"; + + cy.intercept("GET", `run/${publicId}/attachments`, { + fixture: "attachments/attachments_empty.json", + }); + + cy.intercept("GET", `run/${publicId}`, { + fixture: "one_passing/test_run.json", + }); + + cy.intercept("GET", `/run/${publicId}/summary`, { + fixture: "one_passing/test_run_summary.json", + }); + + cy.intercept("GET", `/config`, { + fixture: "config/cleanup_config_enabled.json", + }); + + cy.intercept("GET", `/run/${publicId}/attributes`, { + statusCode: 404, + body: "", + }); + + cy.intercept("POST", `/run/${publicId}/attributes/pin`, { + fixture: "attributes/pinned.json", + }).as("pin"); + + cy.intercept("POST", `/run/${publicId}/attributes/unpin`, { + fixture: "attributes/not_pinned.json", + }).as("unpin"); + + cy.visit(`http://localhost:1234/tests/${publicId}`); + + cy.getByTestId("nav-link-pin").click(); + + cy.getByTestId("nav-link-unpin").click(); + }); + + it("when cleanup enabled should allow pinning of report from dashboard", () => { + const publicId = "12345"; + + cy.intercept("GET", `run/${publicId}/attachments`, { + fixture: "attachments/attachments_empty.json", + }); + + cy.intercept("GET", `run/${publicId}`, { + fixture: "one_passing/test_run.json", + }); + + cy.intercept("GET", `/run/${publicId}/summary`, { + fixture: "one_passing/test_run_summary.json", + }); + + cy.intercept("GET", `/config`, { + fixture: "config/cleanup_config_enabled.json", + }); + + cy.intercept("GET", `/run/${publicId}/attributes`, { + statusCode: 404, + body: "", + }); + + cy.intercept("POST", `/run/${publicId}/attributes/pin`, { + fixture: "attributes/pinned.json", + }).as("pin"); + + cy.intercept("POST", `/run/${publicId}/attributes/unpin`, { + fixture: "attributes/not_pinned.json", + }).as("unpin"); + + cy.visit(`http://localhost:1234/tests/${publicId}`); + + cy.getByTestId("test-run-header-pin-link").click(); + + cy.getByTestId("test-run-header-unpin-link").click(); + }); + + it("when cleanup disabled should not show pin link in side menu or in dashboard", () => { + const publicId = "12345"; + + cy.intercept("GET", `run/${publicId}/attachments`, { + fixture: "attachments/attachments_empty.json", + }); + + cy.intercept("GET", `run/${publicId}`, { + fixture: "one_passing/test_run.json", + }); + + cy.intercept("GET", `/run/${publicId}/summary`, { + fixture: "one_passing/test_run_summary.json", + }); + + cy.intercept("GET", `/config`, { + fixture: "config/cleanup_config_disabled.json", + }); + + cy.visit(`http://localhost:1234/tests/${publicId}`); + + cy.testIdShouldNotExist("nav-link-pin"); + + cy.testIdShouldNotExist("test-run-header-pin-link"); + }); +}); diff --git a/ui/cypress/integration/repository_coverage.spec.js b/ui/cypress/e2e/repository_coverage.cy.js similarity index 100% rename from ui/cypress/integration/repository_coverage.spec.js rename to ui/cypress/e2e/repository_coverage.cy.js diff --git a/ui/cypress/integration/repository_flaky_tests.spec.js b/ui/cypress/e2e/repository_flaky_tests.cy.js similarity index 89% rename from ui/cypress/integration/repository_flaky_tests.spec.js rename to ui/cypress/e2e/repository_flaky_tests.cy.js index 89dfd4b1b..b814c80a8 100644 --- a/ui/cypress/integration/repository_flaky_tests.spec.js +++ b/ui/cypress/e2e/repository_flaky_tests.cy.js @@ -4,12 +4,10 @@ context("repository flaky tests", () => { it("should display flaky tests on repository flaky test page", () => { const repoName = "flaky-org/flaky-repo"; - cy.server(); - - cy.route( + cy.intercept( "GET", `repo/${repoName}/tests/flaky?threshold=5&max_runs=50&branch_type=MAINLINE`, - "fixture:repository/flaky_tests.json" + { fixture: "repository/flaky_tests.json" } ); cy.visit(`http://localhost:1234/repository/${repoName}`); @@ -66,24 +64,24 @@ context("repository flaky tests", () => { it("should link from test case name to specific test run", () => { const repoName = "flaky-org/flaky-repo"; - cy.server(); - - cy.route( + cy.intercept( "GET", `repo/${repoName}/tests/flaky?threshold=5&max_runs=50&branch_type=MAINLINE`, - "fixture:repository/flaky_tests.json" + { fixture: "repository/flaky_tests.json" } ); const publicId = "32FBHG6FDL8S"; const testSuiteIdx = 1; const testCaseIdx = 1; - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); - cy.route("GET", `run/${publicId}`, "fixture:test_run.json"); - cy.route( + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); + cy.intercept("GET", `run/${publicId}`, { fixture: "test_run.json" }); + cy.intercept( "GET", `run/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}`, - "fixture:failed_test_case_2.json" + { fixture: "failed_test_case_2.json" } ); cy.visit(`http://localhost:1234/repository/${repoName}`); @@ -103,12 +101,10 @@ context("repository flaky tests", () => { it("should support changing max runs, flaky threshold and branch type", () => { const repoName = "flaky-org/flaky-repo"; - cy.server(); - - cy.route( + cy.intercept( "GET", `repo/${repoName}/tests/flaky?threshold=5&max_runs=50&branch_type=MAINLINE`, - "fixture:repository/flaky_tests.json" + { fixture: "repository/flaky_tests.json" } ); cy.visit(`http://localhost:1234/repository/${repoName}`); @@ -127,10 +123,10 @@ context("repository flaky tests", () => { "projektor.example.spock.FailingSpec.should fail with output" ); - cy.route( + cy.intercept( "GET", `repo/${repoName}/tests/flaky?threshold=2&max_runs=20&branch_type=ALL`, - "fixture:repository/flaky_tests_two_tests.json" + { fixture: "repository/flaky_tests_two_tests.json" } ); cy.findByTestId("flaky-tests-threshold").type("{selectall}{backspace}2", { @@ -161,12 +157,10 @@ context("repository flaky tests", () => { it("should support going directly to flaky test page with params set", () => { const repoName = "flaky-org/flaky-repo"; - cy.server(); - - cy.route( + cy.intercept( "GET", `repo/${repoName}/tests/flaky?threshold=4&max_runs=30&branch_type=ALL`, - "fixture:repository/flaky_tests_two_tests.json" + { fixture: "repository/flaky_tests_two_tests.json" } ); cy.visit( diff --git a/ui/cypress/integration/repository_home.spec.js b/ui/cypress/e2e/repository_home.cy.js similarity index 61% rename from ui/cypress/integration/repository_home.spec.js rename to ui/cypress/e2e/repository_home.cy.js index 582118f7e..5a6edb254 100644 --- a/ui/cypress/integration/repository_home.spec.js +++ b/ui/cypress/e2e/repository_home.cy.js @@ -4,19 +4,13 @@ context("repository home page", () => { it("should display repository timeline and coverage graphs on home page", () => { const repoName = "timeline-org/timeline-repo"; - cy.server(); + cy.intercept("GET", `repo/${repoName}/timeline`, { + fixture: "repository/timeline.json", + }); - cy.route( - "GET", - `repo/${repoName}/timeline`, - "fixture:repository/timeline.json" - ); - - cy.route( - "GET", - `repo/${repoName}/coverage/timeline`, - "fixture:repository/coverage_timeline.json" - ); + cy.intercept("GET", `repo/${repoName}/coverage/timeline`, { + fixture: "repository/coverage_timeline.json", + }); cy.visit(`http://localhost:1234/repository/${repoName}`); diff --git a/ui/cypress/integration/repository_performance.spec.js b/ui/cypress/e2e/repository_performance.cy.js similarity index 84% rename from ui/cypress/integration/repository_performance.spec.js rename to ui/cypress/e2e/repository_performance.cy.js index b746822ad..99f84fcb0 100644 --- a/ui/cypress/integration/repository_performance.spec.js +++ b/ui/cypress/e2e/repository_performance.cy.js @@ -4,13 +4,9 @@ describe("repository performance", () => { it("should display performance timeline on home page", () => { const repoName = "performance-org/performance-repo"; - cy.server(); - - cy.route( - "GET", - `repo/${repoName}/performance/timeline`, - "fixture:repository/performance_timeline.json" - ); + cy.intercept("GET", `repo/${repoName}/performance/timeline`, { + fixture: "repository/performance_timeline.json", + }); const publicIds = ["EYL6XMND5HOO", "QWPCWITIDJ8L", "BRDYYHG9DQAU"]; @@ -37,13 +33,9 @@ describe("repository performance", () => { it("should display performance timeline on performance page", () => { const repoName = "performance-org/performance-repo"; - cy.server(); - - cy.route( - "GET", - `repo/${repoName}/performance/timeline`, - "fixture:repository/performance_timeline.json" - ); + cy.intercept("GET", `repo/${repoName}/performance/timeline`, { + fixture: "repository/performance_timeline.json", + }); const publicIds = ["EYL6XMND5HOO", "QWPCWITIDJ8L", "BRDYYHG9DQAU"]; @@ -68,13 +60,9 @@ describe("repository performance", () => { it("should display tooltip with timeline data on graph point hover", () => { const repoName = "performance-org/performance-repo"; - cy.server(); - - cy.route( - "GET", - `repo/${repoName}/performance/timeline`, - "fixture:repository/performance_timeline.json" - ); + cy.intercept("GET", `repo/${repoName}/performance/timeline`, { + fixture: "repository/performance_timeline.json", + }); const publicId = "QWPCWITIDJ8L"; diff --git a/ui/cypress/integration/repository_timeline.spec.js b/ui/cypress/e2e/repository_timeline.cy.js similarity index 86% rename from ui/cypress/integration/repository_timeline.spec.js rename to ui/cypress/e2e/repository_timeline.cy.js index fe129a52c..c59c15dbe 100644 --- a/ui/cypress/integration/repository_timeline.spec.js +++ b/ui/cypress/e2e/repository_timeline.cy.js @@ -4,13 +4,9 @@ context("repository timeline", () => { it("should display repository timeline graph and link to individual test reports", () => { const repoName = "timeline-org/timeline-repo"; - cy.server(); - - cy.route( - "GET", - `repo/${repoName}/timeline`, - "fixture:repository/timeline.json" - ); + cy.intercept("GET", `repo/${repoName}/timeline`, { + fixture: "repository/timeline.json", + }); const publicIds = [ "JHLQTLR7XGQH", @@ -36,13 +32,9 @@ context("repository timeline", () => { it("should display tooltip with timeline data on graph point hover", () => { const repoName = "timeline-org/timeline-repo"; - cy.server(); - - cy.route( - "GET", - `repo/${repoName}/timeline`, - "fixture:repository/timeline.json" - ); + cy.intercept("GET", `repo/${repoName}/timeline`, { + fixture: "repository/timeline.json", + }); const publicId = "GGHZI4NSIMSF"; diff --git a/ui/cypress/e2e/results_processing.cy.js b/ui/cypress/e2e/results_processing.cy.js new file mode 100644 index 000000000..b68d3c230 --- /dev/null +++ b/ui/cypress/e2e/results_processing.cy.js @@ -0,0 +1,76 @@ +/// + +context("results processing", () => { + it("when test results still processing should display message", () => { + const publicId = "12345"; + + cy.intercept("GET", `run/${publicId}`, { + statusCode: 404, + body: {}, + }); + + cy.intercept("GET", `run/${publicId}/summary`, { + statusCode: 404, + body: {}, + }); + + cy.intercept("GET", `results/${publicId}/status`, { + fixture: "processing_status/processing_status_processing.json", + }); + + cy.visit(`http://localhost:1234/tests/${publicId}`); + + cy.getByTestId("results-still-processing").should( + "contain", + "Your test results are still processing" + ); + + cy.intercept("GET", `results/${publicId}/status`, { + fixture: "processing_status/processing_status_success.json", + }); + + cy.intercept("GET", `run/${publicId}/summary`, { + statusCode: 200, + fixture: "one_passing/test_run_summary.json", + }); + + cy.intercept("GET", `run/${publicId}`, { + fixture: "one_passing/test_run.json", + }); + + cy.interceptTestRunBasicRequests(publicId); + + cy.wait(1000); + + cy.getByTestId("test-run-all-tests-title").should("contain", "All tests"); + }); + + it("should display error message when processing results failed", () => { + const publicId = "12345"; + + cy.intercept("GET", `run/${publicId}`, { + statusCode: 404, + body: {}, + }); + + cy.intercept("GET", `run/${publicId}/summary`, { + statusCode: 404, + body: {}, + }); + + cy.intercept("GET", `results/${publicId}/status`, { + fixture: "processing_status/processing_status_error.json", + }); + + cy.visit(`http://localhost:1234/tests/${publicId}`); + + cy.getByTestId("results-processing-failed").should( + "contain", + "Error processing test results" + ); + cy.getByTestId("results-processing-failed").should( + "contain", + "Failed to parse results" + ); + }); +}); diff --git a/ui/cypress/integration/slow_tests.spec.js b/ui/cypress/e2e/slow_tests.cy.js similarity index 98% rename from ui/cypress/integration/slow_tests.spec.js rename to ui/cypress/e2e/slow_tests.cy.js index 8f38ec74c..626a16c11 100644 --- a/ui/cypress/integration/slow_tests.spec.js +++ b/ui/cypress/e2e/slow_tests.cy.js @@ -4,8 +4,6 @@ context("test run with slow tests", () => { it("should link to slow test cases", () => { const publicId = "12345"; - cy.server(); - cy.interceptTestRunBasicRequests(publicId); cy.intercept("GET", `run/${publicId}/summary`, { diff --git a/ui/cypress/integration/test_case.spec.js b/ui/cypress/e2e/test_case.cy.js similarity index 70% rename from ui/cypress/integration/test_case.spec.js rename to ui/cypress/e2e/test_case.cy.js index 45f3e4ec2..733fbc2a1 100644 --- a/ui/cypress/integration/test_case.spec.js +++ b/ui/cypress/e2e/test_case.cy.js @@ -6,27 +6,25 @@ context("test case", () => { const testSuiteIdx = 1; const testCaseIdx = 2; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); - - cy.route( + cy.intercept( "GET", `run/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}`, - "fixture:failed_test_case_2.json" + { + fixture: "failed_test_case_2.json", + } ); - cy.route( - "GET", - `run/${publicId}/suite/${testSuiteIdx}/systemOut`, - "fixture:test_output_system_out.json" - ); + cy.intercept("GET", `run/${publicId}/suite/${testSuiteIdx}/systemOut`, { + fixture: "test_output_system_out.json", + }); - cy.route( - "GET", - `run/${publicId}/suite/${testSuiteIdx}/systemErr`, - "fixture:test_output_system_err.json" - ); + cy.intercept("GET", `run/${publicId}/suite/${testSuiteIdx}/systemErr`, { + fixture: "test_output_system_err.json", + }); cy.visit( `http://localhost:1234/tests/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}/` @@ -67,25 +65,24 @@ context("test case", () => { const testSuiteIdx = 1; const testCaseIdx = 1; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "one_passing/test_run_summary.json", + }); - cy.route( - "GET", - `run/${publicId}/summary`, - "fixture:one_passing/test_run_summary.json" - ); - cy.route("GET", `run/${publicId}`, "fixture:one_passing/test_run.json"); + cy.intercept("GET", `run/${publicId}`, { + fixture: "one_passing/test_run.json", + }); - cy.route( - "GET", - `run/${publicId}/suite/${testSuiteIdx}`, - "fixture:one_passing/test_suite.json" - ); + cy.intercept("GET", `run/${publicId}/suite/${testSuiteIdx}`, { + fixture: "one_passing/test_suite.json", + }); - cy.route( + cy.intercept( "GET", `run/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}`, - "fixture:one_passing/test_case.json" + { + fixture: "one_passing/test_case.json", + } ); cy.visit(`http://localhost:1234/tests/${publicId}/suite/${testSuiteIdx}`); @@ -108,25 +105,22 @@ context("test case", () => { const testSuiteIdx = 5; const testCaseIdx = 1; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "cypress/test_run_summary.json", + }); - cy.route( - "GET", - `run/${publicId}/summary`, - "fixture:cypress/test_run_summary.json" - ); - cy.route("GET", `run/${publicId}`, "fixture:cypress/test_run.json"); + cy.intercept("GET", `run/${publicId}`, { + fixture: "cypress/test_run.json", + }); - cy.route( - "GET", - `run/${publicId}/suite/${testSuiteIdx}`, - "fixture:cypress/test_suite_side_nav.json" - ); + cy.intercept("GET", `run/${publicId}/suite/${testSuiteIdx}`, { + fixture: "cypress/test_suite_side_nav.json", + }); - cy.route( + cy.intercept( "GET", `run/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}`, - "fixture:cypress/test_case_side_nav.json" + { fixture: "cypress/test_case_side_nav.json" } ); cy.visit( @@ -159,14 +153,14 @@ context("test case", () => { const testSuiteIdx = 1; const testCaseIdx = 2; - cy.server(); - - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); - cy.route("GET", `run/${publicId}`, "fixture:test_run.json"); - cy.route( + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); + cy.intercept("GET", `run/${publicId}`, { fixture: "test_run.json" }); + cy.intercept( "GET", `run/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}`, - "fixture:failed_test_case_2.json" + { fixture: "failed_test_case_2.json" } ); cy.visit( diff --git a/ui/cypress/integration/test_case_screenshot_video.spec.js b/ui/cypress/e2e/test_case_screenshot_video.cy.js similarity index 100% rename from ui/cypress/integration/test_case_screenshot_video.spec.js rename to ui/cypress/e2e/test_case_screenshot_video.cy.js diff --git a/ui/cypress/integration/test_case_system_out_err.spec.js b/ui/cypress/e2e/test_case_system_out_err.cy.js similarity index 70% rename from ui/cypress/integration/test_case_system_out_err.spec.js rename to ui/cypress/e2e/test_case_system_out_err.cy.js index a345c3759..f1a401133 100644 --- a/ui/cypress/integration/test_case_system_out_err.spec.js +++ b/ui/cypress/e2e/test_case_system_out_err.cy.js @@ -4,28 +4,36 @@ context("test case system out and system err", () => { const testSuiteIdx = 1; const testCaseIdx = 2; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); - - cy.route( + cy.intercept( "GET", `run/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}`, - "fixture:failed_test_case_system_out_err_test_case_level.json" + { + fixture: "failed_test_case_system_out_err_test_case_level.json", + } ); - cy.route( + cy.intercept( "GET", `run/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}/systemOut`, - "fixture:test_output_system_out.json" + { + fixture: "test_output_system_out.json", + } ); - cy.route( + cy.intercept( "GET", `run/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}/systemErr`, - "fixture:test_output_system_err.json" + { + fixture: "test_output_system_err.json", + } ); + cy.interceptTestRunBasicRequests(publicId); + cy.visit( `http://localhost:1234/tests/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}` ); diff --git a/ui/cypress/integration/test_suite.spec.js b/ui/cypress/e2e/test_suite.cy.js similarity index 61% rename from ui/cypress/integration/test_suite.spec.js rename to ui/cypress/e2e/test_suite.cy.js index 2cdd6abee..5d8794a93 100644 --- a/ui/cypress/integration/test_suite.spec.js +++ b/ui/cypress/e2e/test_suite.cy.js @@ -4,21 +4,19 @@ context("test suite", () => { it("should link from test case details to test suite", () => { const publicId = "12345"; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); + cy.intercept("GET", `run/${publicId}/suite/1`, { + fixture: "test_suite_failing.json", + }); - cy.route( - "GET", - `run/${publicId}/suite/1`, - "fixture:test_suite_failing.json" - ); + cy.intercept("GET", `run/${publicId}/suite/1/case/2`, { + fixture: "failed_test_case_2.json", + }); - cy.route( - "GET", - `run/${publicId}/suite/1/case/2`, - "fixture:failed_test_case_2.json" - ); + cy.interceptTestRunBasicRequests(publicId); cy.visit(`http://localhost:1234/tests/${publicId}/suite/1/case/2`); @@ -44,27 +42,23 @@ context("test suite", () => { const publicId = "12345"; const testSuiteIdx = 3; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); + cy.intercept("GET", `run/${publicId}/suite/${testSuiteIdx}`, { + fixture: "test_suite_with_output.json", + }); - cy.route( - "GET", - `run/${publicId}/suite/${testSuiteIdx}`, - "fixture:test_suite_with_output.json" - ); + cy.intercept("GET", `run/${publicId}/suite/${testSuiteIdx}/systemOut`, { + fixture: "test_output_system_out.json", + }); - cy.route( - "GET", - `run/${publicId}/suite/${testSuiteIdx}/systemOut`, - "fixture:test_output_system_out.json" - ); + cy.intercept("GET", `run/${publicId}/suite/${testSuiteIdx}/systemErr`, { + fixture: "test_output_system_err.json", + }); - cy.route( - "GET", - `run/${publicId}/suite/${testSuiteIdx}/systemErr`, - "fixture:test_output_system_err.json" - ); + cy.interceptTestRunBasicRequests(publicId); cy.visit(`http://localhost:1234/tests/${publicId}/suite/${testSuiteIdx}`); diff --git a/ui/cypress/integration/test_suite_system_out_err.spec.js b/ui/cypress/e2e/test_suite_system_out_err.cy.js similarity index 74% rename from ui/cypress/integration/test_suite_system_out_err.spec.js rename to ui/cypress/e2e/test_suite_system_out_err.cy.js index b7ad7bc8c..91dd6a0b5 100644 --- a/ui/cypress/integration/test_suite_system_out_err.spec.js +++ b/ui/cypress/e2e/test_suite_system_out_err.cy.js @@ -4,21 +4,23 @@ context("test suite system out and system err", () => { const testSuiteIdx = 1; const testCaseIdx = 2; - cy.server(); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); - - cy.route( + cy.intercept( "GET", `run/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}`, - "fixture:failed_test_case_2.json" + { + fixture: "failed_test_case_2.json", + } ); - cy.route( - "GET", - `run/${publicId}/suite/${testSuiteIdx}/systemOut`, - "fixture:test_output_system_out.json" - ); + cy.intercept("GET", `run/${publicId}/suite/${testSuiteIdx}/systemOut`, { + fixture: "test_output_system_out.json", + }); + + cy.interceptTestRunBasicRequests(publicId); cy.visit( `http://localhost:1234/tests/${publicId}/suite/${testSuiteIdx}/case/${testCaseIdx}` diff --git a/ui/cypress/integration/test_suites_in_package.js b/ui/cypress/e2e/test_suites_in_package.cy.js similarity index 59% rename from ui/cypress/integration/test_suites_in_package.js rename to ui/cypress/e2e/test_suites_in_package.cy.js index c5a740e03..408c74c25 100644 --- a/ui/cypress/integration/test_suites_in_package.js +++ b/ui/cypress/e2e/test_suites_in_package.cy.js @@ -4,29 +4,25 @@ context("test run with failed test cases", () => { it("should link from test case details to test suites in package", () => { const publicId = "12345"; - cy.server(); - const packageName = "projektor.example.spock"; - cy.route("GET", `run/${publicId}/summary`, "fixture:test_run_summary.json"); + cy.intercept("GET", `run/${publicId}/summary`, { + fixture: "test_run_summary.json", + }); - cy.route( - "GET", - `run/${publicId}/suites?package=${packageName}`, - "fixture:test_case_summaries_in_package.json" - ); + cy.intercept("GET", `run/${publicId}/suites?package=${packageName}`, { + fixture: "test_case_summaries_in_package.json", + }); - cy.route( - "GET", - `run/${publicId}/suite/1/case/1`, - "fixture:failed_test_case_1.json" - ); + cy.intercept("GET", `run/${publicId}/suite/1/case/1`, { + fixture: "failed_test_case_1.json", + }); - cy.route( - "GET", - `run/${publicId}/suite/1/case/2`, - "fixture:failed_test_case_2.json" - ); + cy.intercept("GET", `run/${publicId}/suite/1/case/2`, { + fixture: "failed_test_case_2.json", + }); + + cy.interceptTestRunBasicRequests(publicId); cy.visit(`http://localhost:1234/tests/${publicId}/suite/1/case/2`); diff --git a/ui/cypress/integration/welcome.spec.js b/ui/cypress/e2e/welcome.cy.js similarity index 100% rename from ui/cypress/integration/welcome.spec.js rename to ui/cypress/e2e/welcome.cy.js diff --git a/ui/cypress/integration/messages.spec.js b/ui/cypress/integration/messages.spec.js deleted file mode 100644 index 77aeef76a..000000000 --- a/ui/cypress/integration/messages.spec.js +++ /dev/null @@ -1,54 +0,0 @@ -/// - -context("test run messages", () => { - it("when one message should show it on dashboard page", () => { - const publicId = "12345"; - - cy.server(); - - cy.route( - "GET", - `run/${publicId}/summary`, - "fixture:one_passing/test_run_summary.json" - ); - cy.route("GET", `run/${publicId}`, "fixture:one_passing/test_run.json"); - - cy.route( - "GET", - `run/${publicId}/messages`, - "fixture:messages/one_message.json" - ); - - cy.visit(`http://localhost:1234/tests/${publicId}`); - - cy.getByTestId("test-run-message-1").should( - "contain", - "Here is one message" - ); - }); - - it("when no messages should not display any dashboard page", () => { - const publicId = "12345"; - - cy.server(); - - cy.route( - "GET", - `run/${publicId}/summary`, - "fixture:one_passing/test_run_summary.json" - ); - cy.route("GET", `run/${publicId}`, "fixture:one_passing/test_run.json"); - - cy.route( - "GET", - `run/${publicId}/messages`, - "fixture:messages/no_messages.json" - ); - - cy.visit(`http://localhost:1234/tests/${publicId}`); - - cy.testIdShouldExist("test-run-messages"); - - cy.testIdShouldNotExist("test-run-message-1"); - }); -}); diff --git a/ui/cypress/integration/pin.spec.js b/ui/cypress/integration/pin.spec.js deleted file mode 100644 index 1f5c9dfa9..000000000 --- a/ui/cypress/integration/pin.spec.js +++ /dev/null @@ -1,125 +0,0 @@ -/// - -context("tests with pins", () => { - it("when cleanup enabled should allow pinning of report from side menu", () => { - const publicId = "12345"; - - cy.server(); - - cy.route( - "GET", - `run/${publicId}/attachments`, - "fixture:attachments/attachments_empty.json" - ); - - cy.route("GET", `run/${publicId}`, "fixture:one_passing/test_run.json"); - - cy.route( - "GET", - `/run/${publicId}/summary`, - "fixture:one_passing/test_run_summary.json" - ); - - cy.route("GET", `/config`, "fixture:config/cleanup_config_enabled.json"); - - cy.route({ - method: "GET", - url: `/run/${publicId}/attributes`, - status: 404, - response: "", - }); - - cy.route( - "POST", - `/run/${publicId}/attributes/pin`, - "fixture:attributes/pinned.json" - ).as("pin"); - - cy.route( - "POST", - `/run/${publicId}/attributes/unpin`, - "fixture:attributes/not_pinned.json" - ).as("unpin"); - - cy.visit(`http://localhost:1234/tests/${publicId}`); - - cy.getByTestId("nav-link-pin").click(); - - cy.getByTestId("nav-link-unpin").click(); - }); - - it("when cleanup enabled should allow pinning of report from dashboard", () => { - const publicId = "12345"; - - cy.server(); - - cy.route( - "GET", - `run/${publicId}/attachments`, - "fixture:attachments/attachments_empty.json" - ); - - cy.route("GET", `run/${publicId}`, "fixture:one_passing/test_run.json"); - - cy.route( - "GET", - `/run/${publicId}/summary`, - "fixture:one_passing/test_run_summary.json" - ); - - cy.route("GET", `/config`, "fixture:config/cleanup_config_enabled.json"); - - cy.route({ - method: "GET", - url: `/run/${publicId}/attributes`, - status: 404, - response: "", - }); - - cy.route( - "POST", - `/run/${publicId}/attributes/pin`, - "fixture:attributes/pinned.json" - ).as("pin"); - - cy.route( - "POST", - `/run/${publicId}/attributes/unpin`, - "fixture:attributes/not_pinned.json" - ).as("unpin"); - - cy.visit(`http://localhost:1234/tests/${publicId}`); - - cy.getByTestId("test-run-header-pin-link").click(); - - cy.getByTestId("test-run-header-unpin-link").click(); - }); - - it("when cleanup disabled should not show pin link in side menu or in dashboard", () => { - const publicId = "12345"; - - cy.server(); - - cy.route( - "GET", - `run/${publicId}/attachments`, - "fixture:attachments/attachments_empty.json" - ); - - cy.route("GET", `run/${publicId}`, "fixture:one_passing/test_run.json"); - - cy.route( - "GET", - `/run/${publicId}/summary`, - "fixture:one_passing/test_run_summary.json" - ); - - cy.route("GET", `/config`, "fixture:config/cleanup_config_disabled.json"); - - cy.visit(`http://localhost:1234/tests/${publicId}`); - - cy.testIdShouldNotExist("nav-link-pin"); - - cy.testIdShouldNotExist("test-run-header-pin-link"); - }); -}); diff --git a/ui/cypress/integration/results_processing.spec.js b/ui/cypress/integration/results_processing.spec.js deleted file mode 100644 index 0023cbfa3..000000000 --- a/ui/cypress/integration/results_processing.spec.js +++ /dev/null @@ -1,76 +0,0 @@ -/// - -context("results processing", () => { - it("when test results still processing should display message", () => { - const publicId = "12345"; - - cy.server(); - - cy.route({ - method: "GET", - url: `run/${publicId}/summary`, - status: 404, - response: {}, - }); - - cy.route( - "GET", - `results/${publicId}/status`, - "fixture:processing_status/processing_status_processing.json" - ); - - cy.visit(`http://localhost:1234/tests/${publicId}`); - - cy.getByTestId("results-still-processing").should( - "contain", - "Your test results are still processing" - ); - - cy.route( - "GET", - `results/${publicId}/status`, - "fixture:processing_status/processing_status_success.json" - ); - - cy.route( - "GET", - `run/${publicId}/summary`, - "fixture:one_passing/test_run_summary.json" - ); - cy.route("GET", `run/${publicId}`, "fixture:one_passing/test_run.json"); - - cy.wait(1000); - - cy.getByTestId("test-run-all-tests-title").should("contain", "All tests"); - }); - - it("should display error message when processing results failed", () => { - const publicId = "12345"; - - cy.server(); - - cy.route({ - method: "GET", - url: `run/${publicId}/summary`, - status: 404, - response: {}, - }); - - cy.route( - "GET", - `results/${publicId}/status`, - "fixture:processing_status/processing_status_error.json" - ); - - cy.visit(`http://localhost:1234/tests/${publicId}`); - - cy.getByTestId("results-processing-failed").should( - "contain", - "Error processing test results" - ); - cy.getByTestId("results-processing-failed").should( - "contain", - "Failed to parse results" - ); - }); -}); diff --git a/ui/cypress/plugins/index.js b/ui/cypress/plugins/index.js deleted file mode 100644 index 817b15c3f..000000000 --- a/ui/cypress/plugins/index.js +++ /dev/null @@ -1,14 +0,0 @@ -// Adapted from https://github.com/cypress-io/cypress/issues/2522#issuecomment-749316813 - big thanks to the Cypress team for this approach! - -// 'yarn install -D del' or 'npm install -D del' - https://www.npmjs.com/package/del -const del = require("del"); - -module.exports = (on, config) => { - on("after:spec", (spec, results) => { - if (results.stats.failures === 0 && results.video) { - // `del()` returns a promise, so it's important to return it to ensure - // deleting the video is finished before moving on - return del(results.video); - } - }); -}; diff --git a/ui/cypress/support/index.js b/ui/cypress/support/e2e.js similarity index 100% rename from ui/cypress/support/index.js rename to ui/cypress/support/e2e.js diff --git a/ui/cypress/tsconfig.json b/ui/cypress/tsconfig.json new file mode 100644 index 000000000..6f6e65d69 --- /dev/null +++ b/ui/cypress/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noEmit": true, + // be explicit about types included + // to avoid clashing with Jest types + "types": ["cypress"] + }, + "include": [ + "../node_modules/cypress", + "./**/*.ts", + "./**/*.js" + ] +} \ No newline at end of file diff --git a/ui/package.json b/ui/package.json index 870c3bb24..f2847a661 100644 --- a/ui/package.json +++ b/ui/package.json @@ -30,7 +30,7 @@ "axios-mock-adapter": "1.21.5", "chai-colors": "1.0.1", "css-mediaquery": "0.1.2", - "cypress": "9.7.0", + "cypress": "12.17.1", "del": "7.0.0", "env-cmd": "10.1.0", "jest": "29.6.1", diff --git a/ui/src/Dashboard/DashboardSummary.tsx b/ui/src/Dashboard/DashboardSummary.tsx index 4f329fc92..38a01a9c1 100644 --- a/ui/src/Dashboard/DashboardSummary.tsx +++ b/ui/src/Dashboard/DashboardSummary.tsx @@ -124,25 +124,27 @@ const DashboardSummary = ({ } /> )} - {gitMetadata && gitMetadata.gitHubBaseUrl && gitMetadata.commitSha && ( - - {gitMetadata.commitSha.substring( - gitMetadata.commitSha.length - 7 - )} - - } - /> - )} + {gitMetadata && + gitMetadata.gitHubBaseUrl && + gitMetadata.commitSha && ( + + {gitMetadata.commitSha.substring( + gitMetadata.commitSha.length - 7 + )} + + } + /> + )} {gitMetadata && gitMetadata.projectName && (