Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the verb Toggle from the Block Inserter button. #65983

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/e2e-test-utils/src/inserter.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ async function isGlobalInserterOpen() {
return !! document.querySelector(
'.edit-post-header [aria-label="Add block"].is-pressed,' +
'.edit-site-header-edit-mode [aria-label="Add block"].is-pressed,' +
'.edit-post-header [aria-label="Toggle block inserter"].is-pressed,' +
'.edit-site-header [aria-label="Toggle block inserter"].is-pressed,' +
'.edit-widgets-header [aria-label="Toggle block inserter"].is-pressed,' +
'.edit-post-header [aria-label="Block Inserter"].is-pressed,' +
'.edit-site-header [aria-label="Block Inserter"].is-pressed,' +
'.edit-widgets-header [aria-label="Block Inserter"].is-pressed,' +
'.edit-widgets-header [aria-label="Add block"].is-pressed,' +
'.edit-site-header-edit-mode__inserter-toggle.is-pressed,' +
'.editor-header [aria-label="Toggle block inserter"].is-pressed'
'.editor-header [aria-label="Block Inserter"].is-pressed'
);
} );
}
Expand All @@ -68,10 +68,10 @@ export async function toggleGlobalBlockInserter() {
'.editor-document-tools__inserter-toggle,' +
'.edit-post-header [aria-label="Add block"],' +
'.edit-site-header [aria-label="Add block"],' +
'.edit-post-header [aria-label="Toggle block inserter"],' +
'.edit-site-header [aria-label="Toggle block inserter"],' +
'.edit-post-header [aria-label="Block Inserter"],' +
'.edit-site-header [aria-label="Block Inserter"],' +
'.edit-widgets-header [aria-label="Add block"],' +
'.edit-widgets-header [aria-label="Toggle block inserter"],' +
'.edit-widgets-header [aria-label="Block Inserter"],' +
'.edit-site-header-edit-mode__inserter-toggle'
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function DocumentTools() {
/* translators: button label text should, if possible, be under 16
characters. */
label={ _x(
'Toggle block inserter',
'Block Inserter',
'Generic label for block inserter button'
) }
size="compact"
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/components/document-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function DocumentTools( { className, disableBlockTools = false } ) {

/* translators: button label text should, if possible, be under 16 characters. */
const longLabel = _x(
'Toggle block inserter',
'Block Inserter',
'Generic label for block inserter button'
);
const shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );
Expand Down
6 changes: 2 additions & 4 deletions test/e2e/specs/editor/blocks/columns.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ test.describe( 'Columns', () => {
.first()
.click();

// Toggle Block inserter
await page
.locator( 'role=button[name="Toggle block inserter"i]' )
.click();
// Block Inserter
await page.locator( 'role=button[name="Block Inserter"i]' ).click();

// Verify Column
const inserterOptions = page.locator(
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/blocks/group.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test.describe( 'Group', () => {
} ) => {
// Search for the group block and insert it.
const inserterButton = page.locator(
'role=button[name="Toggle block inserter"i]'
'role=button[name="Block Inserter"i]'
);

await inserterButton.click();
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/blocks/image.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@

async function openMediaTab() {
const blockInserter = page.getByRole( 'button', {
name: 'Toggle block inserter',
name: 'Block Inserter',
} );
const isClosed =
( await blockInserter.getAttribute( 'aria-pressed' ) ) ===

Check failure on line 443 in test/e2e/specs/editor/blocks/image.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 1

[chromium] › editor/blocks/image.spec.js:423:2 › Image › can be replaced by dragging-and-dropping images from the inserter

1) [chromium] › editor/blocks/image.spec.js:423:2 › Image › can be replaced by dragging-and-dropping images from the inserter Error: locator.getAttribute: Error: strict mode violation: getByRole('button', { name: 'Block Inserter' }) resolved to 2 elements: 1) <button id=":r1:" type="button" aria-pressed="true" aria-expanded="true" data-active-item="true" data-toolbar-item="true" aria-label="Block Inserter" class="components-button editor-document-tools__inserter-toggle is-primary is-pressed has-icon">…</button> aka getByLabel('Block Inserter', { exact: true }) 2) <button type="button" aria-label="Close block inserter" class="components-button block-editor-tabbed-sidebar__close-button is-small has-icon">…</button> aka getByLabel('Close block inserter') Call log: - waiting for getByRole('button', { name: 'Block Inserter' }) 441 | } ); 442 | const isClosed = > 443 | ( await blockInserter.getAttribute( 'aria-pressed' ) ) === | ^ 444 | 'false'; 445 | 446 | if ( isClosed ) { at openMediaTab (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/image.spec.js:443:27) at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/image.spec.js:491:9

Check failure on line 443 in test/e2e/specs/editor/blocks/image.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 1

[chromium] › editor/blocks/image.spec.js:423:2 › Image › can be replaced by dragging-and-dropping images from the inserter

1) [chromium] › editor/blocks/image.spec.js:423:2 › Image › can be replaced by dragging-and-dropping images from the inserter Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.getAttribute: Error: strict mode violation: getByRole('button', { name: 'Block Inserter' }) resolved to 2 elements: 1) <button id=":r1:" type="button" aria-pressed="true" aria-expanded="true" data-active-item="true" data-toolbar-item="true" aria-label="Block Inserter" class="components-button editor-document-tools__inserter-toggle is-primary is-pressed has-icon">…</button> aka getByLabel('Block Inserter', { exact: true }) 2) <button type="button" aria-label="Close block inserter" class="components-button block-editor-tabbed-sidebar__close-button is-small has-icon">…</button> aka getByLabel('Close block inserter') Call log: - waiting for getByRole('button', { name: 'Block Inserter' }) 441 | } ); 442 | const isClosed = > 443 | ( await blockInserter.getAttribute( 'aria-pressed' ) ) === | ^ 444 | 'false'; 445 | 446 | if ( isClosed ) { at openMediaTab (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/image.spec.js:443:27) at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/image.spec.js:491:9

Check failure on line 443 in test/e2e/specs/editor/blocks/image.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 1

[chromium] › editor/blocks/image.spec.js:423:2 › Image › can be replaced by dragging-and-dropping images from the inserter

1) [chromium] › editor/blocks/image.spec.js:423:2 › Image › can be replaced by dragging-and-dropping images from the inserter Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.getAttribute: Error: strict mode violation: getByRole('button', { name: 'Block Inserter' }) resolved to 2 elements: 1) <button id=":r1:" type="button" aria-pressed="true" aria-expanded="true" data-active-item="true" data-toolbar-item="true" aria-label="Block Inserter" class="components-button editor-document-tools__inserter-toggle is-primary is-pressed has-icon">…</button> aka getByLabel('Block Inserter', { exact: true }) 2) <button type="button" aria-label="Close block inserter" class="components-button block-editor-tabbed-sidebar__close-button is-small has-icon">…</button> aka getByLabel('Close block inserter') Call log: - waiting for getByRole('button', { name: 'Block Inserter' }) 441 | } ); 442 | const isClosed = > 443 | ( await blockInserter.getAttribute( 'aria-pressed' ) ) === | ^ 444 | 'false'; 445 | 446 | if ( isClosed ) { at openMediaTab (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/image.spec.js:443:27) at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/image.spec.js:491:9
'false';

if ( isClosed ) {
Expand Down
4 changes: 1 addition & 3 deletions test/e2e/specs/editor/plugins/allowed-blocks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ test.describe( 'Allowed Blocks Filter', () => {
page,
} ) => {
// The paragraph block is available.
await page
.getByRole( 'button', { name: 'Toggle block inserter' } )
.click();
await page.getByRole( 'button', { name: 'Block Inserter' } ).click();

const searchbox = page
.getByRole( 'region', { name: 'Block Library' } )
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/plugins/block-directory.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ test.describe( 'Block Directory', () => {

await page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } )
.getByRole( 'button', { name: 'Block Inserter' } )
.click();

const blockLibrary = page.getByRole( 'region', {
Expand Down Expand Up @@ -209,7 +209,7 @@ test.describe( 'Block Directory', () => {

await page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } )
.getByRole( 'button', { name: 'Block Inserter' } )
.click();

const blockLibrary = page.getByRole( 'region', {
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/specs/editor/plugins/block-icons.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test.describe( 'Block Icons', () => {
test( 'Block with svg icon', async ( { editor, page } ) => {
await page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } )
.getByRole( 'button', { name: 'Block Inserter' } )
.click();

const blockLibrary = page.getByRole( 'region', {
Expand Down Expand Up @@ -60,7 +60,7 @@ test.describe( 'Block Icons', () => {
test( 'Block with dash icon', async ( { editor, page } ) => {
await page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } )
.getByRole( 'button', { name: 'Block Inserter' } )
.click();

const blockLibrary = page.getByRole( 'region', {
Expand Down Expand Up @@ -100,7 +100,7 @@ test.describe( 'Block Icons', () => {
test( 'Block with function icon', async ( { editor, page } ) => {
await page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } )
.getByRole( 'button', { name: 'Block Inserter' } )
.click();

const blockLibrary = page.getByRole( 'region', {
Expand Down Expand Up @@ -137,7 +137,7 @@ test.describe( 'Block Icons', () => {
} ) => {
await page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } )
.getByRole( 'button', { name: 'Block Inserter' } )
.click();

const blockLibrary = page.getByRole( 'region', {
Expand Down Expand Up @@ -185,7 +185,7 @@ test.describe( 'Block Icons', () => {
} ) => {
await page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } )
.getByRole( 'button', { name: 'Block Inserter' } )
.click();

const blockLibrary = page.getByRole( 'region', {
Expand Down
8 changes: 2 additions & 6 deletions test/e2e/specs/editor/plugins/block-variations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ test.describe( 'Block variations', () => {
test( 'Search for the overridden default Quote block', async ( {
page,
} ) => {
await page
.getByRole( 'button', { name: 'Toggle block inserter' } )
.click();
await page.getByRole( 'button', { name: 'Block Inserter' } ).click();

await page
.getByRole( 'region', { name: 'Block Library' } )
Expand Down Expand Up @@ -62,9 +60,7 @@ test.describe( 'Block variations', () => {
test( 'Search for the Paragraph block with 2 additional variations', async ( {
page,
} ) => {
await page
.getByRole( 'button', { name: 'Toggle block inserter' } )
.click();
await page.getByRole( 'button', { name: 'Block Inserter' } ).click();

await page
.getByRole( 'region', { name: 'Block Library' } )
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/specs/editor/plugins/child-blocks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test.describe( 'Child Blocks', () => {
test( 'are hidden from the global block inserter', async ( { page } ) => {
const blockInserter = page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } );
.getByRole( 'button', { name: 'Block Inserter' } );
const blockLibrary = page.getByRole( 'region', {
name: 'Block Library',
} );
Expand Down Expand Up @@ -47,7 +47,7 @@ test.describe( 'Child Blocks', () => {

const blockInserter = page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } );
.getByRole( 'button', { name: 'Block Inserter' } );
const blockLibrary = page
.getByRole( 'region', {
name: 'Block Library',
Expand Down Expand Up @@ -85,7 +85,7 @@ test.describe( 'Child Blocks', () => {

const blockInserter = page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } );
.getByRole( 'button', { name: 'Block Inserter' } );
const blockLibrary = page
.getByRole( 'region', {
name: 'Block Library',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test.describe( 'Allowed Blocks Setting on InnerBlocks', () => {

const blockInserter = page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } );
.getByRole( 'button', { name: 'Block Inserter' } );
const blockLibrary = page
.getByRole( 'region', {
name: 'Block Library',
Expand Down Expand Up @@ -92,7 +92,7 @@ test.describe( 'Allowed Blocks Setting on InnerBlocks', () => {

const blockInserter = page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } );
.getByRole( 'button', { name: 'Block Inserter' } );
const blockLibrary = page
.getByRole( 'region', {
name: 'Block Library',
Expand Down
6 changes: 2 additions & 4 deletions test/e2e/specs/editor/plugins/pattern-recursion.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ test.describe( 'Preventing Pattern Recursion (server)', () => {
page,
editor,
} ) => {
// Click the Toggle block inserter button
await page
.getByRole( 'button', { name: 'Toggle block inserter' } )
.click();
// Click the Block Inserter button
await page.getByRole( 'button', { name: 'Block Inserter' } ).click();
// Click the Patterns tab
await page.getByRole( 'tab', { name: 'Patterns' } ).click();
// Click the Uncategorized tab
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/plugins/post-type-locking.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ test.describe( 'Post-type locking', () => {
await expect(
page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } )
.getByRole( 'button', { name: 'Block Inserter' } )
).toBeEnabled();

await editor.insertBlock( { name: 'core/list' } );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test.describe( 'Register block type hooks', () => {
} );

test( 'has a custom category for Paragraph block', async ( { page } ) => {
await page.click( 'role=button[name="Toggle block inserter"i]' );
await page.click( 'role=button[name="Block Inserter"i]' );

expect(
page.locator(
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/various/a11y.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ test.describe( 'a11y (@firefox, @webkit)', () => {

// This test assumes the Editor is not in Fullscreen mode. Check the
// first tabbable element within the 'Editor top bar' region is the
// 'Toggle block inserter' button.
// 'Block Inserter' button.
await pageUtils.pressKeys( 'Tab' );
await expect(
page.locator( 'role=button[name=/Toggle block inserter/i]' )
page.locator( 'role=button[name=/Block Inserter/i]' )
).toBeFocused();
} );

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/various/adding-patterns.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test.describe( 'adding patterns', () => {
} );

test( 'should insert a block pattern', async ( { page, editor } ) => {
await page.getByLabel( 'Toggle block inserter' ).click();
await page.getByLabel( 'Block Inserter' ).click();

await page.getByRole( 'tab', { name: 'Patterns' } ).click();
await page.fill(
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/various/allowed-patterns.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test.describe( 'Allowed Patterns', () => {
await admin.createNewPost();
await page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } )
.getByRole( 'button', { name: 'Block Inserter' } )
.click();

await page
Expand Down Expand Up @@ -61,7 +61,7 @@ test.describe( 'Allowed Patterns', () => {
await admin.createNewPost();
await page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } )
.getByRole( 'button', { name: 'Block Inserter' } )
.click();

await page
Expand Down
24 changes: 6 additions & 18 deletions test/e2e/specs/editor/various/block-visibility.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
} )
.getByRole( 'button', { name: 'Close' } )
.click();
await page
.getByRole( 'button', { name: 'Toggle block inserter' } )
.click();
await page.getByRole( 'button', { name: 'Block Inserter' } ).click();
await page
.getByRole( 'region', { name: 'Block Library' } )
.getByRole( 'searchbox', {
Expand All @@ -59,9 +57,7 @@
'Heading block should not be visible'
).toBeHidden();

await page
.getByRole( 'button', { name: 'Toggle block inserter' } )
.click();
await page.getByRole( 'button', { name: 'Block Inserter' } ).click();

Check failure on line 60 in test/e2e/specs/editor/various/block-visibility.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 3

[chromium] › editor/various/block-visibility.spec.js:29:2 › Block Visibility › should hide/show the block

1) [chromium] › editor/various/block-visibility.spec.js:29:2 › Block Visibility › should hide/show the block Error: locator.click: Error: strict mode violation: getByRole('button', { name: 'Block Inserter' }) resolved to 2 elements: 1) <button id=":r1:" type="button" aria-pressed="true" aria-expanded="true" data-active-item="true" data-toolbar-item="true" aria-label="Block Inserter" class="components-button editor-document-tools__inserter-toggle is-primary is-pressed has-icon">…</button> aka getByLabel('Block Inserter', { exact: true }) 2) <button type="button" aria-label="Close block inserter" class="components-button block-editor-tabbed-sidebar__close-button is-small has-icon">…</button> aka getByLabel('Close block inserter') Call log: - waiting for getByRole('button', { name: 'Block Inserter' }) 58 | ).toBeHidden(); 59 | > 60 | await page.getByRole( 'button', { name: 'Block Inserter' } ).click(); | ^ 61 | 62 | // Show heading block again. 63 | await BlockVisibilityUtils.openBlockVisibilityManager(); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/block-visibility.spec.js:60:64

Check failure on line 60 in test/e2e/specs/editor/various/block-visibility.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 3

[chromium] › editor/various/block-visibility.spec.js:29:2 › Block Visibility › should hide/show the block

1) [chromium] › editor/various/block-visibility.spec.js:29:2 › Block Visibility › should hide/show the block Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Error: strict mode violation: getByRole('button', { name: 'Block Inserter' }) resolved to 2 elements: 1) <button id=":r1:" type="button" aria-pressed="true" aria-expanded="true" data-active-item="true" data-toolbar-item="true" aria-label="Block Inserter" class="components-button editor-document-tools__inserter-toggle is-primary is-pressed has-icon">…</button> aka getByLabel('Block Inserter', { exact: true }) 2) <button type="button" aria-label="Close block inserter" class="components-button block-editor-tabbed-sidebar__close-button is-small has-icon">…</button> aka getByLabel('Close block inserter') Call log: - waiting for getByRole('button', { name: 'Block Inserter' }) 58 | ).toBeHidden(); 59 | > 60 | await page.getByRole( 'button', { name: 'Block Inserter' } ).click(); | ^ 61 | 62 | // Show heading block again. 63 | await BlockVisibilityUtils.openBlockVisibilityManager(); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/block-visibility.spec.js:60:64

Check failure on line 60 in test/e2e/specs/editor/various/block-visibility.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 3

[chromium] › editor/various/block-visibility.spec.js:29:2 › Block Visibility › should hide/show the block

1) [chromium] › editor/various/block-visibility.spec.js:29:2 › Block Visibility › should hide/show the block Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Error: strict mode violation: getByRole('button', { name: 'Block Inserter' }) resolved to 2 elements: 1) <button id=":r1:" type="button" aria-pressed="true" aria-expanded="true" data-active-item="true" data-toolbar-item="true" aria-label="Block Inserter" class="components-button editor-document-tools__inserter-toggle is-primary is-pressed has-icon">…</button> aka getByLabel('Block Inserter', { exact: true }) 2) <button type="button" aria-label="Close block inserter" class="components-button block-editor-tabbed-sidebar__close-button is-small has-icon">…</button> aka getByLabel('Close block inserter') Call log: - waiting for getByRole('button', { name: 'Block Inserter' }) 58 | ).toBeHidden(); 59 | > 60 | await page.getByRole( 'button', { name: 'Block Inserter' } ).click(); | ^ 61 | 62 | // Show heading block again. 63 | await BlockVisibilityUtils.openBlockVisibilityManager(); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/block-visibility.spec.js:60:64

// Show heading block again.
await BlockVisibilityUtils.openBlockVisibilityManager();
Expand All @@ -83,9 +79,7 @@
} )
.getByRole( 'button', { name: 'Close' } )
.click();
await page
.getByRole( 'button', { name: 'Toggle block inserter' } )
.click();
await page.getByRole( 'button', { name: 'Block Inserter' } ).click();
await page
.getByRole( 'region', { name: 'Block Library' } )
.getByRole( 'searchbox', {
Expand Down Expand Up @@ -117,9 +111,7 @@
} )
.getByRole( 'button', { name: 'Close' } )
.click();
await page
.getByRole( 'button', { name: 'Toggle block inserter' } )
.click();
await page.getByRole( 'button', { name: 'Block Inserter' } ).click();

await expect(
page
Expand All @@ -128,9 +120,7 @@
'Media category should not be visible'
).toBeHidden();

await page
.getByRole( 'button', { name: 'Toggle block inserter' } )
.click();
await page.getByRole( 'button', { name: 'Block Inserter' } ).click();

Check failure on line 123 in test/e2e/specs/editor/various/block-visibility.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 3

[chromium] › editor/various/block-visibility.spec.js:98:2 › Block Visibility › should hide/show all blocks in a category at once

2) [chromium] › editor/various/block-visibility.spec.js:98:2 › Block Visibility › should hide/show all blocks in a category at once Error: locator.click: Error: strict mode violation: getByRole('button', { name: 'Block Inserter' }) resolved to 2 elements: 1) <button id=":r1:" type="button" aria-pressed="true" aria-expanded="true" data-active-item="true" data-toolbar-item="true" aria-label="Block Inserter" class="components-button editor-document-tools__inserter-toggle is-primary is-pressed has-icon">…</button> aka getByLabel('Block Inserter', { exact: true }) 2) <button type="button" aria-label="Close block inserter" class="components-button block-editor-tabbed-sidebar__close-button is-small has-icon">…</button> aka getByLabel('Close block inserter') Call log: - waiting for getByRole('button', { name: 'Block Inserter' }) 121 | ).toBeHidden(); 122 | > 123 | await page.getByRole( 'button', { name: 'Block Inserter' } ).click(); | ^ 124 | 125 | // Show Media category blocks again. 126 | await BlockVisibilityUtils.openBlockVisibilityManager(); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/block-visibility.spec.js:123:64

Check failure on line 123 in test/e2e/specs/editor/various/block-visibility.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 3

[chromium] › editor/various/block-visibility.spec.js:98:2 › Block Visibility › should hide/show all blocks in a category at once

2) [chromium] › editor/various/block-visibility.spec.js:98:2 › Block Visibility › should hide/show all blocks in a category at once Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Error: strict mode violation: getByRole('button', { name: 'Block Inserter' }) resolved to 2 elements: 1) <button id=":r1:" type="button" aria-pressed="true" aria-expanded="true" data-active-item="true" data-toolbar-item="true" aria-label="Block Inserter" class="components-button editor-document-tools__inserter-toggle is-primary is-pressed has-icon">…</button> aka getByLabel('Block Inserter', { exact: true }) 2) <button type="button" aria-label="Close block inserter" class="components-button block-editor-tabbed-sidebar__close-button is-small has-icon">…</button> aka getByLabel('Close block inserter') Call log: - waiting for getByRole('button', { name: 'Block Inserter' }) 121 | ).toBeHidden(); 122 | > 123 | await page.getByRole( 'button', { name: 'Block Inserter' } ).click(); | ^ 124 | 125 | // Show Media category blocks again. 126 | await BlockVisibilityUtils.openBlockVisibilityManager(); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/block-visibility.spec.js:123:64

Check failure on line 123 in test/e2e/specs/editor/various/block-visibility.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 3

[chromium] › editor/various/block-visibility.spec.js:98:2 › Block Visibility › should hide/show all blocks in a category at once

2) [chromium] › editor/various/block-visibility.spec.js:98:2 › Block Visibility › should hide/show all blocks in a category at once Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Error: strict mode violation: getByRole('button', { name: 'Block Inserter' }) resolved to 2 elements: 1) <button id=":r1:" type="button" aria-pressed="true" aria-expanded="true" data-active-item="true" data-toolbar-item="true" aria-label="Block Inserter" class="components-button editor-document-tools__inserter-toggle is-primary is-pressed has-icon">…</button> aka getByLabel('Block Inserter', { exact: true }) 2) <button type="button" aria-label="Close block inserter" class="components-button block-editor-tabbed-sidebar__close-button is-small has-icon">…</button> aka getByLabel('Close block inserter') Call log: - waiting for getByRole('button', { name: 'Block Inserter' }) 121 | ).toBeHidden(); 122 | > 123 | await page.getByRole( 'button', { name: 'Block Inserter' } ).click(); | ^ 124 | 125 | // Show Media category blocks again. 126 | await BlockVisibilityUtils.openBlockVisibilityManager(); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/block-visibility.spec.js:123:64

// Show Media category blocks again.
await BlockVisibilityUtils.openBlockVisibilityManager();
Expand All @@ -152,9 +142,7 @@
} )
.getByRole( 'button', { name: 'Close' } )
.click();
await page
.getByRole( 'button', { name: 'Toggle block inserter' } )
.click();
await page.getByRole( 'button', { name: 'Block Inserter' } ).click();

await expect(
page
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/various/editor-modes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ test.describe( 'Editing modes (visual/HTML)', () => {
await expect(
page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } )
.getByRole( 'button', { name: 'Block Inserter' } )
).toBeDisabled();

// Go back to the visual editor.
Expand Down
Loading
Loading