Skip to content

Commit

Permalink
E2E tests with cypress (#802)
Browse files Browse the repository at this point in the history
This PR:

* Adds end-to-end (E2E) tests using Cypress to cover critical features
in the WordPress playground.
* Adds these e2e tests to GitHub CI workflows for every PR

Depends on #801
Closes #765

The E2E tests cover:

- Switching PHP versions
- Switching WordPress versions  
- Networking support
- PHP extensions support
- Seamless mode
- OPFS synchronization in the browser
- "None" storage mode

The tests interact with the playground through:

- The Query API
- The user interface

This provides automated testing for the core functionality identified in
#765.

Additional tests will be tracked in follow-up issues:

- Connecting PlaygroundClient to the remote.html API
- OPFS synchronization with local filesystem  
- GitHub integration
- WordPress PR previewer
- Gutenberg PR previewer

<img width="2004" alt="CleanShot 2023-11-26 at 01 01 21@2x"
src="https://github.com/WordPress/wordpress-playground/assets/205419/e2353096-bbad-4fb9-a293-ea52fac14f05">
  • Loading branch information
adamziel authored Nov 27, 2023
1 parent bb9d796 commit e034518
Show file tree
Hide file tree
Showing 21 changed files with 2,507 additions and 15 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,21 @@ jobs:
- uses: ./.github/actions/prepare-playground
- run: npx nx affected --target=lint
- run: npx nx affected --target=typecheck
test:
test-unit:
runs-on: ubuntu-latest
needs: [lint-and-typecheck]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare-playground
- run: node --expose-gc node_modules/nx/bin/nx affected --target=test --configuration=ci
test-e2e:
runs-on: ubuntu-latest
needs: [lint-and-typecheck]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare-playground
- run: ./node_modules/.bin/cypress install --force
- run: npx nx affected --target=e2e --configuration=ci
build:
runs-on: ubuntu-latest
needs: [lint-and-typecheck]
Expand All @@ -40,7 +48,7 @@ jobs:
deploy_docs:
if: github.ref == 'refs/heads/trunk' && github.event_name == 'push'
# Add a dependency to the build job
needs: [test, build]
needs: [test-unit, test-e2e, build]
name: 'Deploy doc site'

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
Expand Down
Loading

0 comments on commit e034518

Please sign in to comment.