diff --git a/packages/e2e-tests/specs/editor/blocks/cover.test.js b/packages/e2e-tests/specs/editor/blocks/cover.test.js index 4366bad799bc21..efc700a190bb4f 100644 --- a/packages/e2e-tests/specs/editor/blocks/cover.test.js +++ b/packages/e2e-tests/specs/editor/blocks/cover.test.js @@ -126,7 +126,7 @@ describe( 'Cover', () => { '.components-circular-option-picker__option-wrapper:first-child button' ); - // Select the cover block.By default the child paragraph gets selected. + // Select the cover block. By default the child paragraph gets selected. await page.click( '.edit-post-header-toolbar__document-overview-toggle' ); @@ -134,16 +134,14 @@ describe( 'Cover', () => { '.block-editor-list-view-block__contents-container a' ); - const heightInput = ( - await page.$x( - '//div[./label[contains(text(),"Minimum height of cover")]]/following-sibling::div//input' - ) - )[ 0 ]; + const heightInputHandle = await page.waitForSelector( + 'input[id*="block-cover-height-input"]' + ); // Verify the height of the cover is not defined. expect( - await page.evaluate( ( { value } ) => value, heightInput ) - ).toBeFalsy(); + await page.evaluate( ( { value } ) => value, heightInputHandle ) + ).toBe( '' ); const resizeButton = await page.$( '.components-resizable-box__handle-bottom' @@ -188,7 +186,7 @@ describe( 'Cover', () => { expect( await page.evaluate( ( { value } ) => Number.parseInt( value ), - heightInput + heightInputHandle ) ).toBeGreaterThan( 100 ); } );