From d5dd075196fc617435e6b9644399053b4b7c4a96 Mon Sep 17 00:00:00 2001 From: Bastien Date: Wed, 14 Aug 2024 16:12:51 +0200 Subject: [PATCH] Initialisation Playwright --- .github/workflows/playwright.yml | 9 +++++---- .gitignore | 1 + package.json | 2 +- playwright.config.ts | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 847e2e2..65bdae6 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -51,13 +51,14 @@ jobs: - name: Execution des tests Playwright run: npx playwright test env: - BASE_URL: ${{ steps.vercel_preview_url.outputs.preview_url }} + BASE_URL: https://${{ steps.vercel_preview_url.outputs.preview_url }} - name: Ajout du commentaire dans la PR - run: npx github-actions-ctrf ctrf/ctrf-report.json --pr-comment + uses: daun/playwright-report-summary@v3 if: always() - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + report-file: test-results.json + comment-title: 'Résultats des tests E2E Playwright' - name: Mise à disposition des résultats uses: actions/upload-artifact@v4 diff --git a/.gitignore b/.gitignore index 11891ca..d39aa75 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ env.local /playwright-report/ /blob-report/ /playwright/.cache/ +test-results.json \ No newline at end of file diff --git a/package.json b/package.json index 393914c..d22cf6b 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build": "next build", "start": "next start", "lint": "next lint", + "e2e": "playwright test", "predev": "react-dsfr update-icons", "prebuild": "react-dsfr update-icons", "prepare": "husky" @@ -39,7 +40,6 @@ "@playwright/test": "^1.46.0", "husky": "^9.1.4", "lint-staged": "^15.2.8", - "playwright-ctrf-json-reporter": "^0.0.15", "prettier": "^3.3.3", "sass": "^1.77.8" }, diff --git a/playwright.config.ts b/playwright.config.ts index 4bab8fd..0bf5a62 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -21,7 +21,7 @@ export default defineConfig({ /* Opt out of parallel tests on CI. */ workers: process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: [['html'], ['playwright-ctrf-json-reporter', {}]], + reporter: [['html'], ['json', { outputFile: 'test-results.json' }]], /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */