Open
Description
🐛 Bug Report
When using Puppeteer Core with a Webdriver Bidi connection Puppeteer creates Bidi Page objects as such:
But expect-puppeteer explicitly checks for CDPPage objects here:
Latest versions of Firefox do not support CDP so Webdriver Bidi must be used. This means that as of today expect-puppeteer will not work with this.
To Reproduce
- Initiate a connection with firefox over webDriverBiDi something like
module.exports = {
defaultBrowser: 'firefox',
launch: undefined,
connect: {
protocol: 'webDriverBiDi',
browserWSEndpoint: 'ws://127.0.0.1:9222/session',
},
}
-
Attempt to use expect-puppeteer on any objects.
-
You get a runtime error something like this
BidiPage is not supported
> 53 | await expect(page).toMatchElement('[data-e2e=guest-login-button]')
| ^
54 | await expect(page).toClick('[data-e2e=guest-login-button] > button')
55 | await page.waitForSelector('[data-e2e=get-ready-to-start-shopping-text]')
56 | await page.waitForSelector('[data-e2e=instruction-place-personal-items-in-cart]')
at puppeteerExpect (node_modules/expect-puppeteer/dist/index.js:438:49)
at expectPuppeteer (node_modules/expect-puppeteer/dist/index.js:464:26)
at loginAsGuest (helpers/login.ts:53:9)
at Object.<anonymous> (test/login/login.spec.ts:46:23)
Expected behavior
expect-puppeteer should be able to handle a BidiPage object
Metadata
Metadata
Assignees
Labels
No labels