Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix e2e test inserting cover block #31866

Merged
merged 1 commit into from
May 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ describe( 'Inserting blocks', () => {
inserterMenuInputSelector
);
inserterMenuSearchInput.type( 'cover' );
await page.waitForSelector(
'.block-editor-block-types-list .editor-block-list-item-cover'
);
// clicking may be too quick and may select a detached node.
// Wait for the search results to load after typing the full search
// term. Previously this test would sometimes accidentally tab to the
// button for a code block.
await page.evaluate( () => new Promise( window.requestIdleCallback ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this check would necessarily run the scheduled event we are looking for (load search results) always.
This can still cause intermittent failures and it does in trunk.

I've changed this check here: b928438 which will land now with a green CI.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what we had before, which was also failing sometimes. But the failures happen more now. I'll just revert my PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in 5a2a966.

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