Skip to content

Commit

Permalink
Dbp 618 ausfuehren der playwright tests fuer beliebige branches (#10)
Browse files Browse the repository at this point in the history
- add workflow_call
- set FRONTEND_URL frontendHostname if given
* Add manual dispatch description to README
* move env variable to correct job
  • Loading branch information
JannikBadenhop authored Feb 23, 2024
1 parent 774efd0 commit b5e0184
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
name: Playwright Tests
on:
workflow_call:
inputs:
frontendHostname:
type: string
description: 'Hostname of the frontend server (optional)'
required: false
workflow_dispatch:
inputs:
frontendHostname:
type: string
description: 'Hostname of the frontend server (optional)'
required: false
push:
branches: [ main ]
jobs:

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
Expand All @@ -16,6 +28,9 @@ jobs:
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: If input frontendHostname is given, set env variable
if: github.event.inputs.frontendHostname != ''
run: echo "FRONTEND_URL=https://${frontendHostname}/" >> $GITHUB_ENV
- name: Run Playwright tests
run: npx playwright test
env:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ npx playwright show-report results\results-2023-10-06T13_49_14_593
## Code-Generator starten:
npx playwright codegen https://test.dev.spsh.dbildungsplattform.de

## Code-Generator aus GHA starten:
Run workflow "Playwright Tests" with frontendHostname: test.dev.spsh.dbildungsplattform.de

## debug-mode:
git bash: PWDEBUG=1 npx playwright test login.spec.ts --headed

Expand Down

0 comments on commit b5e0184

Please sign in to comment.