Skip to content

Commit

Permalink
test: 🧑‍💻 update code coverage for e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nutfdt committed Dec 11, 2024
1 parent ec5a7da commit ecb9e05
Show file tree
Hide file tree
Showing 4 changed files with 2,845 additions and 11,762 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,28 @@ jobs:
build: npm run build
start: npm run start
command: npm run test:e2e-ci
- name: Install pycobertura
run: pip install pycobertura
- name: Verify pycobertura installation
run: pycobertura --version
- name: Generate Cobertura Report
run: |
cd frontend
npx nyc report --reporter=cobertura
- name: Validate Coverage with pycobertura
run: |
cd frontend
pycobertura show coverage/cobertura-coverage.xml
- name: Produce Coverage Report
uses: insightsengineering/coverage-action@v2
with:
path: ./frontend/coverage/cobertura-coverage.xml
publish: true
threshold:
- name: Send artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: cypress-screenshots
path: |
./frontend/cypress/screenshots/
- name: Report NYC coverage
uses: sidx1024/[email protected]
with:
coverage_file: "./frontend/coverage/coverage-summary.json"
./frontend/cypress/screenshots/
7 changes: 3 additions & 4 deletions frontend/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "cypress";
import coverageTask from "@cypress/code-coverage/task";
import codeCoverageTask from "@cypress/code-coverage/task.js";

const frontendHost = "localhost";
const frontendPort = "5173";
Expand All @@ -8,13 +8,12 @@ export default defineConfig({
e2e: {
specPattern: "cypress/e2e/**/*.{cy,spec}.{js,ts}",
baseUrl: `http://${frontendHost}:${frontendPort}`,
// NEO - Crosscall X4 - Résolution : 18:9
// Iphone XR
viewportWidth: 414,
viewportHeight: 896,
video: false,
supportFile: "cypress/support/e2e.js",
setupNodeEvents(on, config) {
coverageTask(on, config);
codeCoverageTask(on, config);
return config;
},
},
Expand Down
Loading

0 comments on commit ecb9e05

Please sign in to comment.