Skip to content

Commit

Permalink
Fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jul 7, 2021
1 parent fc6accc commit 5bc8bb7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ describe( 'cpt locking', () => {
await page.click(
'.wp-block-column .block-editor-button-block-appender'
);
await page.type( '.block-editor-inserter__search-input', 'image' );
await page.type( '.block-editor-inserter__search input', 'image' );
await pressKeyTimes( 'Tab', 2 );
await page.keyboard.press( 'Enter' );
await page.click( '.edit-post-header-toolbar__inserter-toggle' );
await page.type(
'.block-editor-inserter__search-input',
'.block-editor-inserter__search input',
'gallery'
);
await pressKeyTimes( 'Tab', 2 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe( 'Inserting blocks', () => {
() =>
document.activeElement &&
document.activeElement.classList.contains(
'block-editor-inserter__search-input'
'components-search-control__input'
)
);
await page.keyboard.type( 'para' );
Expand Down Expand Up @@ -185,7 +185,7 @@ describe( 'Inserting blocks', () => {
() => document.activeElement.classList
);
expect( Object.values( activeElementClassList ) ).toContain(
'block-editor-inserter__search-input'
'components-search-control__input'
);

// Try using the up arrow key (vertical navigation triggers the issue described in #9583).
Expand All @@ -196,7 +196,7 @@ describe( 'Inserting blocks', () => {
() => document.activeElement.classList
);
expect( Object.values( activeElementClassList ) ).toContain(
'block-editor-inserter__search-input'
'components-search-control__input'
);

// Tab to the block list
Expand Down Expand Up @@ -250,7 +250,7 @@ describe( 'Inserting blocks', () => {
);

// Insert a paragraph block.
await page.waitForSelector( '.block-editor-inserter__search-input' );
await page.waitForSelector( '.block-editor-inserter__search input' );

// Search for the paragraph block if it's not in the list of blocks shown.
if ( ! page.$( '.editor-block-list-item-paragraph' ) ) {
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-tests/specs/editor/various/writing-flow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const addParagraphsAndColumnsDemo = async () => {
await page.keyboard.press( 'Enter' );
await page.click( ':focus [aria-label="Two columns; equal split"]' );
await page.click( ':focus .block-editor-button-block-appender' );
await page.waitForSelector( ':focus.block-editor-inserter__search-input' );
await page.waitForSelector( '.block-editor-inserter__search input:focus' );
await page.keyboard.type( 'Paragraph' );
await pressKeyTimes( 'Tab', 2 ); // Tab to paragraph result.
await page.keyboard.press( 'Enter' ); // Insert paragraph.
Expand All @@ -40,7 +40,7 @@ const addParagraphsAndColumnsDemo = async () => {
// is a temporary solution.
await page.focus( '.wp-block[data-type="core/column"]:nth-child(2)' );
await page.click( ':focus .block-editor-button-block-appender' );
await page.waitForSelector( ':focus.block-editor-inserter__search-input' );
await page.waitForSelector( '.block-editor-inserter__search input:focus' );
await page.keyboard.type( 'Paragraph' );
await pressKeyTimes( 'Tab', 2 ); // Tab to paragraph result.
await page.keyboard.press( 'Enter' ); // Insert paragraph.
Expand Down

0 comments on commit 5bc8bb7

Please sign in to comment.