From 5b8f832b051650e9afe5014d4a9f4ad9f1868931 Mon Sep 17 00:00:00 2001 From: Marcus Kazmierczak Date: Fri, 18 Jun 2021 20:46:52 -0700 Subject: [PATCH] Improve caret test by skipping inserter Press Enter after adding intial caption will add a new paragraph, allowing skipping the insertBlock() with the same functionality. Local tests runs show saving ~5 seconds on normal test run and >10 seconds when using THROTTLE_CPU=4 SLOW_NETWORK=true --- packages/e2e-tests/specs/editor/blocks/image.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/e2e-tests/specs/editor/blocks/image.test.js b/packages/e2e-tests/specs/editor/blocks/image.test.js index 1acf1248f7182c..908cba05093de8 100644 --- a/packages/e2e-tests/specs/editor/blocks/image.test.js +++ b/packages/e2e-tests/specs/editor/blocks/image.test.js @@ -115,7 +115,7 @@ describe( 'Image', () => { const fileName = await upload( '.wp-block-image input[type="file"]' ); await waitForImage( fileName ); await page.keyboard.type( '1' ); - await insertBlock( 'Paragraph' ); + await page.keyboard.press( 'Enter' ); await page.keyboard.press( 'Backspace' ); await page.keyboard.type( '2' );