From 7535f4a15eca1a9ce3d3f06e4c4382e7ee95ffcb Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 23 Oct 2025 16:46:25 +0800 Subject: [PATCH 01/16] Run Tests against WordPress 6.9 Beta --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 611c28975..28dd0d587 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -35,7 +35,7 @@ jobs: # Defines the WordPress and PHP Versions matrix to run tests on. strategy: matrix: - wp-versions: [ 'latest' ] #[ '6.1.1', 'latest' ] + wp-versions: [ '6.9-beta1' ] #[ 'latest', '6.9-beta1' ] php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] #[ '7.3', '7.4', '8.0', '8.1' ] # Steps to install, configure and run tests diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 772909364..cb4f9b205 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: strategy: fail-fast: false matrix: - wp-versions: [ 'latest' ] #[ '6.1.1', 'latest' ] + wp-versions: [ '6.9-beta1' ] #[ 'latest', '6.9-beta1' ] php-versions: [ '8.1', '8.2', '8.3', '8.4' ] #[ '7.4', '8.0', '8.1' ] # Folder names within the 'tests' folder to run tests in parallel. From 00202a55d7bbcb6f35edf2cdd7a5d4a5f4759442 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 23 Oct 2025 16:59:58 +0800 Subject: [PATCH 02/16] Bump DB version --- tests/Support/Data/dump.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Support/Data/dump.sql b/tests/Support/Data/dump.sql index f1aeeb879..e3ec007bf 100644 --- a/tests/Support/Data/dump.sql +++ b/tests/Support/Data/dump.sql @@ -155,7 +155,7 @@ INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload` (43, 'html_type', 'text/html', 'on'), (44, 'use_trackback', '0', 'on'), (45, 'default_role', 'subscriber', 'on'), -(46, 'db_version', '60421', 'on'), +(46, 'db_version', '60717', 'on'), (47, 'uploads_use_yearmonth_folders', '1', 'on'), (48, 'upload_path', '', 'on'), (49, 'blog_public', '1', 'on'), @@ -208,7 +208,7 @@ INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload` (96, 'auto_update_core_minor', 'enabled', 'on'), (97, 'auto_update_core_major', 'enabled', 'on'), (98, 'wp_force_deactivated_plugins', 'a:0:{}', 'on'), -(99, 'initial_db_version', '60421', 'on'), +(99, 'initial_db_version', '60717', 'on'), (100, 'wp_user_roles', 'a:5:{s:13:\"administrator\";a:2:{s:4:\"name\";s:13:\"Administrator\";s:12:\"capabilities\";a:61:{s:13:\"switch_themes\";b:1;s:11:\"edit_themes\";b:1;s:16:\"activate_plugins\";b:1;s:12:\"edit_plugins\";b:1;s:10:\"edit_users\";b:1;s:10:\"edit_files\";b:1;s:14:\"manage_options\";b:1;s:17:\"moderate_comments\";b:1;s:17:\"manage_categories\";b:1;s:12:\"manage_links\";b:1;s:12:\"upload_files\";b:1;s:6:\"import\";b:1;s:15:\"unfiltered_html\";b:1;s:10:\"edit_posts\";b:1;s:17:\"edit_others_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:10:\"edit_pages\";b:1;s:4:\"read\";b:1;s:8:\"level_10\";b:1;s:7:\"level_9\";b:1;s:7:\"level_8\";b:1;s:7:\"level_7\";b:1;s:7:\"level_6\";b:1;s:7:\"level_5\";b:1;s:7:\"level_4\";b:1;s:7:\"level_3\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:17:\"edit_others_pages\";b:1;s:20:\"edit_published_pages\";b:1;s:13:\"publish_pages\";b:1;s:12:\"delete_pages\";b:1;s:19:\"delete_others_pages\";b:1;s:22:\"delete_published_pages\";b:1;s:12:\"delete_posts\";b:1;s:19:\"delete_others_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:20:\"delete_private_posts\";b:1;s:18:\"edit_private_posts\";b:1;s:18:\"read_private_posts\";b:1;s:20:\"delete_private_pages\";b:1;s:18:\"edit_private_pages\";b:1;s:18:\"read_private_pages\";b:1;s:12:\"delete_users\";b:1;s:12:\"create_users\";b:1;s:17:\"unfiltered_upload\";b:1;s:14:\"edit_dashboard\";b:1;s:14:\"update_plugins\";b:1;s:14:\"delete_plugins\";b:1;s:15:\"install_plugins\";b:1;s:13:\"update_themes\";b:1;s:14:\"install_themes\";b:1;s:11:\"update_core\";b:1;s:10:\"list_users\";b:1;s:12:\"remove_users\";b:1;s:13:\"promote_users\";b:1;s:18:\"edit_theme_options\";b:1;s:13:\"delete_themes\";b:1;s:6:\"export\";b:1;}}s:6:\"editor\";a:2:{s:4:\"name\";s:6:\"Editor\";s:12:\"capabilities\";a:34:{s:17:\"moderate_comments\";b:1;s:17:\"manage_categories\";b:1;s:12:\"manage_links\";b:1;s:12:\"upload_files\";b:1;s:15:\"unfiltered_html\";b:1;s:10:\"edit_posts\";b:1;s:17:\"edit_others_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:10:\"edit_pages\";b:1;s:4:\"read\";b:1;s:7:\"level_7\";b:1;s:7:\"level_6\";b:1;s:7:\"level_5\";b:1;s:7:\"level_4\";b:1;s:7:\"level_3\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:17:\"edit_others_pages\";b:1;s:20:\"edit_published_pages\";b:1;s:13:\"publish_pages\";b:1;s:12:\"delete_pages\";b:1;s:19:\"delete_others_pages\";b:1;s:22:\"delete_published_pages\";b:1;s:12:\"delete_posts\";b:1;s:19:\"delete_others_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:20:\"delete_private_posts\";b:1;s:18:\"edit_private_posts\";b:1;s:18:\"read_private_posts\";b:1;s:20:\"delete_private_pages\";b:1;s:18:\"edit_private_pages\";b:1;s:18:\"read_private_pages\";b:1;}}s:6:\"author\";a:2:{s:4:\"name\";s:6:\"Author\";s:12:\"capabilities\";a:10:{s:12:\"upload_files\";b:1;s:10:\"edit_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:4:\"read\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:12:\"delete_posts\";b:1;s:22:\"delete_published_posts\";b:1;}}s:11:\"contributor\";a:2:{s:4:\"name\";s:11:\"Contributor\";s:12:\"capabilities\";a:5:{s:10:\"edit_posts\";b:1;s:4:\"read\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:12:\"delete_posts\";b:1;}}s:10:\"subscriber\";a:2:{s:4:\"name\";s:10:\"Subscriber\";s:12:\"capabilities\";a:2:{s:4:\"read\";b:1;s:7:\"level_0\";b:1;}}}', 'on'), (101, 'fresh_site', '1', 'on'), (102, 'user_count', '1', 'off'), From 90ff202f35a865061f8453b97816831f799d3ffb Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Fri, 24 Oct 2025 17:26:53 +0800 Subject: [PATCH 03/16] Refresh Resources: Improve detection of block editor in 6.9 using wp.editPost, instead of wp.blockEditor --- resources/backend/js/refresh-resources.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/backend/js/refresh-resources.js b/resources/backend/js/refresh-resources.js index 812303a50..88f607c3d 100644 --- a/resources/backend/js/refresh-resources.js +++ b/resources/backend/js/refresh-resources.js @@ -201,7 +201,7 @@ function convertKitRefreshResources(button) { */ function convertKitRefreshResourcesRemoveNotices() { // If we're editing a Page, Post or Custom Post Type in Gutenberg, use wp.data.dispatch to remove the error. - if (typeof wp !== 'undefined' && typeof wp.blockEditor !== 'undefined') { + if (typeof wp !== 'undefined' && typeof wp.editPost !== 'undefined') { // Gutenberg Editor. wp.data.dispatch('core/notices').removeNotice('convertkit-error'); return; @@ -226,7 +226,9 @@ function convertKitRefreshResourcesOutputErrorNotice(message) { message = 'ConvertKit: ' + message; // If we're editing a Page, Post or Custom Post Type in Gutenberg, use wp.data.dispatch to show the error. - if (typeof wp !== 'undefined' && typeof wp.blockEditor !== 'undefined') { + // wp.blockEditor is available in WordPress 6.9, even when using the Classic Editor - so it's not a reliable indicator of whether we're in Gutenberg. + // wp.editPost is only available in Gutenberg, and is a better indicator of whether we're in Gutenberg. + if (typeof wp !== 'undefined' && typeof wp.editPost !== 'undefined') { // Gutenberg Editor. wp.data .dispatch('core/notices') From df693e5ecd88198cc7b98f1cb014eb6c67a5b065 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Fri, 24 Oct 2025 17:33:17 +0800 Subject: [PATCH 04/16] Use wp.editPost check to register pre-publish actions --- resources/backend/js/gutenberg.js | 12 +++++++----- resources/backend/js/refresh-resources.js | 2 -- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/backend/js/gutenberg.js b/resources/backend/js/gutenberg.js index 91ee48b47..e5041af57 100644 --- a/resources/backend/js/gutenberg.js +++ b/resources/backend/js/gutenberg.js @@ -19,11 +19,13 @@ if (typeof wp !== 'undefined' && typeof wp.blockEditor !== 'undefined') { convertKitGutenbergRegisterBlock(convertkit_blocks[block]); } - // Register ConvertKit Pre-publish actions in Gutenberg. - if (typeof convertkit_pre_publish_actions !== 'undefined') { - convertKitGutenbergRegisterPrePublishActions( - convertkit_pre_publish_actions - ); + // Register ConvertKit Pre-publish actions in Gutenberg if we're editing a Post. + if ( typeof wp.editPost !== 'undefined' ) { + if (typeof convertkit_pre_publish_actions !== 'undefined') { + convertKitGutenbergRegisterPrePublishActions( + convertkit_pre_publish_actions + ); + } } } diff --git a/resources/backend/js/refresh-resources.js b/resources/backend/js/refresh-resources.js index 88f607c3d..3ed7526c6 100644 --- a/resources/backend/js/refresh-resources.js +++ b/resources/backend/js/refresh-resources.js @@ -226,8 +226,6 @@ function convertKitRefreshResourcesOutputErrorNotice(message) { message = 'ConvertKit: ' + message; // If we're editing a Page, Post or Custom Post Type in Gutenberg, use wp.data.dispatch to show the error. - // wp.blockEditor is available in WordPress 6.9, even when using the Classic Editor - so it's not a reliable indicator of whether we're in Gutenberg. - // wp.editPost is only available in Gutenberg, and is a better indicator of whether we're in Gutenberg. if (typeof wp !== 'undefined' && typeof wp.editPost !== 'undefined') { // Gutenberg Editor. wp.data From 1b3284b4d3c876695e9ecbab3aa4707560d049cb Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Fri, 24 Oct 2025 17:33:39 +0800 Subject: [PATCH 05/16] JS Coding Standards --- resources/backend/js/gutenberg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/backend/js/gutenberg.js b/resources/backend/js/gutenberg.js index e5041af57..48b72a126 100644 --- a/resources/backend/js/gutenberg.js +++ b/resources/backend/js/gutenberg.js @@ -20,7 +20,7 @@ if (typeof wp !== 'undefined' && typeof wp.blockEditor !== 'undefined') { } // Register ConvertKit Pre-publish actions in Gutenberg if we're editing a Post. - if ( typeof wp.editPost !== 'undefined' ) { + if (typeof wp.editPost !== 'undefined') { if (typeof convertkit_pre_publish_actions !== 'undefined') { convertKitGutenbergRegisterPrePublishActions( convertkit_pre_publish_actions From cdd82ebf773597d0016f07e1fafd8ecf6c0392f6 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 27 Oct 2025 11:09:09 +0800 Subject: [PATCH 06/16] Fix Divi Tests --- .../divi-builder/DiviPluginBroadcastsCest.php | 22 +++++++++++++++---- .../divi-builder/DiviPluginFormCest.php | 22 +++++++++++++++---- .../DiviPluginFormTriggerCest.php | 22 +++++++++++++++---- .../divi-builder/DiviPluginProductCest.php | 22 +++++++++++++++---- .../divi-theme/DiviThemeBroadcastsCest.php | 22 +++++++++++++++---- .../divi-theme/DiviThemeFormCest.php | 19 +++++++++++++--- .../divi-theme/DiviThemeFormTriggerCest.php | 22 +++++++++++++++---- .../divi-theme/DiviThemeProductCest.php | 19 +++++++++++++--- 8 files changed, 140 insertions(+), 30 deletions(-) diff --git a/tests/EndToEnd/integrations/divi-builder/DiviPluginBroadcastsCest.php b/tests/EndToEnd/integrations/divi-builder/DiviPluginBroadcastsCest.php index 28e70fcc8..9b31225b0 100644 --- a/tests/EndToEnd/integrations/divi-builder/DiviPluginBroadcastsCest.php +++ b/tests/EndToEnd/integrations/divi-builder/DiviPluginBroadcastsCest.php @@ -242,9 +242,16 @@ public function testBroadcastsModuleInFrontendEditorWhenNoCredentials(EndToEndTe programmaticName: 'convertkit_broadcasts' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('Not connected to Kit'); - $I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to configure broadcasts to display.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('Not connected to Kit', 'div.convertkit-divi-module'); + $I->see('Connect your Kit account at Settings > Kit, and then refresh this page to configure broadcasts to display.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** @@ -271,9 +278,16 @@ public function testBroadcastsModuleInFrontendEditorWhenNoBroadcasts(EndToEndTes programmaticName: 'convertkit_broadcasts' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('No broadcasts exist in Kit'); - $I->seeInSource('Add a broadcast to your Kit account, and then refresh this page to configure broadcasts to display.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('No broadcasts exist in Kit', 'div.convertkit-divi-module'); + $I->see('Add a broadcast to your Kit account, and then refresh this page to configure broadcasts to display.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** diff --git a/tests/EndToEnd/integrations/divi-builder/DiviPluginFormCest.php b/tests/EndToEnd/integrations/divi-builder/DiviPluginFormCest.php index 2de93876c..4072507da 100644 --- a/tests/EndToEnd/integrations/divi-builder/DiviPluginFormCest.php +++ b/tests/EndToEnd/integrations/divi-builder/DiviPluginFormCest.php @@ -115,9 +115,16 @@ public function testFormModuleInFrontendEditorWhenNoCredentials(EndToEndTester $ programmaticName: 'convertkit_form' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('Not connected to Kit'); - $I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('Not connected to Kit', 'div.convertkit-divi-module'); + $I->see('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** @@ -144,9 +151,16 @@ public function testFormModuleInFrontendEditorWhenNoForms(EndToEndTester $I) programmaticName: 'convertkit_form' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('No forms exist in Kit'); - $I->seeInSource('Add a form to your Kit account, and then refresh this page to select a form.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('No forms exist in Kit', 'div.convertkit-divi-module'); + $I->see('Add a form to your Kit account, and then refresh this page to select a form.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** diff --git a/tests/EndToEnd/integrations/divi-builder/DiviPluginFormTriggerCest.php b/tests/EndToEnd/integrations/divi-builder/DiviPluginFormTriggerCest.php index 8c8d13b2e..5b000332c 100644 --- a/tests/EndToEnd/integrations/divi-builder/DiviPluginFormTriggerCest.php +++ b/tests/EndToEnd/integrations/divi-builder/DiviPluginFormTriggerCest.php @@ -121,9 +121,16 @@ public function testFormTriggerModuleInFrontendEditorWhenNoCredentials(EndToEndT programmaticName: 'convertkit_formtrigger' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('Not connected to Kit'); - $I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('Not connected to Kit', 'div.convertkit-divi-module'); + $I->see('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** @@ -150,9 +157,16 @@ public function testFormTriggerModuleInFrontendEditorWhenNoForms(EndToEndTester programmaticName: 'convertkit_formtrigger' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('No modal, sticky bar or slide in forms exist in Kit'); - $I->seeInSource('Add a non-inline form to your Kit account, and then refresh this page to select a form.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('No modal, sticky bar or slide in forms exist in Kit', 'div.convertkit-divi-module'); + $I->see('Add a non-inline form to your Kit account, and then refresh this page to select a form.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** diff --git a/tests/EndToEnd/integrations/divi-builder/DiviPluginProductCest.php b/tests/EndToEnd/integrations/divi-builder/DiviPluginProductCest.php index 272eb1d05..ece4c2a71 100644 --- a/tests/EndToEnd/integrations/divi-builder/DiviPluginProductCest.php +++ b/tests/EndToEnd/integrations/divi-builder/DiviPluginProductCest.php @@ -113,9 +113,16 @@ public function testProductModuleInFrontendEditorWhenNoCredentials(EndToEndTeste programmaticName: 'convertkit_product' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('Not connected to Kit'); - $I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a product.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('Not connected to Kit', 'div.convertkit-divi-module'); + $I->see('Connect your Kit account at Settings > Kit, and then refresh this page to select a product.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** @@ -142,9 +149,16 @@ public function testProductModuleInFrontendEditorWhenNoProducts(EndToEndTester $ programmaticName: 'convertkit_product' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('No products exist in Kit'); - $I->seeInSource('Add a product to your Kit account, and then refresh this page to select a product.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('No products exist in Kit', 'div.convertkit-divi-module'); + $I->see('Add a product to your Kit account, and then refresh this page to select a product.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** diff --git a/tests/EndToEnd/integrations/divi-theme/DiviThemeBroadcastsCest.php b/tests/EndToEnd/integrations/divi-theme/DiviThemeBroadcastsCest.php index 8ed5f88bf..495259ff0 100644 --- a/tests/EndToEnd/integrations/divi-theme/DiviThemeBroadcastsCest.php +++ b/tests/EndToEnd/integrations/divi-theme/DiviThemeBroadcastsCest.php @@ -244,9 +244,16 @@ public function testBroadcastsModuleInFrontendEditorWhenNoCredentials(EndToEndTe programmaticName: 'convertkit_broadcasts' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('Not connected to Kit'); - $I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to configure broadcasts to display.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('Not connected to Kit', 'div.convertkit-divi-module'); + $I->see('Connect your Kit account at Settings > Kit, and then refresh this page to configure broadcasts to display.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** @@ -273,9 +280,16 @@ public function testBroadcastsModuleInFrontendEditorWhenNoBroadcasts(EndToEndTes programmaticName: 'convertkit_broadcasts' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('No broadcasts exist in Kit'); - $I->seeInSource('Add a broadcast to your Kit account, and then refresh this page to configure broadcasts to display.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('No broadcasts exist in Kit', 'div.convertkit-divi-module'); + $I->see('Add a broadcast to your Kit account, and then refresh this page to configure broadcasts to display.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** diff --git a/tests/EndToEnd/integrations/divi-theme/DiviThemeFormCest.php b/tests/EndToEnd/integrations/divi-theme/DiviThemeFormCest.php index ac9eb484b..cb5884397 100644 --- a/tests/EndToEnd/integrations/divi-theme/DiviThemeFormCest.php +++ b/tests/EndToEnd/integrations/divi-theme/DiviThemeFormCest.php @@ -115,9 +115,15 @@ public function testFormModuleInFrontendEditorWhenNoCredentials(EndToEndTester $ programmaticName: 'convertkit_form' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. $I->seeInSource('Not connected to Kit'); - $I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.'); + $I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** @@ -144,9 +150,16 @@ public function testFormModuleInFrontendEditorWhenNoForms(EndToEndTester $I) programmaticName: 'convertkit_form' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('No forms exist in Kit'); - $I->seeInSource('Add a form to your Kit account, and then refresh this page to select a form.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('No forms exist in Kit', 'div.convertkit-divi-module'); + $I->see('Add a form to your Kit account, and then refresh this page to select a form.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** diff --git a/tests/EndToEnd/integrations/divi-theme/DiviThemeFormTriggerCest.php b/tests/EndToEnd/integrations/divi-theme/DiviThemeFormTriggerCest.php index 36ab10a6e..8e5021f6f 100644 --- a/tests/EndToEnd/integrations/divi-theme/DiviThemeFormTriggerCest.php +++ b/tests/EndToEnd/integrations/divi-theme/DiviThemeFormTriggerCest.php @@ -121,9 +121,16 @@ public function testFormTriggerModuleInFrontendEditorWhenNoCredentials(EndToEndT programmaticName: 'convertkit_formtrigger' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('Not connected to Kit'); - $I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('Not connected to Kit', 'div.convertkit-divi-module'); + $I->see('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** @@ -150,9 +157,16 @@ public function testFormTriggerModuleInFrontendEditorWhenNoForms(EndToEndTester programmaticName: 'convertkit_formtrigger' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('No modal, sticky bar or slide in forms exist in Kit'); - $I->seeInSource('Add a non-inline form to your Kit account, and then refresh this page to select a form.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('No modal, sticky bar or slide in forms exist in Kit', 'div.convertkit-divi-module'); + $I->see('Add a non-inline form to your Kit account, and then refresh this page to select a form.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** diff --git a/tests/EndToEnd/integrations/divi-theme/DiviThemeProductCest.php b/tests/EndToEnd/integrations/divi-theme/DiviThemeProductCest.php index 877f1c080..d39e46451 100644 --- a/tests/EndToEnd/integrations/divi-theme/DiviThemeProductCest.php +++ b/tests/EndToEnd/integrations/divi-theme/DiviThemeProductCest.php @@ -113,9 +113,15 @@ public function testProductModuleInFrontendEditorWhenNoCredentials(EndToEndTeste programmaticName: 'convertkit_product' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. $I->seeInSource('Not connected to Kit'); - $I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a product.'); + $I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a product.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** @@ -142,9 +148,16 @@ public function testProductModuleInFrontendEditorWhenNoProducts(EndToEndTester $ programmaticName: 'convertkit_product' ); + // Switch to Divi Builder iframe. + $I->switchToIFrame('iframe[id="et-fb-app-frame"]'); + // Confirm the on screen message displays. - $I->seeInSource('No products exist in Kit'); - $I->seeInSource('Add a product to your Kit account, and then refresh this page to select a product.'); + $I->waitForElementVisible('div.convertkit-divi-module'); + $I->see('No products exist in Kit', 'div.convertkit-divi-module'); + $I->see('Add a product to your Kit account, and then refresh this page to select a product.', 'div.convertkit-divi-module'); + + // Switch back to main window. + $I->switchToIFrame(); } /** From c569a4f933a3fee49904fbd503c0d33982b4d894 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 27 Oct 2025 15:52:11 +0800 Subject: [PATCH 07/16] Fix Uncode tests --- ...ntProductThirdPartyThemeOrPageBuilderCest.php | 8 ++++++-- tests/Support/Helper/KitRestrictContent.php | 16 ++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php index 82970aaa1..1d8ca3c2c 100644 --- a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php +++ b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php @@ -75,7 +75,9 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End options: [ 'visible_content' => '', 'member_content' => 'Member-only content.', - ] + ], + // Don't check for warnings and notices, as Uncode uses deprecated functions which WordPress 6.9 warn about. + checkNoWarningsAndNotices: false ); // Deactivate Uncode theme and Plugins. @@ -131,7 +133,9 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) options: [ 'visible_content' => '', 'member_content' => 'Member-only content.', - ] + ], + // Don't check for warnings and notices, as Uncode uses deprecated functions which WordPress 6.9 warn about. + checkNoWarningsAndNotices: false ); // Deactivate Uncode theme and Plugins. diff --git a/tests/Support/Helper/KitRestrictContent.php b/tests/Support/Helper/KitRestrictContent.php index 5c9cdc6b1..353fbb24a 100644 --- a/tests/Support/Helper/KitRestrictContent.php +++ b/tests/Support/Helper/KitRestrictContent.php @@ -193,8 +193,9 @@ public function createRestrictedContentPage($I, $options = false) * @type string $member_content Content that should only be available to authenticated subscribers. * @type array $settings Restrict content settings. If not defined, uses expected defaults. * } + * @param bool $checkNoWarningsAndNotices Whether to check for errors. */ - public function testRestrictedContentByProductOnFrontend($I, $urlOrPageID, $options = false) + public function testRestrictedContentByProductOnFrontend($I, $urlOrPageID, $options = false, $checkNoWarningsAndNotices = true) { // Setup test. $options = $this->setupRestrictContentTest($I, $options, $urlOrPageID); @@ -203,7 +204,7 @@ public function testRestrictedContentByProductOnFrontend($I, $urlOrPageID, $opti $I->seeInSource('seeGutenbergBlockAvailable($I, 'Paragraph', 'paragraph'); - $I->seeGutenbergBlockAvailable($I, 'Heading', 'heading'); + $I->seeGutenbergBlockAvailable($I, 'Paragraph', 'paragraph/paragraph'); + $I->seeGutenbergBlockAvailable($I, 'Heading', 'heading/heading'); $I->seeGutenbergBlockAvailable($I, 'List', 'list'); $I->seeGutenbergBlockAvailable($I, 'Image', 'image'); $I->seeGutenbergBlockAvailable($I, 'Spacer', 'spacer'); diff --git a/tests/Support/Helper/WPGutenberg.php b/tests/Support/Helper/WPGutenberg.php index 131b5e899..fd5781988 100644 --- a/tests/Support/Helper/WPGutenberg.php +++ b/tests/Support/Helper/WPGutenberg.php @@ -73,9 +73,18 @@ public function addGutenbergBlock($I, $blockName, $blockProgrammaticName, $block $I->wait(2); // Insert the block. - $I->waitForElementVisible('.block-editor-inserter__panel-content button.editor-block-list-item-' . $blockProgrammaticName); - $I->seeElementInDOM('.block-editor-inserter__panel-content button.editor-block-list-item-' . $blockProgrammaticName); - $I->click('.block-editor-inserter__panel-content button.editor-block-list-item-' . $blockProgrammaticName); + if (strpos($blockProgrammaticName, '/') !== false) { + // Use XPath if $blockProgrammaticName contains a forward slash. + $xpath = '//button[contains(@class, "editor-block-list-item-' . $blockProgrammaticName . '") and contains(@class,"block-editor-block-types-list__item") and contains(@class,"components-button")]'; + $I->waitForElementVisible([ 'xpath' => $xpath ]); + $I->seeElementInDOM([ 'xpath' => $xpath ]); + $I->click([ 'xpath' => $xpath ]); + } else { + $selector = '.block-editor-inserter__panel-content button.editor-block-list-item-' . $blockProgrammaticName; + $I->waitForElementVisible($selector); + $I->seeElementInDOM($selector); + $I->click($selector); + } // Close block inserter. $I->click('button.editor-document-tools__inserter-toggle'); @@ -139,7 +148,7 @@ public function addGutenbergBlock($I, $blockName, $blockProgrammaticName, $block */ public function addGutenbergParagraphBlock($I, $text) { - $I->addGutenbergBlock($I, 'Paragraph', 'paragraph'); + $I->addGutenbergBlock($I, 'Paragraph', 'paragraph/paragraph'); $I->click('.wp-block-post-content'); $I->fillField('.wp-block-post-content p[data-empty="true"]', $text); @@ -268,7 +277,17 @@ public function seeGutenbergBlockAvailable($I, $blockName, $blockProgrammaticNam $I->wait(2); // Confirm the block is available. - $I->waitForElementVisible('.block-editor-inserter__panel-content button.editor-block-list-item-' . $blockProgrammaticName); + // $blockProgrammaticName may contain a slash, which is not valid in a CSS class selector. + // Use XPath to check for a button containing the relevant class. + if (strpos($blockProgrammaticName, '/') !== false) { + // XPath: class attribute contains all required classes including block-programmatic-name. + $classParts = explode('/', $blockProgrammaticName); + $xpath = '//button[contains(@class, "editor-block-list-item-' . $blockProgrammaticName . '") and contains(@class,"block-editor-block-types-list__item") and contains(@class,"components-button")]'; + $I->waitForElementVisible([ 'xpath' => $xpath ]); + } else { + $selector = '.block-editor-inserter__panel-content button.editor-block-list-item-' . $blockProgrammaticName; + $I->waitForElementVisible($selector); + } // Clear the search field. $I->click('button[aria-label="Reset search"]'); From d2b79fc03000ce496870a1f9c5d7218e8e5b9bb7 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 20 Nov 2025 14:05:06 +0800 Subject: [PATCH 14/16] Run tests against WordPress 6.9 RC2 --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index ef57079f8..bfcac296a 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -35,7 +35,7 @@ jobs: # Defines the WordPress and PHP Versions matrix to run tests on. strategy: matrix: - wp-versions: [ '6.9-RC1' ] #[ '6.1.1', 'latest' ] + wp-versions: [ '6.9-RC2' ] #[ '6.1.1', 'latest' ] php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] #[ '7.3', '7.4', '8.0', '8.1' ] # Steps to install, configure and run tests diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b9e121d8e..ced51928d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: strategy: fail-fast: false matrix: - wp-versions: [ '6.9-RC1' ] #[ '6.1.1', 'latest' ] + wp-versions: [ '6.9-RC2' ] #[ '6.1.1', 'latest' ] php-versions: [ '8.1', '8.2', '8.3', '8.4' ] #[ '7.4', '8.0', '8.1' ] # Folder names within the 'tests' folder to run tests in parallel. From e929b24b672a0bce813050e78697cbbcdf9a01cc Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Wed, 26 Nov 2025 16:20:25 +0800 Subject: [PATCH 15/16] Run tests against WordPress 6.9 RC3 --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index bfcac296a..ce0762df9 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -35,7 +35,7 @@ jobs: # Defines the WordPress and PHP Versions matrix to run tests on. strategy: matrix: - wp-versions: [ '6.9-RC2' ] #[ '6.1.1', 'latest' ] + wp-versions: [ '6.9-RC3' ] #[ '6.1.1', 'latest' ] php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] #[ '7.3', '7.4', '8.0', '8.1' ] # Steps to install, configure and run tests diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ced51928d..6a51a1817 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: strategy: fail-fast: false matrix: - wp-versions: [ '6.9-RC2' ] #[ '6.1.1', 'latest' ] + wp-versions: [ '6.9-RC3' ] #[ '6.1.1', 'latest' ] php-versions: [ '8.1', '8.2', '8.3', '8.4' ] #[ '7.4', '8.0', '8.1' ] # Folder names within the 'tests' folder to run tests in parallel. From 3d5a62c5ba588535f00db29dfd0926f85f24716f Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Wed, 3 Dec 2025 09:15:09 +0800 Subject: [PATCH 16/16] Run Tests against WordPress 6.9 --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index ce0762df9..201631404 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -35,7 +35,7 @@ jobs: # Defines the WordPress and PHP Versions matrix to run tests on. strategy: matrix: - wp-versions: [ '6.9-RC3' ] #[ '6.1.1', 'latest' ] + wp-versions: [ 'latest' ] #[ '6.1.1', 'latest' ] php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] #[ '7.3', '7.4', '8.0', '8.1' ] # Steps to install, configure and run tests diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6a51a1817..137f505d7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: strategy: fail-fast: false matrix: - wp-versions: [ '6.9-RC3' ] #[ '6.1.1', 'latest' ] + wp-versions: [ 'latest' ] #[ '6.1.1', 'latest' ] php-versions: [ '8.1', '8.2', '8.3', '8.4' ] #[ '7.4', '8.0', '8.1' ] # Folder names within the 'tests' folder to run tests in parallel.