From 0a7d4a64224847645e9def5902b9d59f88fd0a86 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 25 Nov 2024 17:34:55 +0800 Subject: [PATCH] Fix tests --- tests/_support/Helper/Acceptance/WPCron.php | 13 +++++++++++-- .../blocks-shortcodes/PageShortcodeFormCest.php | 4 ++++ .../landing-pages/PageLandingPageCest.php | 2 ++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/_support/Helper/Acceptance/WPCron.php b/tests/_support/Helper/Acceptance/WPCron.php index 7114632a..f92f4834 100644 --- a/tests/_support/Helper/Acceptance/WPCron.php +++ b/tests/_support/Helper/Acceptance/WPCron.php @@ -9,6 +9,15 @@ */ class WPCron extends \Codeception\Module { + /** + * Holds the admin UI URL for WP Crontrol. + * + * @since 2.6.6 + * + * @var string + */ + private $adminURL = 'tools.php?page=wp-crontrol'; + /** * Asserts if the given event name is scheduled in WordPress' Cron. * @@ -49,7 +58,7 @@ public function dontSeeCronEvent($I, $name) public function runCronEvent($I, $name) { // List cron event in WP-Crontrol Plugin. - $I->amOnAdminPage('tools.php?page=crontrol_admin_manage_page&s=' . $name); + $I->amOnAdminPage($this->adminURL . '&s=' . $name); // Hover mouse over event's name. $I->moveMouseOver('#the-list tr'); @@ -74,7 +83,7 @@ public function runCronEvent($I, $name) public function deleteCronEvent($I, $name) { // List cron event in WP-Crontrol Plugin. - $I->amOnAdminPage('tools.php?page=crontrol_admin_manage_page&s=' . $name); + $I->amOnAdminPage($this->adminURL . '&s=' . $name); // Hover mouse over event's name. $I->moveMouseOver('#the-list tr'); diff --git a/tests/acceptance/forms/blocks-shortcodes/PageShortcodeFormCest.php b/tests/acceptance/forms/blocks-shortcodes/PageShortcodeFormCest.php index 6e029610..f70beb45 100644 --- a/tests/acceptance/forms/blocks-shortcodes/PageShortcodeFormCest.php +++ b/tests/acceptance/forms/blocks-shortcodes/PageShortcodeFormCest.php @@ -655,6 +655,7 @@ public function testFormShortcodeWithPerfmattersPlugin(AcceptanceTester $I) $I->setupConvertKitPluginResources($I); // Activate Perfmatters Plugin. + $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->activateThirdPartyPlugin($I, 'perfmatters'); // Enable Defer and Delay JavaScript. @@ -700,6 +701,7 @@ public function testFormShortcodeWithPerfmattersPlugin(AcceptanceTester $I) // Deactivate Perfmatters Plugin. $I->deactivateThirdPartyPlugin($I, 'perfmatters'); + $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); } /** @@ -770,6 +772,7 @@ public function testFormShortcodeWithWPRocketPlugin(AcceptanceTester $I) $I->setupConvertKitPluginResources($I); // Activate WP Rocket Plugin. + $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->activateThirdPartyPlugin($I, 'wp-rocket'); // Configure WP Rocket. @@ -806,6 +809,7 @@ public function testFormShortcodeWithWPRocketPlugin(AcceptanceTester $I) // Deactivate WP Rocket Plugin. $I->deactivateThirdPartyPlugin($I, 'wp-rocket'); + $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); } /** diff --git a/tests/acceptance/landing-pages/PageLandingPageCest.php b/tests/acceptance/landing-pages/PageLandingPageCest.php index 21d921b3..41160d05 100644 --- a/tests/acceptance/landing-pages/PageLandingPageCest.php +++ b/tests/acceptance/landing-pages/PageLandingPageCest.php @@ -328,6 +328,7 @@ public function testAddNewPageUsingDefinedLandingPageWithPerfmattersPlugin(Accep $I->setupConvertKitPluginResources($I); // Activate Perfmatters Plugin. + $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); $I->activateThirdPartyPlugin($I, 'perfmatters'); // Enable Lazy Loading. @@ -373,6 +374,7 @@ public function testAddNewPageUsingDefinedLandingPageWithPerfmattersPlugin(Accep // Deactivate Perfmatters Plugin. $I->deactivateThirdPartyPlugin($I, 'perfmatters'); + $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); } /**