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

WIP: Fix flaky Site Editor writing flow tests #49754

Closed
wants to merge 2 commits into from
Closed
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
12 changes: 10 additions & 2 deletions test/e2e/specs/site-editor/writing-flow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ test.describe( 'Site editor writing flow', () => {
await admin.visitSiteEditor( {
postId: 'emptytheme//header',
postType: 'wp_template_part',
canvas: 'edit',
} );
await editor.canvas.click( 'body' );

// Wait for the template part to be loaded.
await page.waitForLoadState( 'networkidle' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wild idea: How about adding this to visitSiteEditor so that we solve all the site editor flakiness automatically? 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this gives me some ideas. I'll update in #49374.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 7aff89a!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also update visitSiteEditor and visitAdminPage to accept options passed to page.goto - https://playwright.dev/docs/api/class-page#page-goto-option-url.


// Select the first site title block.
const siteTitleBlock = editor.canvas.locator(
'role=document[name="Block: Site Title"i]'
Expand All @@ -51,8 +55,12 @@ test.describe( 'Site editor writing flow', () => {
await admin.visitSiteEditor( {
postId: 'emptytheme//header',
postType: 'wp_template_part',
canvas: 'edit',
} );
await editor.canvas.click( 'body' );

// Wait for the template part to be loaded.
await page.waitForLoadState( 'networkidle' );

// Make sure the sidebar is open.
await editor.openDocumentSettingsSidebar();

Expand Down