woocommerce/plugins/woocommerce-blocks/.github/workflows/playwright.yml

62 lines
1.8 KiB
YAML
Raw Normal View History

name: Playwright Tests
on:
push:
Add PHP 8.1/8.2 to unit testing matrix (https://github.com/woocommerce/woocommerce-blocks/pull/8757) * Added PHP 8.1 to unit testing matrix * Refactor unit testing to match Gutenberg repo 🤞 * Removed Gutenberg reference from debug information * Updated image running phpunit binary * Reverted image running phpunit binary * Remove composer platform override * Bump @wordpress/env and include phpunit * Update phpunit and tests * Change prefix * Try admin context when install wc * try wc install * adjust phpunit config file * Updated phpunit.xml.dist, composer.json and package.json * Added PHP 8.1 to unit testing matrix * Refactor unit testing to match Gutenberg repo 🤞 * Removed Gutenberg reference from debug information * Updated image running phpunit binary * Reverted image running phpunit binary * Remove composer platform override * Bump @wordpress/env and include phpunit * Update phpunit and tests * Change prefix * Try admin context when install wc * try wc install * adjust phpunit config file * Updated phpunit.xml.dist, composer.json and package.json * Revert install changes * updated npm packages * updated composer lock * updated check assets flow * Updated check assets flow. Yaml file auto formatted. * Updated check assets flow. * Attempt at fixing E2E * Reverted setup permissions step * Add logging information to E2E * Reverted E2E test flow * test playwright perms fix * test e2e perms fix * test e2e perms fix * test e2e perms fix * test e2e perms fix * languages update & debug * languages update & debug * revert * force "@wordpress/env": "^4.9.0" on E2E * update package lock * update package lock --------- Co-authored-by: Mike Jolley <mike.jolley@me.com> Co-authored-by: Niels Lange <info@nielslange.de>
2023-04-21 11:07:37 +00:00
branches: [ trunk ]
pull_request:
jobs:
PlaywrightE2ETests:
name: Playwright E2E tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
Add PHP 8.1/8.2 to unit testing matrix (https://github.com/woocommerce/woocommerce-blocks/pull/8757) * Added PHP 8.1 to unit testing matrix * Refactor unit testing to match Gutenberg repo 🤞 * Removed Gutenberg reference from debug information * Updated image running phpunit binary * Reverted image running phpunit binary * Remove composer platform override * Bump @wordpress/env and include phpunit * Update phpunit and tests * Change prefix * Try admin context when install wc * try wc install * adjust phpunit config file * Updated phpunit.xml.dist, composer.json and package.json * Added PHP 8.1 to unit testing matrix * Refactor unit testing to match Gutenberg repo 🤞 * Removed Gutenberg reference from debug information * Updated image running phpunit binary * Reverted image running phpunit binary * Remove composer platform override * Bump @wordpress/env and include phpunit * Update phpunit and tests * Change prefix * Try admin context when install wc * try wc install * adjust phpunit config file * Updated phpunit.xml.dist, composer.json and package.json * Revert install changes * updated npm packages * updated composer lock * updated check assets flow * Updated check assets flow. Yaml file auto formatted. * Updated check assets flow. * Attempt at fixing E2E * Reverted setup permissions step * Add logging information to E2E * Reverted E2E test flow * test playwright perms fix * test e2e perms fix * test e2e perms fix * test e2e perms fix * test e2e perms fix * languages update & debug * languages update & debug * revert * force "@wordpress/env": "^4.9.0" on E2E * update package lock * update package lock --------- Co-authored-by: Mike Jolley <mike.jolley@me.com> Co-authored-by: Niels Lange <info@nielslange.de>
2023-04-21 11:07:37 +00:00
- uses: actions/checkout@v3
with:
ref: trunk
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup node version and npm cache
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install Node dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install --no-optional --no-audit
- name: Load wp-env
run: npm run env:start --update
- name: Fix permissions # We need to figure this out https://github.com/WordPress/gutenberg/issues/22515#issuecomment-1308346256
run: |
WP_ENV_DIR=$(npm run wp-env install-path --silent 2>&1 | head -1)
cd $WP_ENV_DIR
mkdir -p tests-WordPress/wp-content/languages tests-WordPress/wp-content/upgrade
chmod -R 767 tests-WordPress/wp-content/languages tests-WordPress/wp-content/upgrade
cd -
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test --config=tests/e2e-pw/playwright.config.ts
- uses: actions/upload-artifact@v3
with:
name: playwright-report
path: playwright-report/
retention-days: 30