Skip to content

Commit

Permalink
test: ✅ Add package playwright for test e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Carolinedanslesnuages committed Dec 23, 2024
1 parent ae91371 commit 28ebf6a
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 103 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,59 @@ jobs:
run: |
npm ci
npm run format-check
test:
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install
working-directory: client

- name: Install dependencies
run: pnpm install
working-directory: server

- name: Start server for E2E tests
run: |
cd server
pnpm run start:dev &
sleep 10 # Attendre que le serveur démarre
- name: Start client for E2E tests
run: |
cd client
pnpm run dev &
sleep 10 # Attendre que le client démarre
- name: Verify Playwright Installation
run: pnpm exec playwright --version
working-directory: client

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
working-directory: client

- name: Run Playwright tests
run: pnpm exec playwright test
working-directory: client

- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: playwright-report
path: client/playwright-report/
retention-days: 30
5 changes: 5 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
clientnode_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
16 changes: 7 additions & 9 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# vue-dsfr-project

Ce gabarit possède tous les outils configurés pour développer un projets Vue 3 et VueDsfr avec Vite.
# Client

## Configuration recommandée

Expand All @@ -26,35 +24,35 @@ Si le plugin TypeScript ne vous semble pas assez performant, Volar a aussi impl
## Installer les dépendances

```sh
npm install
pnpm install
```

### Compilation et Hot-Reload pour le développement

```sh
npm run dev
pnpm run dev
```

### Vérification des types, Compilation et Minification pour la Production

```sh
npm run build
pnpm run build
```

## Voir l'application avec le code de production

```sh
npm run preview
pnpm run preview
```

## Déployer le code de production

Déployer le contenu du dossier `dist` après avoir généré le code de production.

### Vérifier la syntaxe et le formattage avec [ESLint](https://eslint.org/)
### Vérifier la syntaxe et le formattage avec Prettier

```sh
npm run lint
npm run format
```

### Lancer les Tests Unitaires avec [Vitest](https://vitest.dev/)
Expand Down
55 changes: 31 additions & 24 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"devDependencies": {
"@antfu/eslint-config": "^3.0.0",
"@playwright/test": "^1.46.1",
"@playwright/test": "^1.49.1",
"@rushstack/eslint-patch": "^1.10.4",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/vue": "^8.1.0",
Expand All @@ -47,6 +47,7 @@
"eslint-plugin-playwright": "^1.6.2",
"jsdom": "^25.0.0",
"npm-run-all2": "^6.2.2",
"playwright": "^1.49.1",
"rimraf": "^5.0.10",
"typescript": "~5.4.5",
"unplugin-auto-import": "^0.18.2",
Expand Down
Loading

0 comments on commit 28ebf6a

Please sign in to comment.