Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Add wp-env for e2e tests #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
43 changes: 43 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: E2E Tests

on:
push:
branches:
- main
pull_request:

jobs:
e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 15
cache: npm

- name: Install dependencies
run: npm ci

- name: Build plugin
run: npm run build

- name: Install WordPress
run: |
chmod -R 767 ./ # TODO: Possibly integrate in wp-env
npm run wp-env start

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

- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@v3
if: always()
with:
name: failures-artifacts
path: artifacts
1 change: 1 addition & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
lint-js:
name: JS Lints
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
artifacts/
build/
node_modules/
vendor/
Expand Down
6 changes: 6 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"core": null,
"plugins": [
"."
]
}
Loading