From afce4866d1806a4d3b7661ea3f99bdbf93e4d7cc Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Thu, 18 Apr 2019 16:52:57 -0400 Subject: [PATCH] Testing: Update tests to use Escape press to activate block toolbar (#15063) --- packages/e2e-tests/specs/block-deletion.test.js | 4 ++-- packages/e2e-tests/specs/editor-modes.test.js | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/e2e-tests/specs/block-deletion.test.js b/packages/e2e-tests/specs/block-deletion.test.js index 01cc63ff153095..a5dc9bb9c44753 100644 --- a/packages/e2e-tests/specs/block-deletion.test.js +++ b/packages/e2e-tests/specs/block-deletion.test.js @@ -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(); diff --git a/packages/e2e-tests/specs/editor-modes.test.js b/packages/e2e-tests/specs/editor-modes.test.js index bc055b5ff99609..1bb525123e197d 100644 --- a/packages/e2e-tests/specs/editor-modes.test.js +++ b/packages/e2e-tests/specs/editor-modes.test.js @@ -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"]' ); @@ -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"]' ); @@ -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"]' ); @@ -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"]' );