From f85a3522f11714e523b31325248fca37419644d2 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Thu, 10 Aug 2023 15:20:38 -0600 Subject: [PATCH 1/2] Load our custom block for all tests. This forces the editor to load in a non-iframed state which fixes issues with Cypress --- tests/test-plugin/e2e-test-plugin.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test-plugin/e2e-test-plugin.php b/tests/test-plugin/e2e-test-plugin.php index f993da6de..381821797 100644 --- a/tests/test-plugin/e2e-test-plugin.php +++ b/tests/test-plugin/e2e-test-plugin.php @@ -95,3 +95,14 @@ function classifai_test_prepare_response( $response ) { if ( ! defined( 'FS_METHOD' ) ) { define( 'FS_METHOD', 'direct' ); } + +// Load our recommended content block to force the non-iframe editor. +// Cypress fails to run correctly when the editor is iframed. +add_action( + 'admin_init', + function() { + if ( function_exists( 'Classifai\Blocks\setup' ) ) { + Classifai\Blocks\setup(); + } + } +); From f1ade7a4cc9b02d0714a81ac7d9368ff34613cef Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Thu, 10 Aug 2023 15:22:58 -0600 Subject: [PATCH 2/2] Add trunk back to our matrix for testing --- .github/workflows/cypress.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 8093f5e21..9da966642 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -17,6 +17,7 @@ jobs: core: - {name: 'WP latest', version: 'latest'} - {name: 'WP minimum', version: 'WordPress/WordPress#5.7'} + - {name: 'WP trunk', version: 'WordPress/WordPress#master'} steps: - name: Checkout uses: actions/checkout@v3