Skip to content

Commit

Permalink
E2E: Fix the LOHP theme test (#97346)
Browse files Browse the repository at this point in the history
Some back-and-forth to try and unflaky this test... Mix of race condition abort/goto and not being able to hover->click.

---------

Co-authored-by: Marin Atanasov <[email protected]>
  • Loading branch information
aidvu and tyxla authored Dec 12, 2024
1 parent 457fec4 commit bf61b60
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/e2e/specs/onboarding/signup__with-theme-LOHP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,17 @@ describe( 'Lifecyle: Logged Out Home Page, signup, onboard, launch and cancel su
themeButtonUrl.protocol = calypsoUrl.protocol;

await route.abort();
await page.goto( themeButtonUrl.href );
await page.unrouteAll( { behavior: 'ignoreErrors' } );
await page.goto( themeButtonUrl.href, { waitUntil: 'load' } );
} );
}
// Get theme slug
const pageMatch = new URL( themeButtonUrl.href ).search.match( 'theme=([a-z]*)?&' );
themeSlug = pageMatch?.[ 1 ] || null;

// Hover, otherwise the element isn't considered stable, and is out of the viewport.
await themeCard.hover();
await themeCard.getByText( 'Start with this theme' ).click();
await themeCard.hover( { force: true } );
await themeCard.getByText( 'Start with this theme' ).click( { force: true } );
} );

it( 'Sign up as new user', async function () {
Expand Down

0 comments on commit bf61b60

Please sign in to comment.