Skip to content

Commit

Permalink
E2E: stabilize failing tests in trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
gwwar committed Mar 12, 2021
1 parent e8613cf commit 2a3d9a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
12 changes: 6 additions & 6 deletions packages/e2e-tests/specs/editor/various/adding-blocks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,14 @@ describe( 'adding blocks', () => {
inserterMenuInputSelector
);
inserterMenuSearchInput.type( 'cover' );
// We need to wait a bit after typing otherwise we might an "early" result
// that is going to be "detached" when trying to click on it
// eslint-disable-next-line no-restricted-syntax
await page.waitForTimeout( 200 );
const coverBlock = await page.waitForSelector(
await page.waitForSelector(
'.block-editor-block-types-list .editor-block-list-item-cover'
);
await coverBlock.click();
// clicking may be too quick and may select a detached node.
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Enter' );

expect( await getEditedPostContent() ).toMatchSnapshot();
} );

Expand Down
23 changes: 7 additions & 16 deletions packages/e2e-tests/specs/experiments/navigation-editor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,26 +347,17 @@ describe( 'Navigation editor', () => {
);
await startEmptyButton.click();

// NOTE - the following code is commented out.
// In CI the editor doesn't seem to support variations.
// The following code can be re-introduced once that's resolved.
// Add an inner link block.
// const appender = await page.waitForSelector(
// 'button[aria-label="Add block"]'
// );
// await appender.click();
const appender = await page.waitForSelector(
'button[aria-label="Add block"]'
);
await appender.click();

// Must be an exact match to the word 'Link' as other
// variations also contain the word 'Link'.
// const linkInserterItem = await page.waitForXPath(
// '//button[@role="option"]//span[.="Link"]'
// );
// await linkInserterItem.click();

const appender = await page.waitForSelector(
'button[aria-label="Add Link"]'
const linkInserterItem = await page.waitForXPath(
'//button[@role="option"]//span[.="Link"]'
);
await appender.click();
await linkInserterItem.click();

await page.waitForSelector( 'input[aria-label="URL"]' );

Expand Down

0 comments on commit 2a3d9a7

Please sign in to comment.