Closed pavelfeldman closed 4 years ago
Idea for pause(): opens a repl so user can try out different commands.
Something like this https://github.com/qawolf/qawolf/blob/master/packages/repl/src/repl.ts
Hi @pavelfeldman, you might be interested in this project: Fluent API around Playwright
This project is holds our utilities (working on adding a lot more). Perhaps some of them might move into playwright core. https://github.com/qawolf/playwright-utils
How about elementHandle.text()
, as a convenience for elementHandle.evaluate((node) => node.textContent)
.
Generally, page.$eval(".css-selector", (node) => node.textContent) -> page.text(".css-selector")
.
@aesyondu: elementHandle.textContent
and elementHandle.innerText
are now available. I'll close the meta bug and open new bugs as we go.
I was looking at Cypress API - it does a great job exposing some of the higher-level driver primitives and I was wondering if some of them would make sense to Playwright as well.
check()
- @dgozman had a patch for it already.clock()
- a user-land virtual time implementation, limited tosetTimeout
,setInterval
andDate
. I don't think we should get into the weeds of the native virtual time implementation, but we could at least make it work across frames and workers (currently not supported in Cypress), wireperformance.now
, etc. Would be interesting to get some feedback from the field on how useful it is. Time mock was already mentioned here.pause()
- handy for those not using the debugger, we could resume from cli or devtools.request(url)
-auth0
recommends it as a part of the login routine in your POM. This could simply be afetch
call wrapper, returning status, headers and body using our interception. Not sure why Cypress does it from within Node context, they could be doing a real fetch.rightclick
- we haveclick
,dblclick
and eventripleclick
. Probably worth exposing isTrusted context menu trigger as well.route
- looks like a user-land XHR override. Playwright's interception is much more powerful, but I like the shape of the route API. I don't like how Puppeteer/Playwright handle network from the events today, I'd rather use the glob / predicate matcher.submit
- looks simple and usefuluncheck()
- same ascheck
Feel free to comment add / remove things you'd like to see (would not like to see) in Playwright.