Skip to content

Commit

Permalink
update some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Oct 26, 2022
1 parent d5182ed commit 464152b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/e2e-tests/specs/widgets/editing-widgets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe( 'Widgets screen', () => {

const searchBox = await find( {
role: 'searchbox',
name: 'Search for blocks and patterns',
name: 'Search for blocks',
} );
await searchBox.type( blockName );

Expand Down
5 changes: 1 addition & 4 deletions test/e2e/specs/editor/blocks/group.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ test.describe( 'Group', () => {

await inserterButton.click();

await page.type(
'role=searchbox[name="Search for blocks and patterns"i]',
'Group'
);
await page.type( 'role=searchbox[name="Search for blocks"i]', 'Group' );

await page.click(
'role=listbox[name="Blocks"i] >> role=option[name="Group"i]'
Expand Down
18 changes: 14 additions & 4 deletions test/e2e/specs/editor/various/inserting-blocks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ test.describe( 'Inserting blocks (@firefox, @webkit)', () => {
'role=region[name="Editor top bar"i] >> role=button[name="Toggle block inserter"i]'
);

// TODO: need to await for the search input when the tabs are loaded.
await page.fill(
'role=region[name="Block Library"i] >> role=searchbox[name="Search for blocks and patterns"i]',
'role=region[name="Block Library"i] >> role=searchbox[name="Search for blocks"i]',
'Heading'
);

Expand Down Expand Up @@ -119,8 +120,9 @@ test.describe( 'Inserting blocks (@firefox, @webkit)', () => {
'role=region[name="Editor top bar"i] >> role=button[name="Toggle block inserter"i]'
);

// TODO: need to await for the search input when the tabs are loaded.
await page.fill(
'role=region[name="Block Library"i] >> role=searchbox[name="Search for blocks and patterns"i]',
'role=region[name="Block Library"i] >> role=searchbox[name="Search for blocks"i]',
'Heading'
);

Expand Down Expand Up @@ -179,10 +181,14 @@ test.describe( 'Inserting blocks (@firefox, @webkit)', () => {
'role=region[name="Editor top bar"i] >> role=button[name="Toggle block inserter"i]'
);

await page.click(
'role=region[name="Block Library"i] >> role=tab[name="Patterns"i]'
);

const PATTERN_NAME = 'Social links with a shared background color';

await page.fill(
'role=region[name="Block Library"i] >> role=searchbox[name="Search for blocks and patterns"i]',
'role=region[name="Block Library"i] >> role=searchbox[name="Search for patterns"i]',
PATTERN_NAME
);

Expand Down Expand Up @@ -247,10 +253,14 @@ test.describe( 'Inserting blocks (@firefox, @webkit)', () => {
'role=region[name="Editor top bar"i] >> role=button[name="Toggle block inserter"i]'
);

await page.click(
'role=region[name="Block Library"i] >> role=tab[name="Patterns"i]'
);

const PATTERN_NAME = 'Social links with a shared background color';

await page.fill(
'role=region[name="Block Library"i] >> role=searchbox[name="Search for blocks and patterns"i]',
'role=region[name="Block Library"i] >> role=searchbox[name="Search for patterns"i]',
PATTERN_NAME
);

Expand Down
8 changes: 2 additions & 6 deletions test/e2e/specs/site-editor/site-editor-inserter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,12 @@ test.describe( 'Site Editor Inserter', () => {

// Visibility check
await expect(
page.locator(
'role=searchbox[name="Search for blocks and patterns"i]'
)
page.locator( 'role=searchbox[name="Search for patterns"i]' )
).toBeVisible();
await page.click( 'role=button[name="Toggle block inserter"i]' );
//Hidden State check
await expect(
page.locator(
'role=searchbox[name="Search for blocks and patterns"i]'
)
page.locator( 'role=searchbox[name="Search for patterns"i]' )
).toBeHidden();
} );
} );
2 changes: 1 addition & 1 deletion test/e2e/specs/widgets/customizing-widgets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ class WidgetsCustomizerPage {
);

const searchBox = this.page.locator(
'role=searchbox[name="Search for blocks and patterns"i]'
'role=searchbox[name="Search for blocks"i]'
);

// Clear the input.
Expand Down

0 comments on commit 464152b

Please sign in to comment.