From 2a5cacd266ab45b0ce0260e032271facb0025534 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Fri, 27 Mar 2026 18:36:50 +0800 Subject: [PATCH] Tests: Classic Editor: No Forms: Refactor --- .../post-types/ClassicEditorFormCest.php | 27 +++++++ .../forms/post-types/PageNoFormCest.php | 72 ------------------- 2 files changed, 27 insertions(+), 72 deletions(-) delete mode 100644 tests/EndToEnd/forms/post-types/PageNoFormCest.php diff --git a/tests/EndToEnd/forms/post-types/ClassicEditorFormCest.php b/tests/EndToEnd/forms/post-types/ClassicEditorFormCest.php index 4a0a083b5..d33f005d5 100644 --- a/tests/EndToEnd/forms/post-types/ClassicEditorFormCest.php +++ b/tests/EndToEnd/forms/post-types/ClassicEditorFormCest.php @@ -74,6 +74,33 @@ public function testAccessibility(EndToEndTester $I) } } + /** + * Test that UTM parameters are included in links displayed in the metabox for the user to sign in to + * their Kit account. + * + * @since 1.9.6 + * + * @param EndToEndTester $I Tester. + */ + public function testUTMParametersExist(EndToEndTester $I) + { + // Setup Kit plugin with no credentials or data. + $I->setupKitPluginCredentialsNoData($I); + $I->setupKitPluginResourcesNoData($I); + + // Navigate to Pages > Add New. + $I->amOnAdminPage('post-new.php?post_type=page'); + + // Check that no PHP warnings or notices were output. + $I->checkNoWarningsAndNoticesOnScreen($I); + + // Check that the metabox is displayed. + $I->seeElementInDOM('#wp-convertkit-meta-box'); + + // Confirm that UTM parameters exist for the 'sign in to Kit' link. + $I->seeInSource('sign in to Kit'); + } + /** * Test that the 'Default' option for the Default Form setting in the Plugin Settings works when * creating and viewing a new WordPress Page, Post or Article, and there is no Default Form specified in the Plugin diff --git a/tests/EndToEnd/forms/post-types/PageNoFormCest.php b/tests/EndToEnd/forms/post-types/PageNoFormCest.php deleted file mode 100644 index f0474f33b..000000000 --- a/tests/EndToEnd/forms/post-types/PageNoFormCest.php +++ /dev/null @@ -1,72 +0,0 @@ -activateKitPlugin($I); - $I->setupKitPluginCredentialsNoData($I); - $I->setupKitPluginResourcesNoData($I); - } - - /** - * Test that UTM parameters are included in links displayed in the metabox for the user to sign in to - * their Kit account. - * - * @since 1.9.6 - * - * @param EndToEndTester $I Tester. - */ - public function testUTMParametersExist(EndToEndTester $I) - { - // Activate Classic Editor Plugin. - $I->activateThirdPartyPlugin($I, 'classic-editor'); - - // Navigate to Pages > Add New. - $I->amOnAdminPage('post-new.php?post_type=page'); - - // Check that no PHP warnings or notices were output. - $I->checkNoWarningsAndNoticesOnScreen($I); - - // Check that the metabox is displayed. - $I->seeElementInDOM('#wp-convertkit-meta-box'); - - // Confirm that UTM parameters exist for the 'sign in to Kit' link. - $I->seeInSource('sign in to Kit'); - - // Deactivate Classic Editor Plugin. - $I->deactivateThirdPartyPlugin($I, 'classic-editor'); - } - - /** - * 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 1.9.6.7 - * - * @param EndToEndTester $I Tester. - */ - public function _passed(EndToEndTester $I) - { - $I->deactivateKitPlugin($I); - $I->resetKitPlugin($I); - } -}