How to use the @wordpress/e2e-test-utils.searchForBlock function in @wordpress/e2e-test-utils

To help you get started, we’ve selected a few @wordpress/e2e-test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ampproject / amp-wp / tests / e2e / specs / stories-editor / story-templates.js View on Github external
it( 'should display non-template reusable blocks in the regular block editor', async () => {
				await createNewPost();
				await searchForBlock( 'Reusable' );

				await expect( page ).not.toMatchElement( '.block-editor-inserter__no-results' );
			} );
		} );
github liip / bootstrap-blocks-wordpress-plugin / e2e-tests / column / column-block.spec.js View on Github external
it( 'Column block should not be available in block inserter', async () => {
		expect( console ).toHaveWarned();

		await searchForBlock( 'Bootstrap Column' );
		expect( await page.$( '.block-editor-inserter__no-results' ) ).not.toBeNull();
	} );
github ampproject / amp-wp / tests / e2e / specs / stories-editor / story-templates.js View on Github external
it( 'should hide story templates in the regular block editor', async () => {
			await createNewPost();
			await searchForBlock( 'Template' );

			await expect( page ).toMatchElement( '.block-editor-inserter__no-results' );
		} );
github liip / bootstrap-blocks-wordpress-plugin / e2e-tests / row / row-helper.js View on Github external
export const insertRowBlock = async () => {
	await searchForBlock( 'Bootstrap Row' );
	await page.click( 'button.editor-block-list-item-wp-bootstrap-blocks-row' );
};
github Automattic / jetpack / tests / e2e / lib / pages / wp-admin / block-editor.js View on Github external
async insertBlock( blockName, blockTitle ) {
		await searchForBlock( blockTitle );
		const blockIconSelector = `.editor-block-list-item-jetpack-${ blockName }`;
		const jetpackPanelSelector = '.components-panel__body .jetpack-logo';
		await scrollIntoView( this.page, jetpackPanelSelector );
		await waitAndClick( this.page, blockIconSelector );
		const blockInfo = await this.getInsertedBlock();
		return blockInfo;
	}