Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
776c09c
Tests: Move Check Select Order
n7studios Mar 13, 2026
e601809
Merge branch 'main' into tests-move-check-select-order
n7studios Mar 13, 2026
b5f6beb
Move test
n7studios Mar 19, 2026
7984201
Fix tests
n7studios Mar 19, 2026
b256498
Tests: Improve Reliability of Divi Tests
n7studios Mar 19, 2026
43378d2
Divi 4: Detect Welcome Modal and dismiss, instead of waiting 5 seconds
n7studios Mar 19, 2026
5bf35e5
Run Divi Tests in PHP 8.1 only to check results
n7studios Mar 19, 2026
4a4ea1b
Conditionally dismiss modal
n7studios Mar 19, 2026
21835fd
Exit Divi 5 Builder instead of trying to use the dropdown
n7studios Mar 19, 2026
762ad37
Reinstate all tests
n7studios Mar 19, 2026
cba40d4
Merge remote-tracking branch 'origin/improve-divi-test-reliability' i…
n7studios Mar 19, 2026
974644c
Use a more reliable method of fetching current URL
n7studios Mar 19, 2026
71f0c0a
Merge remote-tracking branch 'origin/improve-divi-test-reliability' i…
n7studios Mar 19, 2026
d2318ac
Publishing: Wait for panel to be visible, not button
n7studios Mar 19, 2026
77eeb9e
Merge remote-tracking branch 'origin/improve-divi-test-reliability' i…
n7studios Mar 19, 2026
bc0fb9e
Try another method to detect pre-publish actions
n7studios Mar 19, 2026
3a7fe9e
Revert publish panel check
n7studios Mar 19, 2026
625cc87
Use Classic Editor for Divi 5 Tests
n7studios Mar 19, 2026
475ace1
Revert clickPublishOnPrePublishChecksForGutenbergPage
n7studios Mar 19, 2026
1c2955a
Change method of creating page for Divi 5 tests
n7studios Mar 19, 2026
7deeece
Remove skipped tests
n7studios Mar 19, 2026
c4ea613
Merge remote-tracking branch 'origin/improve-divi-test-reliability' i…
n7studios Mar 19, 2026
6a69c83
Merge pull request #1043 from Kit/tests-move-check-select-order
n7studios Mar 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions tests/EndToEnd/forms/general/CategoryFormCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@ public function testAddCategoryWithValidFormSetting(EndToEndTester $I)
value: $_ENV['CONVERTKIT_API_FORM_NAME']
);

// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);

// Save.
$I->click('input#submit');

Expand Down Expand Up @@ -117,16 +107,6 @@ public function testAddCategoryWithNoneFormSetting(EndToEndTester $I)
value: 'None'
);

// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);

// Save.
$I->click('input#submit');

Expand Down Expand Up @@ -192,16 +172,6 @@ public function testEditCategoryWithValidFormSetting(EndToEndTester $I)
// Confirm that settings have label[for] attributes.
$I->seeInSource('<label for="wp-convertkit-form">');

// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);

