Skip to content

Commit

Permalink
feat: add playwright GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed Oct 26, 2024
1 parent e3ab1f0 commit 865a085
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/test-e2e-playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: E2E Tests Playwright
on:
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
sha:
type: string
required: false
description: Target SHA

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name != 'workflow_dispatch' }}
- uses: actions/checkout@v4
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
ref: ${{ github.event.inputs.sha }}
- name: Setup node environment
uses: ./.github/actions/init-env-node
- name: Install Playwright Browsers
run: cd apps/web && pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec turbo run test:e2e:playwright
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E Tests
name: E2E Tests Webdriver
on:
pull_request:
branches: [master]
Expand All @@ -11,7 +11,7 @@ on:

jobs:
test:
name: Run WebdriverIO Tests
name: Run Tests
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"prepare": "svelte-kit sync",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"test:e2e": "playwright test"
"test:e2e:playwright": "playwright test"
},
"devDependencies": {
"@fontsource/fira-mono": "^4.5.10",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"package": "turbo run package",
"test": "turbo run test --no-daemon",
"test:watch": "pnpm --filter @gitbutler/desktop run test:watch",
"test:e2e:web": "turbo run test:e2e:web",
"test:e2e": "pnpm --filter @gitbutler/desktop run test:e2e",
"act:test:e2e": "act -j test -W .github/workflows/test-e2e.yml -P catthehacker/ubuntu:act-22.04",
"build": "turbo run build --no-daemon",
Expand Down
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"test": {
"dependsOn": ["package", "playwright:install"]
},
"test:e2e:web": {
"dependsOn": ["package"]
},
"//#globallint": {
"dependsOn": ["@gitbutler/ui#package", "@gitbutler/shared#package"]
}
Expand Down

0 comments on commit 865a085

Please sign in to comment.