[e2e tests] Fix flaky navigation to editor (#50841)

This commit is contained in:
Adrian Moldovan 2024-08-21 20:18:20 +01:00 committed by GitHub
parent 94d3b2e05c
commit e1e628ccf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 6 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev

View File

@ -39,21 +39,23 @@ const getCanvas = async ( page ) => {
};
const goToPageEditor = async ( { page } ) => {
await page.goto( 'wp-admin/post-new.php?post_type=page' );
await disableWelcomeModal( { page } );
await page.waitForResponse(
const responsePromise = page.waitForResponse(
( response ) =>
response.url().includes( '//page' ) && response.status() === 200
);
await page.goto( 'wp-admin/post-new.php?post_type=page' );
await disableWelcomeModal( { page } );
await responsePromise;
};
const goToPostEditor = async ( { page } ) => {
await page.goto( 'wp-admin/post-new.php' );
await disableWelcomeModal( { page } );
await page.waitForResponse(
const responsePromise = page.waitForResponse(
( response ) =>
response.url().includes( '//single' ) && response.status() === 200
);
await page.goto( 'wp-admin/post-new.php' );
await disableWelcomeModal( { page } );
await responsePromise;
};
const fillPageTitle = async ( page, title ) => {