Skip to content
Merged
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
27 changes: 27 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the upload for? I guess it's an HTML coverage report? does it also print that to stdout in the previous step? or is there some other magic, e.g. like coveralls (adds a PR comment with a detailed coverage report, see nilsnolde/valhalla-qgis-plugin#31 (comment)) or codecov (adds check items in the PR and annotates the "Changed files" tab) to get a coverage report?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

playwright generates an html after every run and gives you a chance to preview what happened while running the test. however, I configure it to generate the images and videos only if something went wrong while running the test. this will be very useful when something passed on your local, but failed on CI. more info here.

for features like coveralls or codecov, I believe we can setup something like playwright-report-comment.

if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ yarn.lock
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Playwright
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ Builds and bundles the minified app for production to the `./build` folder.

Your app is ready to be deployed!

## Testing

This project includes end-to-end tests using [Playwright](https://playwright.dev/) to ensure the application works correctly across different scenarios.

### Running Tests

```bash
# Run all e2e tests in headless mode
npm run test:e2e

# Run tests with visible browser (useful for debugging)
npm run test:e2e:headed

# Open Playwright Test UI for interactive testing
npm run test:e2e:ui
```

Tests automatically start the development server if it's not already running.

## Get started with Docker
```bash
git clone https://github.com/nilsnolde/valhalla-app.git
Expand Down
Loading
Loading