Skip to content

Commit

Permalink
fix a few more tests to wait for blocks to appear
Browse files Browse the repository at this point in the history
  • Loading branch information
flootr committed Dec 7, 2023
1 parent 50cd450 commit 489fab8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/e2e/specs/editor/blocks/code.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ test.describe( 'Code', () => {
.click();
await page.keyboard.type( '```' );
await page.keyboard.press( 'Enter' );

await editor.canvas.locator( 'pre' ).isVisible();

await page.keyboard.type( '<?php' );

expect( await editor.getEditedPostContent() ).toMatchSnapshot();
Expand All @@ -38,6 +41,7 @@ test.describe( 'Code', () => {

test( 'should paste plain text', async ( { editor, pageUtils } ) => {
await editor.insertBlock( { name: 'core/code' } );
await editor.canvas.locator( 'pre' ).isVisible();

// Test to see if HTML and white space is kept.
pageUtils.setClipboardData( { plainText: '<img />\n\t<br>' } );
Expand Down
1 change: 1 addition & 0 deletions test/e2e/specs/editor/blocks/preformatted.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ test.describe( 'Preformatted', () => {
page,
} ) => {
await editor.insertBlock( { name: 'core/preformatted' } );
await editor.canvas.locator( 'pre' ).isVisible();
await page.keyboard.type( '1' );
await page.keyboard.press( 'Enter' );
await page.keyboard.type( '2' );
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/specs/editor/blocks/verse-code-preformatted.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );
page,
} ) => {
await editor.insertBlock( { name: blockName } );

await editor.canvas.locator( 'pre' ).isVisible();

await page.keyboard.type( 'a' );
await page.keyboard.press( 'Enter' );
await page.keyboard.press( 'Enter' );
Expand Down

0 comments on commit 489fab8

Please sign in to comment.