// Change Form to value specified in the .env file.
$I->fillSelect2Field(
$I,
Expand Down Expand Up @@ -264,16 +234,6 @@ public function testEditCategoryWithNoneFormSetting(EndToEndTester $I)
// Confirm that settings have label[for] attributes.
$I->seeInSource('<label for="wp-convertkit-form">');

// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);

// Change Form to None.
$I->fillSelect2Field(
$I,
Expand Down Expand Up @@ -460,16 +420,6 @@ public function testEditCategoryWithFormPositionBefore(EndToEndTester $I)
// Confirm that settings have label[for] attributes.
$I->seeInSource('<label for="wp-convertkit-form">');

// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);

// Change Form to value specified in the .env file.
$I->fillSelect2Field(
$I,
Expand Down Expand Up @@ -542,16 +492,6 @@ public function testEditCategoryWithFormPositionAfter(EndToEndTester $I)
// Confirm that settings have label[for] attributes.
$I->seeInSource('<label for="wp-convertkit-form">');

// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);

// Change Form to value specified in the .env file.
$I->fillSelect2Field(
$I,
Expand Down
10 changes: 0 additions & 10 deletions tests/EndToEnd/forms/post-types/CPTFormCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,6 @@ public function testAddNewCPTUsingDefaultFormWithNoDefaultFormSpecifiedInPlugin(
title: 'Kit: CPT: Form: Default: None'
);

// Check the order of the Form resources are alphabetical, with the Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
'#wp-convertkit-form',
[
'Default',
'None',
]
);

// Publish and view the CPT on the frontend site.
$I->publishAndViewGutenbergPage($I);

Expand Down
10 changes: 0 additions & 10 deletions tests/EndToEnd/forms/post-types/PageFormCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@ public function testAddNewPageUsingDefaultFormWithNoDefaultFormSpecifiedInPlugin
title: 'Kit: Page: Form: Default: None'
);

// Check the order of the Form resources are alphabetical, with the Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);

// Publish and view the Page on the frontend site.
$I->publishAndViewGutenbergPage($I);

Expand Down
10 changes: 0 additions & 10 deletions tests/EndToEnd/forms/post-types/PostFormCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@ public function testAddNewPostUsingDefaultFormWithNoDefaultFormSpecifiedInPlugin
title: 'Kit: Post: Form: Default: None'
);

// Check the order of the Form resources are alphabetical, with the Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);

// Publish and view the Post on the frontend site.
$I->publishAndViewGutenbergPage($I);

Expand Down
210 changes: 210 additions & 0 deletions tests/EndToEnd/general/other/SelectOptionOrderCest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
<?php

namespace Tests\EndToEnd;

use Tests\Support\EndToEndTester;

/**
* Tests for the order of resources in select elements.
*
* @since 3.3.0
*/
class SelectOptionOrderCest
{
/**
* Run common actions before running the test functions in this class.
*
* @since 3.3.0
*
* @param EndToEndTester $I Tester.
*/
public function _before(EndToEndTester $I)
{
// Activate and Setup Kit plugin.
$I->activateKitPlugin($I);
$I->activateThirdPartyPlugin($I, 'classic-editor');
$I->setupKitPlugin($I);
$I->setupKitPluginResources($I);

// Create Custom Post Types using the Custom Post Type UI Plugin.
$I->registerCustomPostTypes($I);
}

/**
* Test that the order of the Form resources are alphabetical, with the Default and None options prepending the Forms,
* when adding a new Category.
*
* @since 3.3.0
*
* @param EndToEndTester $I Tester.
*/
public function testFormSelectOrderOnAddCategory(EndToEndTester $I)
{
// Navigate to Posts > Categories.
$I->amOnAdminPage('edit-tags.php?taxonomy=category');

// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);
}

/**
* Test that the order of the Form resources are alphabetical, with the Default and None options prepending the Forms,
* when editing a Category.
*
* @since 3.3.0
*
* @param EndToEndTester $I Tester.
*/
public function testFormSelectOrderOnEditCategory(EndToEndTester $I)
{
// Create Category.
$termID = $I->haveTermInDatabase( 'Kit: Edit Category', 'category' );
$termID = $termID[0];

// Edit the Term.
$I->amOnAdminPage('term.php?taxonomy=category&tag_ID=' . $termID);

// Check the order of the Form resources are alphabetical, with the Default option prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);
}

/**
* Test that the order of the Form resources are alphabetical, with the Default and None options prepending the Forms,
* when Pages, Posts and Custom Post Types (CPTs) are added.
*
* @since 3.3.0
*
* @param EndToEndTester $I Tester.
*/
public function testFormSelectOrderOnPostTypes(EndToEndTester $I)
{
// Navigate to Pages > Add New.
$I->amOnAdminPage('post-new.php?post_type=page');

// Check the order of the Form resources are alphabetical, with the Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);

// Check the order of the Landing Page resources are alphabetical, with the None option prepending the Landing Pages.
$I->checkSelectLandingPageOptionOrder(
$I,
selectElement: '#wp-convertkit-landing_page',
prependOptions: [
'None',
]
);

// Check the order of the Tag resources are alphabetical, with the None option prepending the Tags.
$I->checkSelectTagOptionOrder(
$I,
selectElement: '#wp-convertkit-tag',
prependOptions: [
'None',
]
);

// Navigate to Posts > Add New.
$I->amOnAdminPage('post-new.php?post_type=post');

// Check the order of the Form resources are alphabetical, with the Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);

// Check the order of the Tag resources are alphabetical, with the None option prepending the Tags.
$I->checkSelectTagOptionOrder(
$I,
selectElement: '#wp-convertkit-tag',
prependOptions: [
'None',
]
);

// Navigate to Custom Post Type > Add New.
$I->amOnAdminPage('post-new.php?post_type=article');

// Check the order of the Form resources are alphabetical, with the Default and None options prepending the Forms.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#wp-convertkit-form',
prependOptions: [
'Default',
'None',
]
);

// Check the order of the Tag resources are alphabetical, with the None option prepending the Tags.
$I->checkSelectTagOptionOrder(
$I,
selectElement: '#wp-convertkit-tag',
prependOptions: [
'None',
]
);
}

/**
* Test that the order of the Form resources are alphabetical, with the None option prepending the Forms,
* when the Plugin Settings General screen is viewed.
*
* @since 3.3.0
*
* @param EndToEndTester $I Tester.
*/
public function testFormSelectOrderOnPluginSettingsGeneralScreen(EndToEndTester $I)
{
// Go to the Plugin's Settings Screen.
$I->loadKitSettingsGeneralScreen($I);

// Check the order of the Form resources are alphabetical, with 'None' as the first choice.
$I->checkSelectFormOptionOrder(
$I,
selectElement: '#_wp_convertkit_settings_page_form',
prependOptions: [
'None',
]
);
}

/**
* Deactivate and reset Plugin(s) after each test, if the test passes.
* We don't use _after, as this would provide a screenshot of the Plugin
* deactivation and not the true test error.
*
* @since 3.3.0
*
* @param EndToEndTester $I Tester.
*/
public function _passed(EndToEndTester $I)
{
$I->unregisterCustomPostTypes($I);
$I->deactivateThirdPartyPlugin($I, 'classic-editor');
$I->deactivateKitPlugin($I);
$I->resetKitPlugin($I);
}
}
9 changes: 0 additions & 9 deletions tests/EndToEnd/general/other/UpgradePathsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,6 @@ public function testGetAccessTokenByAPIKeyAndSecret(EndToEndTester $I)
// Confirm the Plugin authorized by checking for a Disconnect button.
$I->see('Kit WordPress');
$I->see('Disconnect');

// Check the order of the Form resources are alphabetical, with 'None' as the first choice.
$I->checkSelectFormOptionOrder(
$I,
'#_wp_convertkit_settings_page_form',
[
'None',
]
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,6 @@ public function testValidCredentials(EndToEndTester $I)
$I->see('Disconnect');
$I->seeElementInDOM('input#submit');

// Check the order of the Form resources are alphabetical, with 'None' as the first choice.
$I->checkSelectFormOptionOrder(
$I,
'#_wp_convertkit_settings_page_form',
[
'None',
]
);

// Save Changes to confirm credentials are not lost.
$I->click('Save Changes');

Expand Down
Loading
Loading