Skip to content

Commit

Permalink
Multi-block selection and rich text test: wait for expected UI to app…
Browse files Browse the repository at this point in the history
…ear (#47173)
  • Loading branch information
jsnajdr authored Jan 16, 2023
1 parent 6f13377 commit 1dc0b23
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ describe( 'Multi-block selection', () => {
await page.keyboard.press( 'Enter' );
await page.keyboard.type( '/group' );
await page.waitForXPath(
`//*[contains(@class, "components-autocomplete__result") and contains(@class, "is-selected") and contains(text(), 'Group')]`
'//button[@aria-selected="true"][text()="Group"]'
);
await page.keyboard.press( 'Enter' );

Expand Down Expand Up @@ -658,16 +658,23 @@ describe( 'Multi-block selection', () => {
it( 'should gradually multi-select', async () => {
await clickBlockAppender();
await page.keyboard.type( '/columns' );
await page.waitForXPath(
'//button[@aria-selected="true"][text()="Columns"]'
);
await page.keyboard.press( 'Enter' );
// Select two columns.
await page.keyboard.press( 'ArrowRight' );
await page.keyboard.press( 'Enter' );
// Navigate to appender.
await page.keyboard.press( 'ArrowRight' );
await page.keyboard.press( 'Enter' );
// Select a paragraph.
// Wait for inserter results to appear and then select a paragraph.
await page.waitForSelector(
'.block-editor-inserter__quick-inserter-results .block-editor-block-types-list__item'
);
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Enter' );
// Type two paragraphs
await page.keyboard.type( '1' );
await page.keyboard.press( 'Enter' );
await page.keyboard.type( '2' );
Expand Down Expand Up @@ -705,6 +712,9 @@ describe( 'Multi-block selection', () => {
await page.keyboard.press( 'Enter' );
// Add a list.
await page.keyboard.type( '/list' );
await page.waitForXPath(
'//button[@aria-selected="true"][text()="List"]'
);
await page.keyboard.press( 'Enter' );
await page.keyboard.type( '1' );

Expand Down Expand Up @@ -924,6 +934,9 @@ describe( 'Multi-block selection', () => {
await page.keyboard.press( 'Enter' );
await page.keyboard.press( 'Enter' );
await page.keyboard.type( '/hr' );
await page.waitForXPath(
'//button[@aria-selected="true"][text()="Separator"]'
);
await page.keyboard.press( 'Enter' );
await page.keyboard.press( 'ArrowUp' );
await page.keyboard.press( 'ArrowUp' );
Expand Down
4 changes: 4 additions & 0 deletions packages/e2e-tests/specs/editor/various/rich-text.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,10 @@ describe( 'RichText', () => {
await button.evaluate( ( element ) => element.scrollIntoView() );
await button.click();

// Wait for the popover with "Text" tab to appear.
await page.waitForXPath(
'//button[@role="tab"][@aria-selected="true"][text()="Text"]'
);
// Tab to the "Text" tab.
await page.keyboard.press( 'Tab' );
// Tab to black.
Expand Down

1 comment on commit 1dc0b23

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 1dc0b23.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3929286483
📝 Reported issues:

Please sign in to comment.