From 625f611f8b391001a80e5e9ab502bbf26e8b7e24 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 29 Jun 2026 10:57:02 +0800 Subject: [PATCH 1/4] Improve WooCommerce Test Reliability --- .github/workflows/tests.yml | 21 +-------------------- tests/Support/Data/dump.sql | 3 ++- tests/Support/Helper/WPClassicEditor.php | 3 +++ tests/Support/Helper/WPQuickEdit.php | 3 +++ 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1e6581ad2..82ff9fd5d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,28 +33,9 @@ jobs: fail-fast: false matrix: wp-version: [ 'latest' ] - php-version: [ '8.1', '8.2', '8.3', '8.4' ] + php-version: [ '8.1' ] test-group: - - 'EndToEnd/broadcasts/blocks-shortcodes' - - 'EndToEnd/broadcasts/import-export' - - 'EndToEnd/forms/blocks-shortcodes' - - 'EndToEnd/forms/general' - - 'EndToEnd/forms/post-types' - - 'EndToEnd/general/other' - - 'EndToEnd/general/uninstall' - - 'EndToEnd/general/plugin-screens' - - 'EndToEnd/integrations/divi-builder' - - 'EndToEnd/integrations/divi-theme' - - 'EndToEnd/integrations/elementor' - - 'EndToEnd/integrations/other' - - 'EndToEnd/integrations/wlm' - 'EndToEnd/integrations/woocommerce' - - 'EndToEnd/landing-pages' - - 'EndToEnd/products' - - 'EndToEnd/restrict-content/general' - - 'EndToEnd/restrict-content/post-types' - - 'EndToEnd/tags' - - 'Integration' uses: ./.github/workflows/_run-tests.yml secrets: inherit diff --git a/tests/Support/Data/dump.sql b/tests/Support/Data/dump.sql index 142f4cf2a..3f24ebc81 100644 --- a/tests/Support/Data/dump.sql +++ b/tests/Support/Data/dump.sql @@ -386,7 +386,8 @@ INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALU (20, 1, 'edit_page_per_page', '100'), (21, 1, 'edit_post_per_page', '100'), (22, 1, 'wp_persisted_preferences', 'a:4:{s:4:"core";a:2:{s:26:"isComplementaryAreaVisible";b:1;s:24:"enableChoosePatternModal";b:0;}s:14:"core/edit-post";a:4:{s:12:"welcomeGuide";b:0;s:23:"metaBoxesMainOpenHeight";i:540;s:20:"welcomeGuideTemplate";b:0;s:19:"metaBoxesMainIsOpen";b:1;}s:9:"_modified";s:24:"2024-07-18T02:45:41.491Z";s:17:"core/edit-widgets";a:2:{s:26:"isComplementaryAreaVisible";b:1;s:12:"welcomeGuide";b:0;}}'), -(23, 1, 'elementor_introduction', 'a:5:{s:7:"exit_to";b:1;s:27:"ai-get-started-announcement";b:1;s:20:"globals_introduction";b:1;s:6:"e-apps";b:1;s:27:"e-editor-one-notice-pointer";b:1;}'); +(23, 1, 'elementor_introduction', 'a:5:{s:7:"exit_to";b:1;s:27:"ai-get-started-announcement";b:1;s:20:"globals_introduction";b:1;s:6:"e-apps";b:1;s:27:"e-editor-one-notice-pointer";b:1;}'), +(24, 1, 'dismissed_no_secure_connection_notice', 'true'); DROP TABLE IF EXISTS `wp_users`; CREATE TABLE `wp_users` ( diff --git a/tests/Support/Helper/WPClassicEditor.php b/tests/Support/Helper/WPClassicEditor.php index 0d1f5c97b..c8a1aca82 100644 --- a/tests/Support/Helper/WPClassicEditor.php +++ b/tests/Support/Helper/WPClassicEditor.php @@ -300,6 +300,9 @@ public function publishAndViewClassicEditorPage($I) // Publish Page. $I->publishClassicEditorPage($I); + // Wait for the notice to display. + $I->waitForElementVisible('.notice-success'); + // Load the Page on the frontend site. $I->click('.notice-success a'); diff --git a/tests/Support/Helper/WPQuickEdit.php b/tests/Support/Helper/WPQuickEdit.php index ee921e43e..3da5382f9 100644 --- a/tests/Support/Helper/WPQuickEdit.php +++ b/tests/Support/Helper/WPQuickEdit.php @@ -61,6 +61,9 @@ public function openQuickEdit($I, $postType, $postID) // Navigate to Post Type's WP_List_Table. $I->amOnAdminPage('edit.php?post_type=' . $postType); + // Wait for the WP_List_Table to load. + $I->waitForElementVisible('table.wp-list-table'); + // Hover mouse over Post's table row. $I->moveMouseOver('tr#post-' . $postID); From 2c6c809e782ecbbe8ba594fbc4e45e0bbf969689 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 29 Jun 2026 11:19:18 +0800 Subject: [PATCH 2/4] Quick Edit: Wait for row visibility before attempting mouseover --- tests/Support/Helper/WPQuickEdit.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/Support/Helper/WPQuickEdit.php b/tests/Support/Helper/WPQuickEdit.php index 3da5382f9..76641f438 100644 --- a/tests/Support/Helper/WPQuickEdit.php +++ b/tests/Support/Helper/WPQuickEdit.php @@ -64,13 +64,18 @@ public function openQuickEdit($I, $postType, $postID) // Wait for the WP_List_Table to load. $I->waitForElementVisible('table.wp-list-table'); - // Hover mouse over Post's table row. - $I->moveMouseOver('tr#post-' . $postID); + // Wait for the Post's row to exist in the table. + $I->waitForElementVisible('tr#post-' . $postID); - // Wait for Quick edit link to be visible. - $I->waitForElementVisible('tr#post-' . $postID . ' button.editinline'); + // Display all row actions by adding the `visible` class, as + // moveMouseOver() is flaky. + $I->executeJS(' + document.querySelectorAll(".row-actions").forEach(function(el){ + el.classList.add("visible"); + }); + '); - // Click Quick Edit link. + // Click Quick Edit link for the Post. $I->click('tr#post-' . $postID . ' button.editinline'); } } From ffadcbf011502ea05114262c2d8657a6be9c7eb2 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 29 Jun 2026 11:31:38 +0800 Subject: [PATCH 3/4] Reinstate all tests --- .github/workflows/tests.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 82ff9fd5d..1e6581ad2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,9 +33,28 @@ jobs: fail-fast: false matrix: wp-version: [ 'latest' ] - php-version: [ '8.1' ] + php-version: [ '8.1', '8.2', '8.3', '8.4' ] test-group: + - 'EndToEnd/broadcasts/blocks-shortcodes' + - 'EndToEnd/broadcasts/import-export' + - 'EndToEnd/forms/blocks-shortcodes' + - 'EndToEnd/forms/general' + - 'EndToEnd/forms/post-types' + - 'EndToEnd/general/other' + - 'EndToEnd/general/uninstall' + - 'EndToEnd/general/plugin-screens' + - 'EndToEnd/integrations/divi-builder' + - 'EndToEnd/integrations/divi-theme' + - 'EndToEnd/integrations/elementor' + - 'EndToEnd/integrations/other' + - 'EndToEnd/integrations/wlm' - 'EndToEnd/integrations/woocommerce' + - 'EndToEnd/landing-pages' + - 'EndToEnd/products' + - 'EndToEnd/restrict-content/general' + - 'EndToEnd/restrict-content/post-types' + - 'EndToEnd/tags' + - 'Integration' uses: ./.github/workflows/_run-tests.yml secrets: inherit From 518cc85672a8528570ab815e2872e8ec60b915fa Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 29 Jun 2026 11:32:55 +0800 Subject: [PATCH 4/4] Coding standards --- tests/Support/Helper/WPQuickEdit.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/Support/Helper/WPQuickEdit.php b/tests/Support/Helper/WPQuickEdit.php index 76641f438..74002cf9c 100644 --- a/tests/Support/Helper/WPQuickEdit.php +++ b/tests/Support/Helper/WPQuickEdit.php @@ -69,11 +69,13 @@ public function openQuickEdit($I, $postType, $postID) // Display all row actions by adding the `visible` class, as // moveMouseOver() is flaky. - $I->executeJS(' + $I->executeJS( + ' document.querySelectorAll(".row-actions").forEach(function(el){ el.classList.add("visible"); }); - '); + ' + ); // Click Quick Edit link for the Post. $I->click('tr#post-' . $postID . ' button.editinline');