Skip to content

Commit

Permalink
change css selectors to use role instead
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieCabrera committed Feb 8, 2023
1 parent 0a0e499 commit 2513515
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/e2e/specs/editor/blocks/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ test.describe(

await editor.insertBlock( { name: 'core/navigation' } );

//check the block in the canvas.
await expect(
editor.canvas.locator(
'role=textbox[name="Navigation link text"i] >> text="WordPress"'
)
).toBeVisible();

// Check the markup of the block is correct.
await editor.publishPost();
await expect.poll( editor.getBlocks ).toMatchObject( [
Expand All @@ -85,18 +92,11 @@ test.describe(
] );
await page.locator( 'role=button[name="Close panel"i]' ).click();

//check the block in the canvas.
await expect(
page.locator(
'role=gridcell[name="Custom Link link"] >> a:has-text("WordPress")'
)
).toBeVisible();

//check the block in the frontend.
await page.goto( '/' );
await expect(
page.locator(
'nav:has-text("WordPress") >> role=link[name="WordPress"]'
'role=navigation >> nth=1 >> role=link[name="WordPress"]'
)
).toBeVisible();
} );
Expand Down

0 comments on commit 2513515

Please sign in to comment.