Skip to content

Commit

Permalink
Testing: Update tests to use Escape press to activate block toolbar (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored Apr 18, 2019
1 parent 5d25504 commit afce486
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/e2e-tests/specs/block-deletion.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ describe( 'block deletion -', () => {
// The blocks can't be empty to trigger the toolbar
await page.keyboard.type( 'Paragraph to remove' );

// Move the mouse to show the block toolbar
await page.mouse.move( 200, 300, { steps: 10 } );
// Press Escape to show the block toolbar
await page.keyboard.press( 'Escape' );

await clickOnBlockSettingsMenuItem( 'Remove Block' );
expect( await getEditedPostContent() ).toMatchSnapshot();
Expand Down
16 changes: 8 additions & 8 deletions packages/e2e-tests/specs/editor-modes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ describe( 'Editing modes (visual/HTML)', () => {
let visualBlock = await page.$$( '.block-editor-block-list__layout .block-editor-block-list__block .block-editor-rich-text' );
expect( visualBlock ).toHaveLength( 1 );

// Move the mouse to show the block toolbar
await page.mouse.move( 200, 300, { steps: 10 } );
// Press Escape to show the block toolbar
await page.keyboard.press( 'Escape' );

// Change editing mode from "Visual" to "HTML".
await page.waitForSelector( 'button[aria-label="More options"]' );
Expand All @@ -32,8 +32,8 @@ describe( 'Editing modes (visual/HTML)', () => {
const htmlBlock = await page.$$( '.block-editor-block-list__layout .block-editor-block-list__block .block-editor-block-list__block-html-textarea' );
expect( htmlBlock ).toHaveLength( 1 );

// Move the mouse to show the block toolbar
await page.mouse.move( 200, 300, { steps: 10 } );
// Press Escape to show the block toolbar
await page.keyboard.press( 'Escape' );

// Change editing mode from "HTML" back to "Visual".
await page.waitForSelector( 'button[aria-label="More options"]' );
Expand All @@ -47,8 +47,8 @@ describe( 'Editing modes (visual/HTML)', () => {
} );

it( 'should display sidebar in HTML mode', async () => {
// Move the mouse to show the block toolbar
await page.mouse.move( 200, 300, { steps: 10 } );
// Press Escape to show the block toolbar
await page.keyboard.press( 'Escape' );

// Change editing mode from "Visual" to "HTML".
await page.waitForSelector( 'button[aria-label="More options"]' );
Expand All @@ -63,8 +63,8 @@ describe( 'Editing modes (visual/HTML)', () => {
} );

it( 'should update HTML in HTML mode when sidebar is used', async () => {
// Move the mouse to show the block toolbar
await page.mouse.move( 200, 300, { steps: 10 } );
// Press Escape to show the block toolbar
await page.keyboard.press( 'Escape' );

// Change editing mode from "Visual" to "HTML".
await page.waitForSelector( 'button[aria-label="More options"]' );
Expand Down

0 comments on commit afce486

Please sign in to comment.