Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

feat: use playwright for e2e tests #240

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
NEXT_TELEMETRY_DISABLED=1
NEXT_PUBLIC_SITE_URL=""
NEXT_PUBLIC_SENTRY_DSN="https://[email protected]/68"
NEXT_PUBLIC_SENTRY_DSN="https://xxx/yy"
NEXT_PUBLIC_SENTRY_ENV="dev"
NEXT_PUBLIC_MATOMO_URL=""
NEXT_PUBLIC_MATOMO_SITE_ID=""
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/SocialGouv/template"
NEXT_PUBLIC_MATOMO_URL="https://stats.beta.gouv.fr"
NEXT_PUBLIC_MATOMO_SITE_ID="1"
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/betagouv/template"
NEXT_PUBLIC_BASE_PATH=/template
10 changes: 6 additions & 4 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
NEXT_TELEMETRY_DISABLED=1
NEXT_PUBLIC_SITE_URL="https://template.fabrique.social.gouv.fr/"
NEXT_PUBLIC_SENTRY_DSN="https://[email protected]/68"
NEXT_PUBLIC_SITE_URL="https://template.beta.gouv.fr/"
NEXT_PUBLIC_SENTRY_DSN="https://xxx/yy"
NEXT_PUBLIC_SENTRY_ENV="production"
NEXT_PUBLIC_MATOMO_URL="https://matomo.fabrique.social.gouv.fr"
NEXT_PUBLIC_MATOMO_URL="https:/stats.beta.gouv.fr"
NEXT_PUBLIC_MATOMO_SITE_ID=63
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/SocialGouv/template"
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/betagouv/template"
PRODUCTION=true
NEXT_PUBLIC_BASE_PATH=/template
9 changes: 5 additions & 4 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
NEXT_TELEMETRY_DISABLED=1
NEXT_PUBLIC_SITE_URL="https://template.fabrique.social.gouv.fr/"
NEXT_PUBLIC_SENTRY_DSN="https://[email protected]/68"
NEXT_PUBLIC_SENTRY_ENV="development"
NEXT_PUBLIC_SITE_URL="https://template.incubateur.net/"
NEXT_PUBLIC_SENTRY_DSN="https://xxx/yy"
NEXT_PUBLIC_SENTRY_ENV="staging"
NEXT_PUBLIC_MATOMO_URL=""
NEXT_PUBLIC_MATOMO_SITE_ID=""
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/SocialGouv/template"
NEXT_PUBLIC_APP_REPOSITORY_URL="https://github.com/betagouv/template"
NEXT_PUBLIC_BASE_PATH=/template
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"next/core-web-vitals",
"plugin:storybook/recommended",
"plugin:jsx-a11y/recommended"
]
],
"rules": { "react/no-unescaped-entities": "warn" }
}
23 changes: 0 additions & 23 deletions .github/workflows/deactivate.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/debug-kube.yaml

This file was deleted.

25 changes: 15 additions & 10 deletions .github/workflows/storybook.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Storybook
name: Deploy demo

on:
push:
branches: [main]
branches: [main, next]

concurrency:
cancel-in-progress: true
group: storybook-${{ github.ref }}
group: deploy-${{ github.ref }}

jobs:
storybook:
name: Deployment storybook on gh-pages
build:
name: Deployment demo on gh-pages
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -26,9 +26,14 @@ jobs:
run: |
yarn --immutable

- name: Deploy
- name: Build
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
yarn storybook:deploy:action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
yarn build
touch out/.nojekyll

# deploy build to gh-pages
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: out
26 changes: 0 additions & 26 deletions .github/workflows/e2e.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm install -g yarn && yarn
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Build app
run: yarn build
env:
NEXT_PUBLIC_BASE_PATH: ""
NODE_ENV: production
- name: Run Playwright tests
run: yarn playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
19 changes: 0 additions & 19 deletions .github/workflows/preproduction.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/production.yaml

This file was deleted.

13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ name: Release
on:
workflow_dispatch:
push:
branches: [master, main, alpha, beta, next]
branches: [main, alpha, beta, next]

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: socialgouv/workflows/actions/semantic-release@v1
with:
github-token: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
author-name: ${{ secrets.SOCIALGROOVYBOT_NAME }}
author-email: ${{ secrets.SOCIALGROOVYBOT_EMAIL }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 0 additions & 16 deletions .github/workflows/review-auto.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/review.yaml

This file was deleted.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ robots.txt
!.yarn/versions

# storybook
/.out
/.out
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
9 changes: 5 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
exec < /dev/tty; yarn node-talisman --githook pre-commit -i
if sh -c ': >/dev/tty' >/dev/null 2>/dev/null; then
exec </dev/tty; yarn node-talisman --githook pre-commit -i;
else
yarn node-talisman --githook pre-commit;
fi
8 changes: 0 additions & 8 deletions .kontinuous/config.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions .kontinuous/env/prod/values.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions .kontinuous/values.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
18
Loading
Loading