Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
n7studios committed Nov 25, 2024
1 parent 51efc82 commit 0a7d4a6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/_support/Helper/Acceptance/WPCron.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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');
Expand All @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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');
}

/**
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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');
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/landing-pages/PageLandingPageCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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');
}

/**
Expand Down

0 comments on commit 0a7d4a6

Please sign in to comment.