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

Fix flaky Site Editor title e2e tests #49203

Merged
merged 1 commit into from
Mar 21, 2023
Merged
Changes from all commits
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
9 changes: 3 additions & 6 deletions test/e2e/specs/site-editor/title.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ test.describe( 'Site editor title', () => {
test( 'displays the selected template name in the title for the index template', async ( {
admin,
page,
editor,
} ) => {
// Navigate to a template.
await admin.visitSiteEditor( {
postId: 'emptytheme//index',
postType: 'wp_template',
canvas: 'edit',
} );
await editor.canvas.click( 'body' );
const title = page.locator(
'role=region[name="Editor top bar"i] >> role=heading[level=1]'
);
Expand All @@ -33,14 +32,13 @@ test.describe( 'Site editor title', () => {
test( 'displays the selected template name in the title for the header template', async ( {
admin,
page,
editor,
} ) => {
// Navigate to a template part.
await admin.visitSiteEditor( {
postId: 'emptytheme//header',
postType: 'wp_template_part',
canvas: 'edit',
} );
await editor.canvas.click( 'body' );
const title = page.locator(
'role=region[name="Editor top bar"i] >> role=heading[level=1]'
);
Expand All @@ -51,13 +49,12 @@ test.describe( 'Site editor title', () => {
test( "displays the selected template part's name in the secondary title when a template part is selected from List View", async ( {
admin,
page,
editor,
} ) => {
await admin.visitSiteEditor( {
postId: 'emptytheme//index',
postType: 'wp_template',
canvas: 'edit',
} );
await editor.canvas.click( 'body' );
// Select the header template part via list view.
await page.click( 'role=button[name="List View"i]' );
const listView = page.locator(
Expand Down