karate icon indicating copy to clipboard operation
karate copied to clipboard

explore adding first-class support for playwright

Open ptrthomas opened this issue 1 year ago • 30 comments

for context - karate has support for Playwright via the (somewhat undocumented) wire-protocol, and we were (one of) the first to use that approach (sep 2020): https://twitter.com/ptrthomas/status/1307678474627244032

but it is experimental, and no one stepped forward to help improve it. some teams tried it - but it does have limitations / bugs: https://stackoverflow.com/q/68490053/143475

since then playwright has put a lot of effort into an official java library: https://github.com/microsoft/playwright-java - it is being very actively developed

plan here is to see if we can come out with karate-playwright

  • I don't think we can embed the playwright dependencies into karate-core so it has to be a separate optional dependency
  • the principle is it should be possible to switch a karate feature (that e.g. works for chrome native) to playwright with just a driver config change. I really think this is doable
  • supporting playwright is a good thing for test-automation users
    • option to switch browser execution engines (chrome / CDP, webdriver, playwright)
    • compatibility with cloud executors like saucelabs, browserstack, lambdatest
    • simple scripting approach of karate (no async, await or promises)
    • future-proof your investment in UI automation
    • take advantage of playwright capabilities when possible

ptrthomas avatar Apr 02 '23 05:04 ptrthomas