Conversation
There was a problem hiding this comment.
Pull request overview
Adds a tag-scoped Cucumber Before hook to ensure certain smoke scenarios run with a clean state by removing the Imagify plugin when present, aligning smoke runs with the failure mode described in issue #336 / wp-rocket#7991.
Changes:
- Added a new
Beforehook insrc/support/hooks.tsscoped to@smoke+@requires-clean-imagifyscenarios to uninstall Imagify. - Introduced the
@requires-clean-imagifytag on selected smoke scenarios/features that need this precondition. - Scoped the hook to exclude
@imagify-compatibilityscenarios.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/support/hooks.ts |
Adds tag-scoped precondition hook to uninstall Imagify before selected smoke scenarios. |
src/features/settings-export-import.feature |
Tags specific smoke scenarios to require clean Imagify state. |
src/features/self-host-google-fonts.feature |
Tags feature to require clean Imagify state during smoke run. |
src/features/roll-back.feature |
Tags feature to require clean Imagify state during smoke run. |
src/features/enable-all-features.feature |
Tags feature to require clean Imagify state during smoke run. |
src/features/delete-plugin.feature |
Tags one scenario to require clean Imagify state during smoke run. |
src/features/broken-links.feature |
Tags feature to require clean Imagify state during smoke run. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a tag-scoped Cucumber precondition to ensure Imagify is uninstalled before specific smoke scenarios, improving smoke-test reliability for cases where Imagify’s presence can trigger WP Rocket debug.log errors (per #336 / wp-rocket#7991).
Changes:
- Added a
Beforehook scoped to@smoke+@requires-clean-imagify(excluding@imagify-compatibility) that uninstalls Imagify. - Tagged selected smoke scenarios/features with
@requires-clean-imagifyto opt into the new precondition. - Expanded coverage of “clean Imagify state” across multiple smoke paths (settings visits, enable-all, rollback, broken links, export/import).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/support/hooks.ts |
Adds a tag-scoped Before hook that uninstalls Imagify for selected smoke scenarios. |
src/features/settings-export-import.feature |
Tags two scenarios to require a clean Imagify state. |
src/features/self-host-google-fonts.feature |
Tags the smoke feature to require a clean Imagify state. |
src/features/roll-back.feature |
Tags the smoke feature to require a clean Imagify state. |
src/features/enable-all-features.feature |
Tags the smoke feature to require a clean Imagify state. |
src/features/delete-plugin.feature |
Tags the “installed and activated” scenario to require a clean Imagify state. |
src/features/broken-links.feature |
Tags the smoke feature to require a clean Imagify state. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a tag-scoped Cucumber Before hook to ensure a clean environment (Imagify uninstalled) for selected smoke scenarios, so smoke runs can better surface WP Rocket debug.log errors like the one described in #336 / wp-rocket#7991.
Changes:
- Added a new
Beforehook scoped to@requires-clean-imagifyscenarios to uninstall Imagify (while excluding@imagify-compatibility). - Tagged selected smoke scenarios/features with
@requires-clean-imagifyso the precondition runs only where needed.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/support/hooks.ts | Adds the tag-scoped precondition hook to uninstall Imagify for selected scenarios. |
| src/features/settings-export-import.feature | Tags two scenarios to enforce a clean Imagify state before running them. |
| src/features/self-host-google-fonts.feature | Tags the smoke feature to enforce a clean Imagify state. |
| src/features/roll-back.feature | Tags the smoke feature to enforce a clean Imagify state. |
| src/features/enable-all-features.feature | Tags the smoke feature to enforce a clean Imagify state. |
| src/features/delete-plugin.feature | Tags the “installed and activated” scenario to enforce a clean Imagify state. |
| src/features/broken-links.feature | Tags the smoke feature to enforce a clean Imagify state. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| * Before each scenario tagged with @requires-clean-imagify, except those also tagged with | ||
| * @imagify-compatibility, ensures Imagify is not installed. | ||
| */ | ||
| Before({ tags: '@requires-clean-imagify and not @imagify-compatibility' }, async function (this: ICustomWorld): Promise<void> { |
There was a problem hiding this comment.
if we need this run before smoke test , why not just use @smoke instead of @requires-clean-imagify?
There was a problem hiding this comment.
@Mai-Saad, I used requires-clean-imagify so this hook can be reused beyond smoke. It is currently applied only in smoke, but the precondition itself is not smoke-specific.


Description
Fixes #336
This PR adds a new precondition hook that uninstalls Imagify when present for selected smoke tests.
Type of change
Detailed scenario
What was tested
npm run test:smokewith wpr 3.20.3 to make sure the error described in PHP Warning: Undefined array key "svg" when validate license after being unbanned wp-rocket#7991 is now caught through smoke tests.How to test
Run
npm run test:smokewith wpr 3.20.3 asnew_release. Expected: Smoke tests that install the plugin and visit settings fail, with an error in debug.log.Affected Features & Quality Assurance Scope
Technical description
Documentation
Added a new tag-scoped Before hook for selected smoke scenarios.
Hook checks whether Imagify is installed and uninstalls it if present.
Scope is limited using tag expression to avoid impacting unrelated scenarios.
New dependencies
None.
Risks
Extra setup time for tagged scenarios if Imagify is installed.
Tag drift if future smoke scenarios need the same precondition but are not tagged.
Mitigations:
Hook is narrowly scoped via tags.
Mandatory Checklist
Code validation
Code style
Unticked items justification
N/A
Additional Checks