Skip to content

Commit

Permalink
fix editor/blocks/buttons.spec.js to wait for block after insert
Browse files Browse the repository at this point in the history
  • Loading branch information
flootr committed Nov 29, 2023
1 parent 87e6536 commit 50cd450
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/e2e/specs/editor/blocks/buttons.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ test.describe( 'Buttons', () => {
.click();
await page.keyboard.type( '/buttons' );
await page.keyboard.press( 'Enter' );
await page.locator( 'role=textbox[name="Button text"i]' ).isVisible();
await page.keyboard.type( 'Content' );

// Check the content.
Expand Down Expand Up @@ -143,6 +144,7 @@ test.describe( 'Buttons', () => {
pageUtils,
} ) => {
await editor.insertBlock( { name: 'core/buttons' } );
await page.locator( 'role=textbox[name="Button text"i]' ).isVisible();
await page.keyboard.type( 'WordPress' );
await pageUtils.pressKeys( 'primary+k' );
await page.keyboard.type( 'https://www.wordpress.org/' );
Expand Down Expand Up @@ -170,6 +172,7 @@ test.describe( 'Buttons', () => {
pageUtils,
} ) => {
await editor.insertBlock( { name: 'core/buttons' } );
await page.locator( 'role=textbox[name="Button text"i]' ).isVisible();
await page.keyboard.type( 'WordPress' );
await pageUtils.pressKeys( 'primary+k' );
await page.keyboard.type( 'https://www.wordpress.org/' );
Expand Down Expand Up @@ -259,6 +262,7 @@ test.describe( 'Buttons', () => {

test( 'can resize width', async ( { editor, page } ) => {
await editor.insertBlock( { name: 'core/buttons' } );
await page.locator( 'role=textbox[name="Button text"i]' ).isVisible();
await page.keyboard.type( 'Content' );
await editor.openDocumentSettingsSidebar();
await page.click(
Expand All @@ -281,6 +285,7 @@ test.describe( 'Buttons', () => {

test( 'can apply named colors', async ( { editor, page } ) => {
await editor.insertBlock( { name: 'core/buttons' } );
await page.locator( 'role=textbox[name="Button text"i]' ).isVisible();
await page.keyboard.type( 'Content' );
await editor.openDocumentSettingsSidebar();

Expand Down Expand Up @@ -310,6 +315,7 @@ test.describe( 'Buttons', () => {

test( 'can apply custom colors', async ( { editor, page } ) => {
await editor.insertBlock( { name: 'core/buttons' } );
await page.locator( 'role=textbox[name="Button text"i]' ).isVisible();
await page.keyboard.type( 'Content' );
await editor.openDocumentSettingsSidebar();

Expand Down Expand Up @@ -345,6 +351,7 @@ test.describe( 'Buttons', () => {
page,
} ) => {
await editor.insertBlock( { name: 'core/buttons' } );
await page.locator( 'role=textbox[name="Button text"i]' ).isVisible();
await page.keyboard.type( 'Content' );
await editor.openDocumentSettingsSidebar();

Expand Down Expand Up @@ -374,6 +381,7 @@ test.describe( 'Buttons', () => {
page,
} ) => {
await editor.insertBlock( { name: 'core/buttons' } );
await page.locator( 'role=textbox[name="Button text"i]' ).isVisible();
await page.keyboard.type( 'Content' );
await editor.openDocumentSettingsSidebar();

Expand Down

0 comments on commit 50cd450

Please sign in to comment.