Pending operations in playwright on nodejs

Viewed 629

I'm trying to get a new page at the moment of clicking on the link:

await test.step(`Step name`, async () => {
    const [newPage] = await Promise.all([ 
        context.waitForEvent('page'), 
        page.click('//span[normalize-space(@title)=\'Bup\']')
    ]);
}

And I get this page. Further operations with this instance are successful. But after 30 seconds the test ends with the following error:

Timeout of 30000ms exceeded.
Pending operations: 
    - browserContext.waitForEvent at "path to the file":48:21
    - at <unknown>

I will assume that it is related to a promise, but I do not understand what exactly the problem is. Help is needed. Playwright v14.0, nodejs v16.7.0. I run the tests with the following command: npx playwright test tests/diag.spec.mjs --headed

A strange observation. When I run it in debug mode, there is no such error :

PWDEBUG=1 npx playwright test tests/diag.spec.mjs
1 Answers
Related