From c0006f1921e3711970cfd4a0dbb02af649add5b8 Mon Sep 17 00:00:00 2001 From: FahadDarw Date: Wed, 4 Dec 2024 16:45:54 +0000 Subject: [PATCH 1/4] added slack notifications to get cypress results on slack channels --- Dfe.Academies.External.Web/CypressTests/cypress.config.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dfe.Academies.External.Web/CypressTests/cypress.config.ts b/Dfe.Academies.External.Web/CypressTests/cypress.config.ts index 7ca5395d0..d5f841adb 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress.config.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress.config.ts @@ -2,17 +2,19 @@ import { defineConfig } from 'cypress' import { generateZapReport } from './cypress/plugins/generateZapReport' export default defineConfig({ - reporter: 'cypress-multi-reporters', + reporter: 'cypress-multi-reporters', // added this for slack messaging plugin reporterOptions: { reporterEnabled: 'mochawesome', mochawesomeReporterOptions: { - reportDir: 'cypress/reports/mocha', - quite: true, + reportDir: 'cypress/reports/mocha', // added this for slack messaging plugin + quiet: true, // Fixed typo overwrite: false, html: false, json: true, }, }, + + video: false, userAgent: 'DfEAcademiesExternal/1.0 Cypress', e2e: { From 207dcd7e347eaa2bb7a5ca23c44af2af4069cc4a Mon Sep 17 00:00:00 2001 From: FahadDarw Date: Wed, 4 Dec 2024 16:45:54 +0000 Subject: [PATCH 2/4] added slack notifications to get cypress results on slack channels --- Dfe.Academies.External.Web/CypressTests/cypress.config.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dfe.Academies.External.Web/CypressTests/cypress.config.ts b/Dfe.Academies.External.Web/CypressTests/cypress.config.ts index 7ca5395d0..d5f841adb 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress.config.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress.config.ts @@ -2,17 +2,19 @@ import { defineConfig } from 'cypress' import { generateZapReport } from './cypress/plugins/generateZapReport' export default defineConfig({ - reporter: 'cypress-multi-reporters', + reporter: 'cypress-multi-reporters', // added this for slack messaging plugin reporterOptions: { reporterEnabled: 'mochawesome', mochawesomeReporterOptions: { - reportDir: 'cypress/reports/mocha', - quite: true, + reportDir: 'cypress/reports/mocha', // added this for slack messaging plugin + quiet: true, // Fixed typo overwrite: false, html: false, json: true, }, }, + + video: false, userAgent: 'DfEAcademiesExternal/1.0 Cypress', e2e: { From 03b0a0b2228d5d4671db4794df71097c40ff557a Mon Sep 17 00:00:00 2001 From: FahadDarw Date: Thu, 12 Dec 2024 16:29:31 +0000 Subject: [PATCH 3/4] added_Slack_Notification --- .github/workflows/cypress-tests.yml | 6 ++++++ .../CypressTests/cypress/cypress.config.js | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 Dfe.Academies.External.Web/CypressTests/cypress/cypress.config.js diff --git a/.github/workflows/cypress-tests.yml b/.github/workflows/cypress-tests.yml index 0fd91e11b..db832a1ec 100644 --- a/.github/workflows/cypress-tests.yml +++ b/.github/workflows/cypress-tests.yml @@ -65,3 +65,9 @@ jobs: run: npm run cy:notify -- --custom-text="Environment ${{ inputs.environment }}, See more information https://github.com/DFE-Digital/Dfe.Academies.External/actions/runs/${{github.run_id}}" env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + - name: Generate report + if: always() + run: | + mkdir mochareports + npm run generate:html:report + \ No newline at end of file diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/cypress.config.js b/Dfe.Academies.External.Web/CypressTests/cypress/cypress.config.js new file mode 100644 index 000000000..97f47c412 --- /dev/null +++ b/Dfe.Academies.External.Web/CypressTests/cypress/cypress.config.js @@ -0,0 +1,9 @@ +const { defineConfig } = require("cypress"); + +module.exports = defineConfig({ + e2e: { + setupNodeEvents(on, config) { + // implement node event listeners here + }, + }, +}); From 5909b167264ce658070c87e1800dc05cbb1c4970 Mon Sep 17 00:00:00 2001 From: FahadDarw Date: Thu, 12 Dec 2024 16:33:45 +0000 Subject: [PATCH 4/4] added_Slack_Notification --- .github/workflows/cypress-tests.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cypress-tests.yml b/.github/workflows/cypress-tests.yml index db832a1ec..8f6e73378 100644 --- a/.github/workflows/cypress-tests.yml +++ b/.github/workflows/cypress-tests.yml @@ -53,6 +53,12 @@ jobs: - name: Run cypress run: npm run cy:run -- --env URL='${{ secrets.URL }}',LOGIN_USERNAME=${{ secrets.LOGIN_USERNAME }},LOGIN_PASSWORD=${{ secrets.LOGIN_PASSWORD }},SIGNIN_URL=${{ secrets.SIGNIN_URL }} + - name: Generate report + if: always() + run: | + mkdir mochareports + npm run generate:html:report + - name: upload report uses: actions/upload-artifact@v4 if: failure() @@ -65,9 +71,4 @@ jobs: run: npm run cy:notify -- --custom-text="Environment ${{ inputs.environment }}, See more information https://github.com/DFE-Digital/Dfe.Academies.External/actions/runs/${{github.run_id}}" env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - name: Generate report - if: always() - run: | - mkdir mochareports - npm run generate:html:report - \ No newline at end of file + \ No newline at end of file