[Feature] Richer convenience API
See original GitHub issueI 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 useful -
uncheck()
- same ascheck
Feel free to comment add / remove things you’d like to see (would not like to see) in Playwright.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Features and APIs Overview | Android Developers
Android 13 introduces great new features and APIs for developers. The sections below help you learn about features for your apps and get...
Read more >Send Interactive Messages on the WhatsApp Business Platform
Create an engaging, richer messaging experience for your customers with interactive messages like list messages and button replies.
Read more >Outlook personal contacts API overview - Microsoft Graph
Contacts provide a complementary function for messaging and calendaring by letting customers maintain a convenient, integrated store of contacts ...
Read more >Bookerville's API
Feed Bookerville data into an accounting system or other software. Richer, more sopisticated integration with a website than Bookerville's widgets provide. To ...
Read more >Data APIs (and the DataStore) - Datopian Tech
Furthermore, much of the richer functionality of a DMS or Data Portal such as data visualization and exploration require API data access rather ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@aesyondu:
elementHandle.textContent
andelementHandle.innerText
are now available. I’ll close the meta bug and open new bugs as we go.How about
elementHandle.text()
, as a convenience forelementHandle.evaluate((node) => node.textContent)
.Generally,
page.$eval(".css-selector", (node) => node.textContent) -> page.text(".css-selector")
.