Skip to content

Update test coverage - #241

Open
dkotter wants to merge 9 commits into
developfrom
dev/test-coverage
Open

dkotter wants to merge 9 commits into
developfrom
dev/test-coverage

Conversation

@dkotter

@dkotter dkotter commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Description of the Change

The E2E suite ran on Cypress against live Google ads, so it needed network access, waited in real time and couldn't simulate a broken refresh. PHPUnit ran on wp-env's deprecated tests-cli environment, and its only tests checked hook registration. Neither suite covered the rules the plugin actually enforces: how settings are sanitized, the exclusion data handed to frontend.js, the refresh cap or the refresh callback.

This PR moves E2E to Playwright and both suites to a separate .wp-env.test.json config, upgrades the toolchain, and replaces the old tests with behavior tests. E2E now serves a small GPT stub instead of Google's gpt.js and fast-forwards the page clock, so it runs offline in seconds. test.yml now runs PHPUnit on PHP 7.4–8.5 × WP 6.9/latest/trunk plus multisite, and E2E on WP 6.9/latest/trunk; cypress.yml is removed.

How to test the Change

Ensure all tests pass on this PR

Changelog Entry

Developer - Migrate E2E tests from Cypress to Playwright, update the test tooling to Node 26 and wp-env 12, and add PHPUnit and E2E coverage for settings sanitization, ad exclusions, the refresh cap and the refresh callback.

Credits

Props @dkotter

Checklist:

@dkotter dkotter added this to the 1.2.1 milestone Nov 24, 2026
@dkotter dkotter self-assigned this Nov 24, 2026
@dkotter
dkotter requested a review from jeffpaul as a code owner November 24, 2026 23:17
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.

1 participant