Skip to content

Commit

Permalink
chore: add e2e testing suite using Playwright (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesLMilner committed Dec 23, 2023
1 parent 0407295 commit 05c00d9
Show file tree
Hide file tree
Showing 13 changed files with 4,311 additions and 3 deletions.
32 changes: 31 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
tests:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -24,7 +24,37 @@ jobs:
run: git diff --exit-code
- name: Build
run: npm run build

unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node
uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Install Parent Folder
run: npm install
- name: Test
run: npm run test
env:
CI: true

e2e-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Install Parent Folder
run: npm install
- name: Change to E2E test folder
run: cd ./e2e
- name: Install e2e test
run: npm install
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm run test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ scratch/
.env*
!.env.example
.DS_Store
e2e/test-results/
e2e/playwright-report/
e2e/blob-report/
e2e/playwright/.cache/
25 changes: 25 additions & 0 deletions e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# E2E Testing with Playwright

We provide a basic end-to-end (E2E) via Playwright, testing against the Leaflet Adapter

## Installation

Installation can be down via npm like so:

```shell
npm install
```

## Running

You can run the tests headless (i.e. no opening of Chromimum) like so:

```shell
npm run test
```

Or you can run them headed (i.e. Chromimum will open and you will see the tests run) like so:

```shell
npm run test:headed
```
Loading

0 comments on commit 05c00d9

Please sign in to comment.