Skip to content

Commit

Permalink
update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Dec 3, 2024
1 parent 2febddc commit 94f89ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 3 additions & 1 deletion test/e2e/specs/site-editor/browser-history.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ test.describe( 'Site editor browser history', () => {

// Navigate to a single template
await page.click( 'role=button[name="Templates"]' );
await page.getByRole( 'link', { name: 'Index' } ).click();
await page
.locator( '.fields-title-field', { hasText: 'Index' } )
.click();
await expect( page ).toHaveURL(
'/wp-admin/site-editor.php?p=%2Fwp_template%2Femptytheme%2F%2Findex&canvas=edit'
);
Expand Down
12 changes: 2 additions & 10 deletions test/e2e/specs/site-editor/new-templates-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ test.describe( 'Templates', () => {
page.locator( '[aria-label="Templates"]' )
).toBeVisible();

const firstTitle = page
.getByRole( 'region', {
name: 'Template',
includeHidden: true,
} )
.getByRole( 'link', { includeHidden: true } )
.first();
const firstTitle = page.locator( '.fields-title-field' ).first();

// Descending by title.
await page.getByRole( 'button', { name: 'View options' } ).click();
Expand All @@ -54,9 +48,7 @@ test.describe( 'Templates', () => {
await admin.visitSiteEditor( { postType: 'wp_template' } );
// Global search.
await page.getByRole( 'searchbox', { name: 'Search' } ).fill( 'tag' );
const titles = page
.getByRole( 'region', { name: 'Template' } )
.getByRole( 'link', { includeHidden: true } );
const titles = page.locator( '.fields-title-field' );
await expect( titles ).toHaveCount( 1 );
await expect( titles.first() ).toHaveText( 'Tag Archives' );
await page
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/site-editor/template-registration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ test.describe( 'Block template registration', () => {
.getByLabel( 'Dismiss this notice' )
.getByText( `"Author: Admin" reset.` );
await page.getByPlaceholder( 'Search' ).fill( 'Author: admin' );
await page.getByRole( 'link', { name: 'Author: Admin' } ).click();
await page.getByRole( 'button', { name: 'Author: Admin' } ).click();
const actions = page.getByLabel( 'Actions' );
await actions.first().click();
await page.getByRole( 'menuitem', { name: 'Reset' } ).click();
Expand Down

0 comments on commit 94f89ff

Please sign in to comment.