diff --git a/packages/calypso-e2e/src/lib/pages/editor-page.ts b/packages/calypso-e2e/src/lib/pages/editor-page.ts index 67150600804dac..7e628782494154 100644 --- a/packages/calypso-e2e/src/lib/pages/editor-page.ts +++ b/packages/calypso-e2e/src/lib/pages/editor-page.ts @@ -304,11 +304,14 @@ export class EditorPage { */ async addBlockFromSidebar( blockName: string, - blockEditorSelector: string + blockEditorSelector: string, + { noSearch }: { noSearch?: boolean } = {} ): Promise< ElementHandle > { await this.editorGutenbergComponent.resetSelectedBlock(); await this.editorToolbarComponent.openBlockInserter(); - await this.addBlockFromInserter( blockName, this.editorSidebarBlockInserterComponent ); + await this.addBlockFromInserter( blockName, this.editorSidebarBlockInserterComponent, { + noSearch: noSearch, + } ); const blockHandle = await this.editorGutenbergComponent.getSelectedBlockElementHandle( blockEditorSelector @@ -377,9 +380,12 @@ export class EditorPage { */ private async addBlockFromInserter( blockName: string, - inserter: BlockInserter + inserter: BlockInserter, + { noSearch }: { noSearch?: boolean } = {} ): Promise< void > { - await inserter.searchBlockInserter( blockName ); + if ( ! noSearch ) { + await inserter.searchBlockInserter( blockName ); + } await inserter.selectBlockInserterResult( blockName ); } diff --git a/test/e2e/specs/blocks/blocks__media.ts b/test/e2e/specs/blocks/blocks__media.ts index b954a8a2303648..4ddde2a2116d38 100644 --- a/test/e2e/specs/blocks/blocks__media.ts +++ b/test/e2e/specs/blocks/blocks__media.ts @@ -63,7 +63,8 @@ describe( DataHelper.createSuiteTitle( 'Blocks: Media (Upload)' ), function () { it( `${ ImageBlock.blockName } block: upload image file with reserved URL characters`, async function () { const blockHandle = await editorPage.addBlockFromSidebar( ImageBlock.blockName, - ImageBlock.blockEditorSelector + ImageBlock.blockEditorSelector, + { noSearch: true } ); const imageBlock = new ImageBlock( blockHandle ); await imageBlock.upload( testFiles.imageReservedName.fullpath ); @@ -72,7 +73,8 @@ describe( DataHelper.createSuiteTitle( 'Blocks: Media (Upload)' ), function () { it( `${ ImageBlock.blockName } block: upload image file using Calypso media modal `, async function () { const blockHandle = await editorPage.addBlockFromSidebar( ImageBlock.blockName, - ImageBlock.blockEditorSelector + ImageBlock.blockEditorSelector, + { noSearch: true } ); const imageBlock = new ImageBlock( blockHandle ); await imageBlock.uploadThroughMediaLibrary( testFiles.image.fullpath ); @@ -81,7 +83,8 @@ describe( DataHelper.createSuiteTitle( 'Blocks: Media (Upload)' ), function () { it( `${ AudioBlock.blockName } block: upload audio file`, async function () { const blockHandle = await editorPage.addBlockFromSidebar( AudioBlock.blockName, - AudioBlock.blockEditorSelector + AudioBlock.blockEditorSelector, + { noSearch: true } ); const audioBlock = new AudioBlock( blockHandle ); await audioBlock.upload( testFiles.audio.fullpath ); @@ -90,7 +93,8 @@ describe( DataHelper.createSuiteTitle( 'Blocks: Media (Upload)' ), function () { it( `${ FileBlock.blockName } block: upload audio file`, async function () { const blockHandle = await editorPage.addBlockFromSidebar( FileBlock.blockName, - FileBlock.blockEditorSelector + FileBlock.blockEditorSelector, + { noSearch: true } ); const fileBlock = new FileBlock( blockHandle ); await fileBlock.upload( testFiles.audio.fullpath ); diff --git a/test/e2e/specs/editor/editor__post-advanced-flow.ts b/test/e2e/specs/editor/editor__post-advanced-flow.ts index 319269a1a04cd5..46290bacc3f337 100644 --- a/test/e2e/specs/editor/editor__post-advanced-flow.ts +++ b/test/e2e/specs/editor/editor__post-advanced-flow.ts @@ -58,7 +58,8 @@ describe( DataHelper.createSuiteTitle( `Editor: Advanced Post Flow` ), function it( 'Enter post content', async function () { const blockHandle = await editorPage.addBlockFromSidebar( ParagraphBlock.blockName, - ParagraphBlock.blockEditorSelector + ParagraphBlock.blockEditorSelector, + { noSearch: true } ); paragraphBlock = new ParagraphBlock( blockHandle ); await paragraphBlock.enterParagraph( originalContent ); @@ -97,7 +98,8 @@ describe( DataHelper.createSuiteTitle( `Editor: Advanced Post Flow` ), function it( 'Append additional content', async function () { const blockHandle = await editorPage.addBlockFromSidebar( ParagraphBlock.blockName, - ParagraphBlock.blockEditorSelector + ParagraphBlock.blockEditorSelector, + { noSearch: true } ); paragraphBlock = new ParagraphBlock( blockHandle ); await paragraphBlock.enterParagraph( additionalContent );