Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaffold playwright tests #15

Merged
merged 31 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f07ca7e
Scaffold playwright tests
josephfusco Feb 7, 2024
5ded68f
Add wp-env dep
josephfusco Feb 7, 2024
dabff9a
Configure WP with required plugins
josephfusco Feb 7, 2024
222e3f8
Configured and passing tests
josephfusco Feb 7, 2024
6e6edb9
rename file
josephfusco Feb 7, 2024
0c79e87
Add helpers
josephfusco Feb 7, 2024
cd0eae7
Use test script instead of redefining commands
josephfusco Feb 8, 2024
86b9022
Test
josephfusco Feb 14, 2024
4b59541
scaffold unit tests
josephfusco Feb 14, 2024
0b82c40
Clean up workflow files
josephfusco Feb 14, 2024
bf21628
use v4 actions and cleanup
josephfusco Feb 14, 2024
0b1c409
Passing tests
josephfusco Feb 14, 2024
c9eb368
Use local wp-env
josephfusco Feb 14, 2024
99596cb
use ci
josephfusco Feb 14, 2024
92d1962
Install required browsers
josephfusco Feb 14, 2024
33f8ca6
Add browser definitions back
josephfusco Feb 14, 2024
e601d62
Add new line at EOF
josephfusco Feb 14, 2024
595f1d8
View more things
josephfusco Feb 14, 2024
c712a6d
Correct test name
josephfusco Feb 14, 2024
37048cc
Refactor E2E
josephfusco Feb 15, 2024
e0fb9a1
passing
josephfusco Feb 15, 2024
b4f2e7c
Update env command
josephfusco Feb 15, 2024
d3ecbae
utilize arguments for less abstraction
josephfusco Feb 15, 2024
aeb9eb3
Fix wp-env command in playwright callback
josephfusco Feb 19, 2024
ebb2acc
chore: update deps
josephfusco Feb 19, 2024
9f4cee6
Use WP tests
josephfusco Feb 19, 2024
aa9d9d5
Stop process once complete
josephfusco Feb 19, 2024
a2e02b0
- update docker-compose to 0.24.6 to help fix issue with tests not ru…
jasonbahl Feb 26, 2024
e15f259
Merge commit '7111f06e8ba48b0827829a7930aaae2a4d4d9095' into setup-tests
jasonbahl Feb 26, 2024
9eb0dfc
- add the 2nd test (previously only 1 test would pass in the GitHub w…
jasonbahl Feb 26, 2024
be69cdb
no message
jasonbahl Feb 26, 2024
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
44 changes: 44 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: E2E Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
e2e-tests:
name: E2E tests on Node ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18']
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Build Assets
run: npm run build

- name: Install Playwright dependencies
run: |
npx playwright install chromium firefox webkit --with-deps

- name: Start WordPress Environment
run: npm run wp-env -- start

- name: Run E2E tests
run: npm run test:e2e

- name: Stop WordPress Environment
run: npm run wp-env -- stop
4 changes: 2 additions & 2 deletions .github/workflows/release-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
node-version: [20]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Unit Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
unit-tests:
name: Unit tests on Node ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18', '20']
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Run Unit tests
run: npm run test:unit
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ artifacts
build/
wpgraphql-ide/
wpgraphql-ide.zip
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
12 changes: 12 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"core": "WordPress/WordPress",
"plugins": [
".",
"https://downloads.wordpress.org/plugin/wp-graphql.zip"
],
"themes": [],
"port": 8888,
"config": {
"WP_DEBUG": true
}
}
Loading
Loading