Skip to content

Commit

Permalink
Merge pull request #562 from 10up/fix/e2e-tests
Browse files Browse the repository at this point in the history
Fix failing E2E tests and add back testing on `trunk`
  • Loading branch information
dkotter authored Aug 11, 2023
2 parents b95ac50 + f1ade7a commit 4f099b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions tests/test-plugin/e2e-test-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
);

0 comments on commit 4f099b8

Please sign in to comment.