Skip to content

Commit

Permalink
Merge pull request #752 from DFE-Digital/added_Slack_Notification
Browse files Browse the repository at this point in the history
Add Slack Notifications to Cypress Test Results
  • Loading branch information
DrizzlyOwl authored Dec 12, 2024
2 parents 3daf066 + d181d6e commit ac77a2e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/cypress-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 5 additions & 3 deletions Dfe.Academies.External.Web/CypressTests/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});

0 comments on commit ac77a2e

Please sign in to comment.