Skip to content

Replace Cypress with Playwright in deploy-and-test workflow - #1121

Draft
GiuseppeArcifa wants to merge 13 commits into
developfrom
fix/deploy-and-test-workflow
Draft

Replace Cypress with Playwright in deploy-and-test workflow#1121
GiuseppeArcifa wants to merge 13 commits into
developfrom
fix/deploy-and-test-workflow

Conversation

@GiuseppeArcifa

Copy link
Copy Markdown
Contributor

Proposed changes

  • Switched the post-deploy E2E step in deploy-and-test.yml from Cypress to Playwright.
  • Added Playwright browser installation and test execution against the deployed remote site.
  • Updated Playwright config to support remote execution via BASE_URL and to skip globalSetup when targeting an external environment.

Type of Change

  • In .github/workflows/deploy-and-test.yml:
    • Replaced CYPRESS_TEST_PATH with PLAYWRIGHT_TEST_SPEC (tests/playwright/specs/help.spec.js).
    • Removed the Cypress GitHub Action step.
    • Added:
      • npx playwright install --with-deps chromium
      • npx playwright test ${{ env.PLAYWRIGHT_TEST_SPEC }} --reporter=line
      • artifact upload for tests/playwright/test-results/
    • Preserved all existing deploy steps (build, upload, SSH install/activate, health check).
  • In playwright.config.mjs:
    • baseURL now uses process.env.BASE_URL when provided, with localhost fallback.
    • globalSetup is disabled when BASE_URL is set, so remote runs do not execute wp-env setup commands.

Why

  • The deploy workflow runs tests against a remote WordPress environment after plugin deployment.
  • Cypress is no longer the target framework for these checks.
  • Playwright needed remote-aware configuration to avoid local wp-env assumptions during CI deploy validation.

Testing

  • Workflow validated for YAML merge conflicts and updated to a clean Playwright-only test path.
  • Suggested CI verification: trigger deploy-and-test.yml via workflow_dispatch and confirm:
    • browser install succeeds,
    • Playwright help spec runs against ${{ vars.SITE_URL }},
    • test artifacts are uploaded on completion/failure.

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Visual

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Comment thread .github/workflows/deploy-and-test.yml Fixed
@GiuseppeArcifa
GiuseppeArcifa changed the base branch from main to develop March 26, 2026 12:46
@github-actions

github-actions Bot commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

🎮 WordPress Playground Preview

▶️ Launch Preview in Playground

This spins up a fresh WordPress-in-browser, installs this PR's plugin build, and drops you straight into the Bluehost screen.


Preview Details

  • 📦 Build ZIP: bluehost-pr-1121.zip (8.1M)
  • 🗂️ Branch: fix/deploy-and-test-workflow
  • 📝 Commit: cd32c15
  • 🔗 Direct Download of ZIP

⚠ Every new commit / comment on this PR overwrites the preview ZIP for this PR number.

@github-actions

github-actions Bot commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Coverage: Base 25.7% → PR 25.7% (must not decrease).
✅ No decrease.

Code Coverage

project coverage report 25.7% @ cd32c15

* develop: (283 commits)
  Composer(deps): Bump newfold-labs/wp-module-mcp from 1.7.4 to 1.7.5
  NPM(deps): Bump @wordpress/api-fetch from 7.48.1 to 7.51.0
  NPM Dev(deps-dev): Bump @wordpress/scripts from 32.2.0 to 33.0.0
  Composer(deps): Bump newfold-labs/wp-module-ai-chat from 1.1.5 to 1.1.6
  Composer(deps): Bump newfold-labs/wp-module-next-steps
  Composer(deps): Bump newfold-labs/wp-module-onboarding-data
  Composer Dev(deps-dev): Bump wp-phpunit/wp-phpunit from 7.0.1 to 7.0.2
  NPM(deps): Bump html-react-parser from 6.1.2 to 6.1.5
  NPM(deps): Bump @wordpress/components from 33.1.0 to 37.0.0
  Composer Dev(deps-dev): Bump johnpbloch/wordpress from 7.0.1 to 7.0.2
  NPM(deps): Bump @wordpress/url from 4.50.0 to 4.51.0
  Composer(deps): Bump newfold-labs/wp-module-activation
  Use --skip-plugins when checking/deactivating dependent plugins
  update coming soon and ecom moudles - to use new e2e helpers for woo
  Fold WooCommerce install/uninstall helper into newfold.mjs
  Add shared WooCommerce install/uninstall test helper
  GitHub Actions(deps): Bump actions/checkout from 7.0.0 to 7.0.1
  validate composer lock file
  🤖 prep for release - 4.17.1 → 4.17.2
  bump newfold-labs/wp-module-onboarding-data
  ...

# Conflicts:
#	.github/workflows/deploy-and-test.yml
#	tests/playwright/global-setup.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants