Show HN: Visual debugger for Rails system tests

waveywhy | 131 points

Slightly different approach, but appears to have the same overarching goals: https://github.com/bullet-train-co/magic_test

„Magic Test allows you to write Rails system tests interactively through a combination of trial-and-error in a debugger session and also just simple clicking around in the application being tested, all without the slowness of constantly restarting the testing environment.“

I will keep an eye on both now, probably they will compliment each other at some point in time.

lgreiv | 12 days ago

Very cool! Will definitely check it out.

Random question: when you "pause" a test, is it actually pausing the capybara/rspec test such that I can have a breakpoint/debugger/REPL experience to try out various capybara/rspec code?

The reason I ask: one of the slowest/annoying parts of writing capybara tests is the context jump between "this is the css selector i get from chrome dev tools" and "this is the capybara/rspec code which I use in my tests". While they are similar, there are differences which slow things down: locating buttons based on text (vs css), case sensitivity issues with text, ambigious matches, wanting to use nested "find" calls [ie: find(css: ".modal").click_button("Close")], trying to use page objects vs selectors directly in tests, etc.

Often times my first attempt is "close" but not quite right, which compounds when you hit that on most steps of the user's flow.

super stretch goal: if you are using page objects in your rails app, if the page objects where written in a way that "cyperful" could parse them, you COULD have a feature where cyperful could highlight the page objects on the page. So instead of showing me css selectors, you draw a box around a page/section object.

I know that Playwright was doing some cool stuff with their "Pick Locators" and it allowing you to test playwright locators in the tool, not sure if this ever got extended to Page Objects or not. https://playwright.dev/docs/test-ui-mode#pick-locator

tomhallett | 12 days ago

Side question: What tool are they using to get "resolution independent" zoom on the video?

I noticed the UI stayed crisp on zoom and had me wondering. (I don't do video work so maybe it's common in AE)

lbotos | 12 days ago

This could be a nice UI to let you create the test visually.

mooktakim | 12 days ago

If this avoids save_and_open_screenshot loops, it will be very valuable for reducing debug grind. Will take a look.

block_dagger | 12 days ago

wow, this is awesome, thanks for sharing!

stirkac | 12 days ago

looking forward to trying this!

ciaran_lee | 12 days ago