Settings

Theme

Live Coding in Playwright

twitter.com

1 points by mjgoeke 3 years ago · 3 comments

Reader

mjgoekeOP 3 years ago

Hi!

I created a library at work that I'm pushing to get open sourced now. It provides live coding functionality for Playwright tests.

It also has an extremely powerful user configurable recorder.

I'm looking to add support to make it page-object-model aware next.

It took 2 weeks to make so far, is < 100 lines code in playwright test side and < 100 lines code in the browser side to do the entire thing.

Everything kept folding down smoothly and (almost) perfectly.

I'm very proud of it :-)

  • mgbmtl 3 years ago

    I'd use it :)

    Writing tests is tedious, and this reminds me the nicer bits of Selenium IDE (which I otherwise don't miss).

    • mjgoekeOP 3 years ago

      Yes exactly! Our behemoth of a web app was taking 25s initial load time (much faster when cached so it just wasn’t a priority to fix performance). Average test run time for a workflow test is 2 minutes. That means when authoring them and I’m trying to get selectors and crap right it takes me 5 tries for the next line of the test, waiting for 60-90s between each try. The result is it takes 3-4 hours to author a single medium complexity test. And my brain is mush for the rest of the day. I hated that and would subconsciously avoid writing tests.

      What I’ve developed allows me immediate feedback every step of the way. It makes it _fun_ again so I can keep my head in the game and finish a test in 15-20 minutes and feel accomplished instead of burnt out. I’ve also taken an approach where the tooling (especially the recorder, and soon the page object model support) brings you 80-90% off the way there, but _always_ plays well with user created code - it has some loose basic expectations of the interface, but it doesn’t need to own the generated code - that’s just a starting point for you to improve it.

      Super excited. My company already has a precedent for open sourcing projects so I’m hoping this won’t take more than a week or two to get it there. I’m on vacation for a week but plan to finish the page object model story when I get back.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection