Skip to content

Commit b2bcc66

Browse files
committed
Fix a theme-activation navigation race in activateTheme().
1 parent 57ac625 commit b2bcc66

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎packages/e2e-test-utils/src/activate-theme.js‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ export async function activateTheme( slug ) {
2222
return;
2323
}
2424

25-
await page.click( `div[data-slug="${ slug }"] .button.activate` );
26-
await page.waitForSelector( `div[data-slug="${ slug }"].active` );
25+
await Promise.all( [
26+
page.click( `div[data-slug="${ slug }"] .button.activate` ),
27+
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
28+
] );
29+
await page.waitForSelector( `div[data-slug="${ slug }"].active`, {
30+
timeout: 45000,
31+
} );
2732
await switchUserToTest();
2833
}

0 commit comments

Comments
 (0)