I wanted to learn more about Playwright, so I simply asked ChatGPT a series of questions to find out more! See some of the below snapshots for my interesting conversation with the AI bot that is all the rage nowadays.
Wow! ChatGPT puts together what looks to be a valid UI test for a Google Search.I have pretty basic knowledge of async and promises, but I wasn't super clear on why it might be so prevalent in JS-based UI testing. Maybe I've always oversimplified my take on the complexity of DOM events. Returning a promise object on a mouse click is a little foreign to me.I have a tendency for code to simply look cleaner. For example I'll always try to refactor away string literals where I can. I thought maybe the await keyword can be abstracted away somehow.I still wasn't too satisfied so I asked ChatGPT to refactor again.I went ahead and asked ChatGPT to write the same test using Capybara. It produces exactly what I expect (and with MUCH fewer lines of code!)And finally I ask for ChatGPT's take on what I perceived as a vast difference... verbosity?
So there you have it! A quick exercise and comparison between Ruby's stack and Playwright, and an interesting assessment on both from ChatGPT.
Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.
Top comments (0)