From 82b667bd1e1877bdaeb6aa57437b1d97bd724ecb Mon Sep 17 00:00:00 2001 From: Dariusz Majcherczyk Date: Sun, 16 Apr 2023 22:51:03 +0200 Subject: [PATCH] test: mocha reporter for e2e tests --- .github/workflows/cypress-run.yml | 12 ++++++++++++ .gitignore | 3 +++ apps/trading-e2e/cypress.config.js | 2 ++ package.json | 1 + 4 files changed, 18 insertions(+) diff --git a/.github/workflows/cypress-run.yml b/.github/workflows/cypress-run.yml index 15edc3967..cfaa400a2 100644 --- a/.github/workflows/cypress-run.yml +++ b/.github/workflows/cypress-run.yml @@ -72,6 +72,18 @@ jobs: CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }} CYPRESS_VEGA_WALLET_API_TOKEN: ${{ steps.setup-vega.outputs.token }} + ###### + ## Show test summary on github page + ###### + + - name: Show test summary + if: success() || failure() + uses: dorny/test-reporter@v1 + with: + name: UI Tests + path: mochawesome.json + reporter: mocha-json + ###### ## Upload logs ###### diff --git a/.gitignore b/.gitignore index b00636407..363ffb3bf 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,6 @@ cypress.env.json # Next.js .next + +#cypress +/apps/trading-e2e/cypress/reports/html diff --git a/apps/trading-e2e/cypress.config.js b/apps/trading-e2e/cypress.config.js index 022bd41e2..fe4926e95 100644 --- a/apps/trading-e2e/cypress.config.js +++ b/apps/trading-e2e/cypress.config.js @@ -1,8 +1,10 @@ const { defineConfig } = require('cypress'); module.exports = defineConfig({ + reporter: '../../node_modules/cypress-mochawesome-reporter', e2e: { setupNodeEvents(on, config) { + require('cypress-mochawesome-reporter/plugin')(on); require('@cypress/grep/src/plugin')(config); return config; }, diff --git a/package.json b/package.json index 5c79d4e27..45fdbce92 100644 --- a/package.json +++ b/package.json @@ -150,6 +150,7 @@ "babel-jest": "27.5.1", "babel-loader": "8.1.0", "cypress": "^11.2.0", + "cypress-mochawesome-reporter": "^3.3.0", "cypress-real-events": "^1.7.1", "dotenv": "^16.0.1", "eslint": "8.15.0",