Skip to content

Commit

Permalink
Add role locators intead of class and assert both state
Browse files Browse the repository at this point in the history
  • Loading branch information
alvitazwar committed Oct 24, 2022
1 parent ed80952 commit 95caf94
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/e2e/specs/site-editor/site-editor-inserter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,19 @@ test.describe( 'Site Editor Inserter', () => {
page,
} ) => {
await page.click( 'role=button[name="Toggle block inserter"i]' );

// Visibility check
await expect(
page.locator( 'role=region[name="Block Library"i]' )
page.locator(
'role=searchbox[name="Search for blocks and 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]'
)
).toBeHidden();
} );
} );

0 comments on commit 95caf94

Please sign in to comment.