From 4762aa03ebccc88dc805c5705bd925a1480f77c7 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Wed, 3 Dec 2025 17:49:38 +0800 Subject: [PATCH 1/9] Tests: Fix 502 Errors on Uncode Theme Tests --- .github/workflows/tests.yml | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 137f505d7..6a74661b8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,28 +52,11 @@ jobs: fail-fast: false matrix: wp-versions: [ 'latest' ] #[ '6.1.1', 'latest' ] - php-versions: [ '8.1', '8.2', '8.3', '8.4' ] #[ '7.4', '8.0', '8.1' ] + php-versions: [ '8.2' ] #[ '7.4', '8.0', '8.1' ] # Folder names within the 'tests' folder to run tests in parallel. test-groups: [ - 'EndToEnd/broadcasts/blocks-shortcodes', - 'EndToEnd/broadcasts/import-export', - 'EndToEnd/forms/blocks-shortcodes', - 'EndToEnd/forms/general', - 'EndToEnd/forms/post-types', - 'EndToEnd/general/other', - 'EndToEnd/general/plugin-screens', - 'EndToEnd/integrations/divi-builder', - 'EndToEnd/integrations/divi-theme', - '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' + 'EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest' ] # Steps to install, configure and run tests From ad4293895b3556c6a7ac7e60a618c34719630b0d Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 4 Dec 2025 12:39:48 +0800 Subject: [PATCH 2/9] Tests: Collect and upload nginx logs to artifact on failure --- .github/workflows/tests.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6a74661b8..723a5f197 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -305,6 +305,23 @@ jobs: # Artifacts are data generated by this workflow that we want to access, such as log files, screenshots, HTML output. # The if: failure() directive means that this will run when the workflow fails e.g. if a test fails, which is needed # because we want to see why a test failed. + - name: Collect nginx Logs + if: failure() + run: | + mkdir -p /home/runner/logs + sudo cp /var/log/nginx/error.log /home/runner/logs/nginx-error.log || true + sudo cp /var/log/nginx/access.log /home/runner/logs/nginx-access.log || true + sudo find /var/log -type f -iname "*fpm*.log" -exec cp {} /home/runner/logs/ \; || true + sudo journalctl -u nginx > /home/runner/logs/nginx-journal.log || true + sudo journalctl -u php${{ matrix.php-versions }}-fpm > /home/runner/logs/php-fpm-journal.log || true + + - name: Upload nginx Logs to Artifact + if: failure() + uses: actions/upload-artifact@v4 + with: + name: server-logs-php${{ matrix.php-versions }} + path: /home/runner/logs + - name: Upload Test Results to Artifact if: failure() uses: actions/upload-artifact@v4 From 096b114c8d8225c982f998e3db9533aa27c9dd99 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 4 Dec 2025 12:44:48 +0800 Subject: [PATCH 3/9] Artifacts: Fetch /var/log/nginx directly --- .github/workflows/tests.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 723a5f197..78a8b4d77 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -305,22 +305,12 @@ jobs: # Artifacts are data generated by this workflow that we want to access, such as log files, screenshots, HTML output. # The if: failure() directive means that this will run when the workflow fails e.g. if a test fails, which is needed # because we want to see why a test failed. - - name: Collect nginx Logs - if: failure() - run: | - mkdir -p /home/runner/logs - sudo cp /var/log/nginx/error.log /home/runner/logs/nginx-error.log || true - sudo cp /var/log/nginx/access.log /home/runner/logs/nginx-access.log || true - sudo find /var/log -type f -iname "*fpm*.log" -exec cp {} /home/runner/logs/ \; || true - sudo journalctl -u nginx > /home/runner/logs/nginx-journal.log || true - sudo journalctl -u php${{ matrix.php-versions }}-fpm > /home/runner/logs/php-fpm-journal.log || true - - name: Upload nginx Logs to Artifact if: failure() uses: actions/upload-artifact@v4 with: - name: server-logs-php${{ matrix.php-versions }} - path: /home/runner/logs + name: nginx-logs-${{ steps.test-group.outputs.value }}-${{ matrix.php-versions }} + path: /var/log/nginx - name: Upload Test Results to Artifact if: failure() From 79cad51fbc1b3d19bd19b859559b49687cc07411 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 4 Dec 2025 12:52:20 +0800 Subject: [PATCH 4/9] Increase nginx buffer sizes to fix 502 bad gateway errors --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 78a8b4d77..6b4c2757b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -199,6 +199,11 @@ jobs: location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php${{ matrix.php-versions }}-fpm.sock; + + # Prevent 502 Bad Gateway error "upstream sent too big header while reading response header from upstream" + fastcgi_buffers 16 16k; + fastcgi_buffer_size 32k; + fastcgi_busy_buffers_size 64k; } location ~ /\.ht { From e05e22ce2e3ab8b85c801bef840b9c1b1de3b524 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 4 Dec 2025 13:00:12 +0800 Subject: [PATCH 5/9] Change order of tests --- ...roductThirdPartyThemeOrPageBuilderCest.php | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php index b88c47b9a..ccaff0b8a 100644 --- a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php +++ b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php @@ -35,26 +35,23 @@ public function _before(EndToEndTester $I) /** * Test that restricting content by a Product specified in the Page Settings works when - * creating and viewing a new WordPress Page using the Uncode theme with + * creating and viewing a new WordPress Page using the Uncode theme without * the Visual Composer Page Builder. * * @since 2.7.7 * * @param EndToEndTester $I Tester. */ - public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(EndToEndTester $I) + public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) { - // Activate Visual Composer Page Builder. - $I->activateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); - // Programmatically create a Page using the Visual Composer Page Builder. $pageID = $I->havePostInDatabase( [ 'post_type' => 'page', - 'post_title' => 'Kit: Page: Restrict Content: Product: Uncode Theme with Visual Composer', + 'post_title' => 'Kit: Page: Restrict Content: Product: Uncode Theme without Visual Composer', - // Emulate Visual Composer content. - 'post_content' => '[vc_row][vc_column width="1/1"][vc_column_text uncode_shortcode_id="998876"]Member-only content.[/vc_column_text][/vc_column][/vc_row]', + // Emulate non-Visual Composer content. + 'post_content' => 'Member-only content.', // Don't display a Form on this Page, so we test against Restrict Content's Form. 'meta_input' => [ @@ -64,7 +61,6 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End 'tag' => '', 'restrict_content' => 'product_' . $_ENV['CONVERTKIT_API_PRODUCT_ID'], ], - '_wpb_vc_js_status' => 'true', ], ] ); @@ -80,30 +76,30 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End // Don't check for warnings and notices, as Uncode uses deprecated functions which WordPress 6.9 warn about. checkNoWarningsAndNotices: false ); - - // Deactivate Visual Composer Page Builder. - $I->deactivateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); } /** * Test that restricting content by a Product specified in the Page Settings works when - * creating and viewing a new WordPress Page using the Uncode theme without + * creating and viewing a new WordPress Page using the Uncode theme with * the Visual Composer Page Builder. * * @since 2.7.7 * * @param EndToEndTester $I Tester. */ - public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) + public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(EndToEndTester $I) { + // Activate Visual Composer Page Builder. + $I->activateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); + // Programmatically create a Page using the Visual Composer Page Builder. $pageID = $I->havePostInDatabase( [ 'post_type' => 'page', - 'post_title' => 'Kit: Page: Restrict Content: Product: Uncode Theme without Visual Composer', + 'post_title' => 'Kit: Page: Restrict Content: Product: Uncode Theme with Visual Composer', - // Emulate non-Visual Composer content. - 'post_content' => 'Member-only content.', + // Emulate Visual Composer content. + 'post_content' => '[vc_row][vc_column width="1/1"][vc_column_text uncode_shortcode_id="998876"]Member-only content.[/vc_column_text][/vc_column][/vc_row]', // Don't display a Form on this Page, so we test against Restrict Content's Form. 'meta_input' => [ @@ -113,6 +109,7 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) 'tag' => '', 'restrict_content' => 'product_' . $_ENV['CONVERTKIT_API_PRODUCT_ID'], ], + '_wpb_vc_js_status' => 'true', ], ] ); @@ -128,6 +125,9 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) // Don't check for warnings and notices, as Uncode uses deprecated functions which WordPress 6.9 warn about. checkNoWarningsAndNotices: false ); + + // Deactivate Visual Composer Page Builder. + $I->deactivateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); } /** From 96ee65bd132ebb2662af1aae568531ef330f450f Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 4 Dec 2025 13:11:38 +0800 Subject: [PATCH 6/9] Revert test order; change activation of Plugins --- ...roductThirdPartyThemeOrPageBuilderCest.php | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php index ccaff0b8a..cec4dd03d 100644 --- a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php +++ b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php @@ -25,8 +25,6 @@ public function _before(EndToEndTester $I) // Activate Kit Plugin and third party Plugins. $I->activateKitPlugin($I); $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); - $I->useTheme('uncode'); - $I->activateThirdPartyPlugin($I, 'uncode-core'); // Setup Kit Plugin, disabling JS. $I->setupKitPluginDisableJS($I); @@ -35,23 +33,28 @@ public function _before(EndToEndTester $I) /** * Test that restricting content by a Product specified in the Page Settings works when - * creating and viewing a new WordPress Page using the Uncode theme without + * creating and viewing a new WordPress Page using the Uncode theme with * the Visual Composer Page Builder. * * @since 2.7.7 * * @param EndToEndTester $I Tester. */ - public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) + public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(EndToEndTester $I) { + // Activate theme and third party Plugins. + $I->useTheme('uncode'); + $I->activateThirdPartyPlugin($I, 'uncode-core'); + $I->activateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); + // Programmatically create a Page using the Visual Composer Page Builder. $pageID = $I->havePostInDatabase( [ 'post_type' => 'page', - 'post_title' => 'Kit: Page: Restrict Content: Product: Uncode Theme without Visual Composer', + 'post_title' => 'Kit: Page: Restrict Content: Product: Uncode Theme with Visual Composer', - // Emulate non-Visual Composer content. - 'post_content' => 'Member-only content.', + // Emulate Visual Composer content. + 'post_content' => '[vc_row][vc_column width="1/1"][vc_column_text uncode_shortcode_id="998876"]Member-only content.[/vc_column_text][/vc_column][/vc_row]', // Don't display a Form on this Page, so we test against Restrict Content's Form. 'meta_input' => [ @@ -61,6 +64,7 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) 'tag' => '', 'restrict_content' => 'product_' . $_ENV['CONVERTKIT_API_PRODUCT_ID'], ], + '_wpb_vc_js_status' => 'true', ], ] ); @@ -76,30 +80,36 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) // Don't check for warnings and notices, as Uncode uses deprecated functions which WordPress 6.9 warn about. checkNoWarningsAndNotices: false ); + + // Deactivate theme and third party Plugins. + $I->deactivateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); + $I->deactivateThirdPartyPlugin($I, 'uncode-core'); + $I->useTheme('twentytwentyfive'); } /** * Test that restricting content by a Product specified in the Page Settings works when - * creating and viewing a new WordPress Page using the Uncode theme with + * creating and viewing a new WordPress Page using the Uncode theme without * the Visual Composer Page Builder. * * @since 2.7.7 * * @param EndToEndTester $I Tester. */ - public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(EndToEndTester $I) + public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) { - // Activate Visual Composer Page Builder. - $I->activateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); + // Activate theme and third party Plugins. + $I->useTheme('uncode'); + $I->activateThirdPartyPlugin($I, 'uncode-core'); // Programmatically create a Page using the Visual Composer Page Builder. $pageID = $I->havePostInDatabase( [ 'post_type' => 'page', - 'post_title' => 'Kit: Page: Restrict Content: Product: Uncode Theme with Visual Composer', + 'post_title' => 'Kit: Page: Restrict Content: Product: Uncode Theme without Visual Composer', - // Emulate Visual Composer content. - 'post_content' => '[vc_row][vc_column width="1/1"][vc_column_text uncode_shortcode_id="998876"]Member-only content.[/vc_column_text][/vc_column][/vc_row]', + // Emulate non-Visual Composer content. + 'post_content' => 'Member-only content.', // Don't display a Form on this Page, so we test against Restrict Content's Form. 'meta_input' => [ @@ -109,7 +119,6 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End 'tag' => '', 'restrict_content' => 'product_' . $_ENV['CONVERTKIT_API_PRODUCT_ID'], ], - '_wpb_vc_js_status' => 'true', ], ] ); @@ -126,8 +135,9 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End checkNoWarningsAndNotices: false ); - // Deactivate Visual Composer Page Builder. - $I->deactivateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); + // Deactivate theme and third party Plugins. + $I->deactivateThirdPartyPlugin($I, 'uncode-core'); + $I->useTheme('twentytwentyfive'); } /** @@ -142,8 +152,6 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End public function _passed(EndToEndTester $I) { // Deactivate Plugins and revert to default theme. - $I->deactivateThirdPartyPlugin($I, 'uncode-core'); - $I->useTheme('twentytwentyfive'); $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); // Deactivate and reset Kit Plugin. From acb4d5f809bb85abafd421c70f3b9b654e33733a Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 4 Dec 2025 14:06:56 +0800 Subject: [PATCH 7/9] Reinstate all tests --- .github/workflows/tests.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6b4c2757b..ec742687a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,11 +52,28 @@ jobs: fail-fast: false matrix: wp-versions: [ 'latest' ] #[ '6.1.1', 'latest' ] - php-versions: [ '8.2' ] #[ '7.4', '8.0', '8.1' ] + 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. test-groups: [ - 'EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest' + 'EndToEnd/broadcasts/blocks-shortcodes', + 'EndToEnd/broadcasts/import-export', + 'EndToEnd/forms/blocks-shortcodes', + 'EndToEnd/forms/general', + 'EndToEnd/forms/post-types', + 'EndToEnd/general/other', + 'EndToEnd/general/plugin-screens', + 'EndToEnd/integrations/divi-builder', + 'EndToEnd/integrations/divi-theme', + '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' ] # Steps to install, configure and run tests @@ -310,12 +327,12 @@ jobs: # Artifacts are data generated by this workflow that we want to access, such as log files, screenshots, HTML output. # The if: failure() directive means that this will run when the workflow fails e.g. if a test fails, which is needed # because we want to see why a test failed. - - name: Upload nginx Logs to Artifact + - name: Upload nginx Error Log to Artifact if: failure() uses: actions/upload-artifact@v4 with: - name: nginx-logs-${{ steps.test-group.outputs.value }}-${{ matrix.php-versions }} - path: /var/log/nginx + name: nginx-error-log-${{ steps.test-group.outputs.value }}-${{ matrix.php-versions }}.log + path: /var/log/nginx/error.log - name: Upload Test Results to Artifact if: failure() From 5683267708c94caa29e30d9ad32de6f278a00194 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 4 Dec 2025 14:44:32 +0800 Subject: [PATCH 8/9] Run tests, reverting Theme/Plugin activation/deactivation changes --- ...roductThirdPartyThemeOrPageBuilderCest.php | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php index cec4dd03d..b88c47b9a 100644 --- a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php +++ b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php @@ -25,6 +25,8 @@ public function _before(EndToEndTester $I) // Activate Kit Plugin and third party Plugins. $I->activateKitPlugin($I); $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); + $I->useTheme('uncode'); + $I->activateThirdPartyPlugin($I, 'uncode-core'); // Setup Kit Plugin, disabling JS. $I->setupKitPluginDisableJS($I); @@ -42,9 +44,7 @@ public function _before(EndToEndTester $I) */ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(EndToEndTester $I) { - // Activate theme and third party Plugins. - $I->useTheme('uncode'); - $I->activateThirdPartyPlugin($I, 'uncode-core'); + // Activate Visual Composer Page Builder. $I->activateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); // Programmatically create a Page using the Visual Composer Page Builder. @@ -81,10 +81,8 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End checkNoWarningsAndNotices: false ); - // Deactivate theme and third party Plugins. + // Deactivate Visual Composer Page Builder. $I->deactivateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); - $I->deactivateThirdPartyPlugin($I, 'uncode-core'); - $I->useTheme('twentytwentyfive'); } /** @@ -98,10 +96,6 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End */ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) { - // Activate theme and third party Plugins. - $I->useTheme('uncode'); - $I->activateThirdPartyPlugin($I, 'uncode-core'); - // Programmatically create a Page using the Visual Composer Page Builder. $pageID = $I->havePostInDatabase( [ @@ -134,10 +128,6 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) // Don't check for warnings and notices, as Uncode uses deprecated functions which WordPress 6.9 warn about. checkNoWarningsAndNotices: false ); - - // Deactivate theme and third party Plugins. - $I->deactivateThirdPartyPlugin($I, 'uncode-core'); - $I->useTheme('twentytwentyfive'); } /** @@ -152,6 +142,8 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) public function _passed(EndToEndTester $I) { // Deactivate Plugins and revert to default theme. + $I->deactivateThirdPartyPlugin($I, 'uncode-core'); + $I->useTheme('twentytwentyfive'); $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); // Deactivate and reset Kit Plugin. From d60b2190eea5294adee481f021b3b7e860466dfe Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 4 Dec 2025 16:25:00 +0800 Subject: [PATCH 9/9] Move Plugin/Theme activation to individual tests for reliability --- ...roductThirdPartyThemeOrPageBuilderCest.php | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php index b88c47b9a..e53916605 100644 --- a/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php +++ b/tests/EndToEnd/restrict-content/post-types/RestrictContentProductThirdPartyThemeOrPageBuilderCest.php @@ -25,8 +25,6 @@ public function _before(EndToEndTester $I) // Activate Kit Plugin and third party Plugins. $I->activateKitPlugin($I); $I->activateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); - $I->useTheme('uncode'); - $I->activateThirdPartyPlugin($I, 'uncode-core'); // Setup Kit Plugin, disabling JS. $I->setupKitPluginDisableJS($I); @@ -44,7 +42,9 @@ public function _before(EndToEndTester $I) */ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(EndToEndTester $I) { - // Activate Visual Composer Page Builder. + // Activate theme and third party Plugins. + $I->useTheme('uncode'); + $I->activateThirdPartyPlugin($I, 'uncode-core'); $I->activateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); // Programmatically create a Page using the Visual Composer Page Builder. @@ -81,8 +81,10 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End checkNoWarningsAndNotices: false ); - // Deactivate Visual Composer Page Builder. + // Deactivate theme and third party Plugins. $I->deactivateThirdPartyPlugin($I, 'uncode-wpbakery-page-builder'); + $I->deactivateThirdPartyPlugin($I, 'uncode-core'); + $I->useTheme('twentytwentyfive'); } /** @@ -96,6 +98,10 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End */ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) { + // Activate theme and third party Plugins. + $I->useTheme('uncode'); + $I->activateThirdPartyPlugin($I, 'uncode-core'); + // Programmatically create a Page using the Visual Composer Page Builder. $pageID = $I->havePostInDatabase( [ @@ -128,6 +134,10 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) // Don't check for warnings and notices, as Uncode uses deprecated functions which WordPress 6.9 warn about. checkNoWarningsAndNotices: false ); + + // Deactivate theme and third party Plugins. + $I->deactivateThirdPartyPlugin($I, 'uncode-core'); + $I->useTheme('twentytwentyfive'); } /** @@ -141,9 +151,7 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I) */ public function _passed(EndToEndTester $I) { - // Deactivate Plugins and revert to default theme. - $I->deactivateThirdPartyPlugin($I, 'uncode-core'); - $I->useTheme('twentytwentyfive'); + // Deactivate Plugins. $I->deactivateThirdPartyPlugin($I, 'disable-_load_textdomain_just_in_time-doing_it_wrong-notice'); // Deactivate and reset Kit Plugin.