From 9fe9cd55eb5321a527029b96780cbd360928479a Mon Sep 17 00:00:00 2001 From: hanna-meda <93833759+hanna-meda@users.noreply.github.com> Date: Thu, 16 Apr 2026 14:30:37 +0300 Subject: [PATCH 1/4] ensure clean imagify state before tagged smoke scenarios --- src/features/broken-links.feature | 2 +- src/features/delete-plugin.feature | 1 + src/features/enable-all-features.feature | 2 +- src/features/roll-back.feature | 2 +- src/features/self-host-google-fonts.feature | 2 +- src/features/settings-export-import.feature | 2 ++ src/support/hooks.ts | 9 +++++++++ 7 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/features/broken-links.feature b/src/features/broken-links.feature index 99d6d059..83a229c7 100644 --- a/src/features/broken-links.feature +++ b/src/features/broken-links.feature @@ -1,4 +1,4 @@ -@setup @smoke @brokenlinks +@setup @smoke @brokenlinks @requires-clean-imagify Feature: Broken links in WP Rocket settings UI Scenario: WP Rocket settings links are not broken diff --git a/src/features/delete-plugin.feature b/src/features/delete-plugin.feature index 4b1f3ace..c7784752 100644 --- a/src/features/delete-plugin.feature +++ b/src/features/delete-plugin.feature @@ -10,6 +10,7 @@ Feature: C4466 - Should successfully delete the plugin Then plugin should delete successfully But I must not see any error in debug.log + @requires-clean-imagify Scenario: WP Rocket is installed and activated Given plugin is installed 'new_release' And plugin is activated diff --git a/src/features/enable-all-features.feature b/src/features/enable-all-features.feature index 436c7c20..1a4187b6 100644 --- a/src/features/enable-all-features.feature +++ b/src/features/enable-all-features.feature @@ -1,4 +1,4 @@ -@smoke @local @setup +@smoke @local @setup @requires-clean-imagify Feature: C1205 - Enabling all WP Rocket features should not throw any fatal errors Background: diff --git a/src/features/roll-back.feature b/src/features/roll-back.feature index 1a6e557c..af0f105e 100644 --- a/src/features/roll-back.feature +++ b/src/features/roll-back.feature @@ -1,4 +1,4 @@ -@smoke @local @setup +@smoke @local @setup @requires-clean-imagify Feature: C11856 - Should roll back to the last previous major version when using the roll back functionality Background: diff --git a/src/features/self-host-google-fonts.feature b/src/features/self-host-google-fonts.feature index df38a945..bf9d2d1a 100644 --- a/src/features/self-host-google-fonts.feature +++ b/src/features/self-host-google-fonts.feature @@ -1,4 +1,4 @@ -@smoke @selfhostgooglefonts @setup +@smoke @selfhostgooglefonts @setup @requires-clean-imagify Feature: Google Fonts are self-hosted diff --git a/src/features/settings-export-import.feature b/src/features/settings-export-import.feature index 25b09f88..8b42b2e0 100644 --- a/src/features/settings-export-import.feature +++ b/src/features/settings-export-import.feature @@ -4,6 +4,7 @@ Feature: C2148 - Should not change the content of existing fields Background: Given I am logged in + @requires-clean-imagify Scenario: Data imported correctly Given plugin is installed 'previous_stable' And plugin is activated @@ -39,6 +40,7 @@ Feature: C2148 - Should not change the content of existing fields And I am logged in Then I must not see any error in debug.log + @requires-clean-imagify Scenario: Should not change enabled fields with update Given plugin is installed 'previous_stable' And plugin is activated diff --git a/src/support/hooks.ts b/src/support/hooks.ts index 76430cbc..4657306a 100644 --- a/src/support/hooks.ts +++ b/src/support/hooks.ts @@ -90,6 +90,15 @@ BeforeAll(async function (this: ICustomWorld) { } }); +/** + * Before each smoke scenario requiring a clean environment, ensures Imagify is not installed. + */ +Before({ tags: '@smoke and @requires-clean-imagify and not @imagify-compatibility' }, async function (this: ICustomWorld): Promise { + if (await isPluginInstalled('imagify')) { + await uninstallPlugin('imagify'); + } +}); + /** * Before each test scenario without the @setup tag, performs setup tasks. */ From 8bc813e08bfb1547318a6a88152e216f212008d3 Mon Sep 17 00:00:00 2001 From: hanna-meda <93833759+hanna-meda@users.noreply.github.com> Date: Thu, 16 Apr 2026 15:42:26 +0300 Subject: [PATCH 2/4] remove redundant Imagify install check before uninstall Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/support/hooks.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/support/hooks.ts b/src/support/hooks.ts index 4657306a..f05afc67 100644 --- a/src/support/hooks.ts +++ b/src/support/hooks.ts @@ -94,9 +94,7 @@ BeforeAll(async function (this: ICustomWorld) { * Before each smoke scenario requiring a clean environment, ensures Imagify is not installed. */ Before({ tags: '@smoke and @requires-clean-imagify and not @imagify-compatibility' }, async function (this: ICustomWorld): Promise { - if (await isPluginInstalled('imagify')) { - await uninstallPlugin('imagify'); - } + await uninstallPlugin('imagify'); }); /** From 21108f803bc7778ab500724d56c8b92655efd809 Mon Sep 17 00:00:00 2001 From: hanna-meda <93833759+hanna-meda@users.noreply.github.com> Date: Thu, 16 Apr 2026 15:57:24 +0300 Subject: [PATCH 3/4] remove smoke tag from the hook expression Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/support/hooks.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/support/hooks.ts b/src/support/hooks.ts index f05afc67..0f0d7da5 100644 --- a/src/support/hooks.ts +++ b/src/support/hooks.ts @@ -91,9 +91,9 @@ BeforeAll(async function (this: ICustomWorld) { }); /** - * Before each smoke scenario requiring a clean environment, ensures Imagify is not installed. + * Before each scenario tagged with @requires-clean-imagify, ensures Imagify is not installed. */ -Before({ tags: '@smoke and @requires-clean-imagify and not @imagify-compatibility' }, async function (this: ICustomWorld): Promise { +Before({ tags: '@requires-clean-imagify and not @imagify-compatibility' }, async function (this: ICustomWorld): Promise { await uninstallPlugin('imagify'); }); From c9b1f0d961af45d78adcc82d81b8c3f1b31c6406 Mon Sep 17 00:00:00 2001 From: hanna-meda <93833759+hanna-meda@users.noreply.github.com> Date: Thu, 16 Apr 2026 16:25:06 +0300 Subject: [PATCH 4/4] update comment Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/support/hooks.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/support/hooks.ts b/src/support/hooks.ts index 0f0d7da5..2f4a0398 100644 --- a/src/support/hooks.ts +++ b/src/support/hooks.ts @@ -91,7 +91,8 @@ BeforeAll(async function (this: ICustomWorld) { }); /** - * Before each scenario tagged with @requires-clean-imagify, ensures Imagify is not installed. + * 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 { await uninstallPlugin('imagify');