From f7480bd381746de22ef49ba0674fe83d6bed1fee Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 11 Jul 2023 20:06:20 +0200 Subject: [PATCH 01/15] add reporter packages to e2e-test directory --- package.json | 1 + yarn.lock | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9f8399db7..b4e0ee7de 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "import": "^0.0.6", "jsonwebtoken": "^8.5.1", "mock-socket": "^9.0.3", + "multiple-cucumber-html-reporter": "^3.4.0", "neo4j-driver": "^4.3.4", "neode": "^0.4.8", "rosie": "^2.1.0", diff --git a/yarn.lock b/yarn.lock index bae0e9a19..06f722799 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3258,6 +3258,11 @@ debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.2, debug@^4.3.4: dependencies: ms "2.1.2" +define-lazy-prop@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" + integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== + defined@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.1.tgz#c0b9db27bfaffd95d6f61399419b893df0f91ebf" @@ -3757,6 +3762,13 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" +find@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find/-/find-0.3.0.tgz#4082e8fc8d8320f1a382b5e4f521b9bc50775cb8" + integrity sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw== + dependencies: + traverse-chain "~0.1.0" + follow-redirects@^1.14.9: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" @@ -3792,6 +3804,15 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" +fs-extra@^11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.1.1.tgz#da69f7c39f3b002378b0954bb6ae7efdc0876e2d" + integrity sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^9.0.0, fs-extra@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -4137,6 +4158,11 @@ is-core-module@^2.11.0: dependencies: has "^1.0.3" +is-docker@^2.0.0, is-docker@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" + integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== + is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -4234,6 +4260,13 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== +is-wsl@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" + isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -4364,7 +4397,7 @@ json5@^2.2.2: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== -jsonfile@^6.0.1: +jsonfile@^6.0.1, jsonfile@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== @@ -4575,6 +4608,11 @@ lru-cache@^9.1.1: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.1.2.tgz#255fdbc14b75589d6d0e73644ca167a8db506835" integrity sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ== +luxon@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.3.0.tgz#d73ab5b5d2b49a461c47cedbc7e73309b4805b48" + integrity sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg== + make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -4715,6 +4753,19 @@ ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== +multiple-cucumber-html-reporter@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/multiple-cucumber-html-reporter/-/multiple-cucumber-html-reporter-3.4.0.tgz#03db1772834952c70555ee16074d26c308d18ca4" + integrity sha512-Y2FQA/OosmlsB/ZQUPJvnkKKYFKa/J+Qv2QUl5PsO3BC77jXwyPE8fAWopLH+CEYlRTs7fcdfydmWFitGMFi0A== + dependencies: + find "^0.3.0" + fs-extra "^11.1.1" + jsonfile "^6.1.0" + lodash "^4.17.21" + luxon "^3.3.0" + open "^8.4.2" + uuid "^9.0.0" + mz@^2.4.0: version "2.7.0" resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" @@ -4833,6 +4884,15 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" +open@^8.4.2: + version "8.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9" + integrity sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ== + dependencies: + define-lazy-prop "^2.0.0" + is-docker "^2.1.1" + is-wsl "^2.2.0" + optimist@0.3.x: version "0.3.7" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.3.7.tgz#c90941ad59e4273328923074d2cf2e7cbc6ec0d9" @@ -5790,6 +5850,11 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== +traverse-chain@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1" + integrity sha512-up6Yvai4PYKhpNp5PkYtx50m3KbwQrqDwbuZP/ItyL64YEWHAvH6Md83LFLV/GRSk/BoUVwwgUzX6SOQSbsfAg== + tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -5952,7 +6017,7 @@ util@~0.12.0: is-typed-array "^1.1.3" which-typed-array "^1.1.2" -uuid@9.0.0: +uuid@9.0.0, uuid@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== From 8dd7156195f06267e59ce9c075246efb69ec3205 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 11 Jul 2023 20:13:27 +0200 Subject: [PATCH 02/15] remove unnecessary code from cypress config --- cypress/cypress.config.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cypress/cypress.config.js b/cypress/cypress.config.js index b169c0ce0..7decc60e6 100644 --- a/cypress/cypress.config.js +++ b/cypress/cypress.config.js @@ -22,12 +22,6 @@ async function setupNodeEvents(on, config) { }, }); - on("after:run", (results) => { - if (results) { - console.log(results.status); - } - }); - return config; } From 4da06ce800c72c564322722d999948c150e5299d Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 11 Jul 2023 20:16:34 +0200 Subject: [PATCH 03/15] update cypress cucumber preprosessor config in package.json --- package.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b4e0ee7de..900c132cd 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,19 @@ "url": "https://github.com/Ocelot-Social-Community/Ocelot-Social.git" }, "cypress-cucumber-preprocessor": { - "nonGlobalStepDefinitions": true + "stepDefinitions": "cypress/support/step_definitions/*.ts", + "json": { + "enabled": true, + "output": "cypress/reports/json_logs/cucumber_log.json", + "formatter": "cucumber-json-formatter" + }, + "messages": { + "enabled": true, + "output": "cypress/reports/json_logs/messages.ndjson" + }, + "html": { + "enabled": false + } }, "scripts": { "db:seed": "cd backend && yarn run db:seed", From 8d3dd01724be4b43b77004a5346058e298d74046 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 11 Jul 2023 20:40:18 +0200 Subject: [PATCH 04/15] add htlm report creation script --- cypress/create-cucumber-html-report.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cypress/create-cucumber-html-report.js diff --git a/cypress/create-cucumber-html-report.js b/cypress/create-cucumber-html-report.js new file mode 100644 index 000000000..9720f4281 --- /dev/null +++ b/cypress/create-cucumber-html-report.js @@ -0,0 +1,12 @@ +const report = require("multiple-cucumber-html-reporter"); + +const reportTitle = "Ocelot webapp end-to-end test report" + +report.generate({ + jsonDir: "reports/json_logs", + reportPath: "./reports/cucumber_html_report", + pageTitle: reportTitle, + reportName: reportTitle, + pageFooter: "
", + hideMetadata: true +}); \ No newline at end of file From a0b6c67707198f01abc1057cdef947e6cac5997a Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 11 Jul 2023 20:41:38 +0200 Subject: [PATCH 05/15] update github e2e workflow file to reporting related changes --- .github/workflows/test-e2e.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 9d007c451..1ea05d1cb 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -24,6 +24,14 @@ jobs: - name: boot up test system | docker-compose run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp neo4j backend + - name: End-to-end tests | prepare + run: | + wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-386" + chmod +x /opt/cucumber-json-formatter + sudo ln -fs /opt/cucumber-json-formatter /usr/bin/cucumber-json-formatter + cd e2e-tests/ + yarn + - name: cypress | Fullstack tests id: e2e-tests run: | @@ -31,15 +39,22 @@ jobs: yarn install yarn build cd .. - yarn install yarn run cypress:run --spec $(cypress/parallel-features.sh ${{ matrix.job }} ${{ env.jobs }} ) ########################################################################## # UPLOAD SCREENSHOTS - IF TESTS FAIL ##################################### ########################################################################## - - name: Full stack tests | if any test failed, upload screenshots + - name: Full stack tests | if tests failed, compile html report + if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }} + run: | + cd e2e-tests/ + node create-cucumber-html-report.js + + - name: End-to-end tests | if tests failed, upload report + id: e2e-report if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }} uses: actions/upload-artifact@v3 with: - name: cypress-screenshots - path: cypress/screenshots/ + name: cypress-report-pr${{ steps.pr.outputs.number }} + path: /home/runner/work/gradido/gradido/e2e-tests/cypress/reports/cucumber_html_report + From d65f87c1a8a396c6944b37a6b48256c8535540dc Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 11 Jul 2023 20:41:38 +0200 Subject: [PATCH 06/15] update github e2e workflow file to reporting related changes --- .github/workflows/test-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 1ea05d1cb..d85a265f1 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -29,7 +29,7 @@ jobs: wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-386" chmod +x /opt/cucumber-json-formatter sudo ln -fs /opt/cucumber-json-formatter /usr/bin/cucumber-json-formatter - cd e2e-tests/ + cd cypress/ yarn - name: cypress | Fullstack tests From 44ac68fb35db2be802875308b3af27c13b2dea73 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 11 Jul 2023 20:41:38 +0200 Subject: [PATCH 07/15] update github e2e workflow file to reporting related changes --- .github/workflows/test-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index d85a265f1..30845ee16 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -47,7 +47,7 @@ jobs: - name: Full stack tests | if tests failed, compile html report if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }} run: | - cd e2e-tests/ + cd cypress/ node create-cucumber-html-report.js - name: End-to-end tests | if tests failed, upload report From a93500488a396c80b9bbc7f63a4f8979f7d33a80 Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 12 Jul 2023 08:35:39 +0200 Subject: [PATCH 08/15] update github e2e workflow file to reporting related changes --- .github/workflows/test-e2e.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 30845ee16..6ac237fb3 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -29,17 +29,15 @@ jobs: wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-386" chmod +x /opt/cucumber-json-formatter sudo ln -fs /opt/cucumber-json-formatter /usr/bin/cucumber-json-formatter - cd cypress/ - yarn - - - name: cypress | Fullstack tests - id: e2e-tests - run: | cd backend yarn install yarn build cd .. - yarn run cypress:run --spec $(cypress/parallel-features.sh ${{ matrix.job }} ${{ env.jobs }} ) + yarn install + + - name: cypress | Fullstack tests + id: e2e-tests + run: yarn run cypress:run --spec $(cypress/parallel-features.sh ${{ matrix.job }} ${{ env.jobs }} ) ########################################################################## # UPLOAD SCREENSHOTS - IF TESTS FAIL ##################################### From 4c565e92c58d2ed3dcb9ebec5cbb877f9a523eba Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 12 Jul 2023 09:05:41 +0200 Subject: [PATCH 09/15] correct spec pattern path in cypress config --- .github/workflows/test-e2e.yml | 30 +++++++++++++++--------------- cypress/cypress.config.js | 6 ++++++ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 6ac237fb3..5b4267a89 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -5,26 +5,26 @@ jobs: fullstack_tests: name: Fullstack tests runs-on: ubuntu-latest - env: - jobs: 8 - strategy: - matrix: - # run copies of the current job in parallel - job: [1, 2, 3, 4, 5, 6, 7, 8] + # env: + # jobs: 8 + # strategy: + # matrix: + # # run copies of the current job in parallel + # job: [1, 2, 3, 4, 5, 6, 7, 8] steps: - name: Checkout code uses: actions/checkout@v3 - - name: webapp | copy env file - run: cp webapp/.env.template webapp/.env + # - name: webapp | copy env file + # run: cp webapp/.env.template webapp/.env - - name: backend | copy env file - run: cp backend/.env.template backend/.env + # - name: backend | copy env file + # run: cp backend/.env.template backend/.env - - name: boot up test system | docker-compose - run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp neo4j backend + # - name: boot up test system | docker-compose + # run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp neo4j backend - - name: End-to-end tests | prepare + - name: Full stack tests | prepare run: | wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-386" chmod +x /opt/cucumber-json-formatter @@ -35,9 +35,9 @@ jobs: cd .. yarn install - - name: cypress | Fullstack tests + - name: Full stack tests | run tests id: e2e-tests - run: yarn run cypress:run --spec $(cypress/parallel-features.sh ${{ matrix.job }} ${{ env.jobs }} ) + run: yarn run cypress:run --spec cypress/e2e/Internationalization.feature,cypress/e2e/Post.Comment.feature ########################################################################## # UPLOAD SCREENSHOTS - IF TESTS FAIL ##################################### diff --git a/cypress/cypress.config.js b/cypress/cypress.config.js index 7decc60e6..a2f79bb84 100644 --- a/cypress/cypress.config.js +++ b/cypress/cypress.config.js @@ -22,6 +22,12 @@ async function setupNodeEvents(on, config) { }, }); + on("after:run", (results) => { + if (results) { + console.log(results.status); + } + }); + return config; } From f454ea1159ffcdf743cf7d904580945c0ece4e36 Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 12 Jul 2023 09:10:00 +0200 Subject: [PATCH 10/15] reset e2e test workflow --- .github/workflows/test-e2e.yml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 5b4267a89..769f97a11 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -5,24 +5,24 @@ jobs: fullstack_tests: name: Fullstack tests runs-on: ubuntu-latest - # env: - # jobs: 8 - # strategy: - # matrix: - # # run copies of the current job in parallel - # job: [1, 2, 3, 4, 5, 6, 7, 8] + env: + jobs: 8 + strategy: + matrix: + # run copies of the current job in parallel + job: [1, 2, 3, 4, 5, 6, 7, 8] steps: - name: Checkout code uses: actions/checkout@v3 - # - name: webapp | copy env file - # run: cp webapp/.env.template webapp/.env + - name: webapp | copy env file + run: cp webapp/.env.template webapp/.env - # - name: backend | copy env file - # run: cp backend/.env.template backend/.env + - name: backend | copy env file + run: cp backend/.env.template backend/.env - # - name: boot up test system | docker-compose - # run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp neo4j backend + - name: boot up test system | docker-compose + run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp neo4j backend - name: Full stack tests | prepare run: | @@ -37,11 +37,8 @@ jobs: - name: Full stack tests | run tests id: e2e-tests - run: yarn run cypress:run --spec cypress/e2e/Internationalization.feature,cypress/e2e/Post.Comment.feature + run: yarn run cypress:run --spec $(cypress/parallel-features.sh ${{ matrix.job }} ${{ env.jobs }} ) - ########################################################################## - # UPLOAD SCREENSHOTS - IF TESTS FAIL ##################################### - ########################################################################## - name: Full stack tests | if tests failed, compile html report if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }} run: | @@ -54,5 +51,5 @@ jobs: uses: actions/upload-artifact@v3 with: name: cypress-report-pr${{ steps.pr.outputs.number }} - path: /home/runner/work/gradido/gradido/e2e-tests/cypress/reports/cucumber_html_report + path: /home/runner/work/Ocelot-Social/Ocelot-Social/cypress/reports/cucumber_html_report From 875dfcefa50cd2312de984400474035fa547ebaa Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 12 Jul 2023 09:10:00 +0200 Subject: [PATCH 11/15] reset e2e test workflow --- cypress/cypress.config.js | 6 ------ package.json | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/cypress/cypress.config.js b/cypress/cypress.config.js index a2f79bb84..b1d80575e 100644 --- a/cypress/cypress.config.js +++ b/cypress/cypress.config.js @@ -21,12 +21,6 @@ async function setupNodeEvents(on, config) { return testStore[name] }, }); - - on("after:run", (results) => { - if (results) { - console.log(results.status); - } - }); return config; } diff --git a/package.json b/package.json index 900c132cd..51c833149 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/Ocelot-Social-Community/Ocelot-Social.git" }, "cypress-cucumber-preprocessor": { - "stepDefinitions": "cypress/support/step_definitions/*.ts", + "stepDefinitions": "cypress/support/step_definitions/**/*.js", "json": { "enabled": true, "output": "cypress/reports/json_logs/cucumber_log.json", From 463d2224be3f408755e2f04505ecbd63df315604 Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 12 Jul 2023 10:00:35 +0200 Subject: [PATCH 12/15] make e2e tests failto test html reporting --- cypress/e2e/UserProfile.ChangePassword.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/UserProfile.ChangePassword.feature b/cypress/e2e/UserProfile.ChangePassword.feature index a7eec1cce..e3a0bebf7 100644 --- a/cypress/e2e/UserProfile.ChangePassword.feature +++ b/cypress/e2e/UserProfile.ChangePassword.feature @@ -18,7 +18,7 @@ Feature: User profile - change password Scenario: Incorrect Old Password When I fill the password form with: - | Your old password | incorrect | + | Your old password | exposed | | Your new password | secure | | Confirm new password | secure | And I submit the form @@ -50,6 +50,6 @@ Feature: User profile - change password Then I fill in my credentials "peterpan@example.org" "exposed" And I click on "submit button" And I cannot login anymore - But I fill in my credentials "peterpan@example.org" "secure" + But I fill in my credentials "peterpan@example.org" "secu" And I click on "submit button" And I can login successfully From c32be115619de811a14ad82ef50c86cf254b9e11 Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 12 Jul 2023 10:27:12 +0200 Subject: [PATCH 13/15] add action to retrieve current pr number to e2e test workflow --- .github/workflows/test-e2e.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 769f97a11..0c27163cb 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -45,6 +45,11 @@ jobs: cd cypress/ node create-cucumber-html-report.js + - name: End-to-end tests | if tests failed, get pr number + id: pr + if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }} + uses: 8BitJonny/gh-get-current-pr@2.2.0 + - name: End-to-end tests | if tests failed, upload report id: e2e-report if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }} From f073553621eae42f833d98277526da260fa10d8f Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 12 Jul 2023 10:50:58 +0200 Subject: [PATCH 14/15] Revert "make e2e tests failto test html reporting" This reverts commit 463d2224be3f408755e2f04505ecbd63df315604. --- cypress/e2e/UserProfile.ChangePassword.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/UserProfile.ChangePassword.feature b/cypress/e2e/UserProfile.ChangePassword.feature index e3a0bebf7..a7eec1cce 100644 --- a/cypress/e2e/UserProfile.ChangePassword.feature +++ b/cypress/e2e/UserProfile.ChangePassword.feature @@ -18,7 +18,7 @@ Feature: User profile - change password Scenario: Incorrect Old Password When I fill the password form with: - | Your old password | exposed | + | Your old password | incorrect | | Your new password | secure | | Confirm new password | secure | And I submit the form @@ -50,6 +50,6 @@ Feature: User profile - change password Then I fill in my credentials "peterpan@example.org" "exposed" And I click on "submit button" And I cannot login anymore - But I fill in my credentials "peterpan@example.org" "secu" + But I fill in my credentials "peterpan@example.org" "secure" And I click on "submit button" And I can login successfully From 7a4ca7011c4014b9b802396ecd1bb535ede23440 Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 12 Jul 2023 10:55:28 +0200 Subject: [PATCH 15/15] improve e2e test report name --- .github/workflows/test-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 0c27163cb..74ebd1c43 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -55,6 +55,6 @@ jobs: if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }} uses: actions/upload-artifact@v3 with: - name: cypress-report-pr${{ steps.pr.outputs.number }} + name: ocelot-e2e-test-report-pr${{ steps.pr.outputs.number }} path: /home/runner/work/Ocelot-Social/Ocelot-Social/cypress/reports/cucumber_html_report