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

Multi-block selection and rich text test: wait for expected UI to appear #47173

Merged
merged 1 commit into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
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 @@ -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