Skip to content

E2E Tests

E2E Tests #2001

Workflow file for this run

name: E2E Tests
on:
push:
branches:
- "release/**"
pull_request:
branches:
- "release/**"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
E2ETests:
name: E2E Tests
runs-on: ubuntu-latest
env:
FORCE_COLOR: 2
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare PHP
uses: woocommerce/grow/prepare-php@actions-v1
with:
install-deps: "no"
- name: Prepare node
uses: woocommerce/grow/prepare-node@actions-v1
with:
node-version-file: ".nvmrc"
ignore-scripts: "no"
- name: Build production bundle
run: |
echo "::group::Build log"
npm run build
echo "::endgroup::"
- name: Start wp-env container
run: npm run wp-env:up
- name: Download and install Chromium browser.
run: npx playwright install chromium
- name: Run tests
run: npm run test:e2e
- name: Archive e2e failure screenshots
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: e2e-screenshots
path: tests/e2e/test-results/report/**/*.png
if-no-files-found: ignore
retention-days: 5