implement `page.waitForNavigation` for handling the page load after clicking the search submit (https://github.com/woocommerce/woocommerce-blocks/pull/2769)
This commit is contained in:
parent
1953d4f96a
commit
19ab667672
|
@ -47,7 +47,8 @@ export async function visitBlockPage( title ) {
|
|||
if ( await page.$( '#post-search-input' ) ) {
|
||||
// search for the page.
|
||||
await page.type( '#post-search-input', title );
|
||||
await page.click( '#search-submit', { waitUntil: 'domcontentloaded' } );
|
||||
await page.click( '#search-submit' );
|
||||
await page.waitForNavigation( { waitUntil: 'domcontentloaded' } );
|
||||
const pageLink = await page.$x( `//a[contains(text(), '${ title }')]` );
|
||||
if ( pageLink.length > 0 ) {
|
||||
// clicking the link directly caused racing issues, so I used goto.
|
||||
|
|
Loading…
Reference in New Issue