I’ve got a couple demos where I have to do some quick code changes, rebuild a project, then get a browser opened up to show changes on the UI. The point of this is to help folks understand how to avoid tests breaking when the sort order changes, or columns move around on the UI.
Making my audience sit through the code changes is a waste of time—the code changes simply update sort and column order. My talk is on how to write good tests to deal with these situations, not show the code causing the changes.
Instead, I wired together a couple things to give me a hotkey that fires off the changes, builds the system, and launches a browser to the right page. First off is a Ruby script to copy files, build the project, and use Watir to launch the page:
No, this isn’t the most awesomesaucest Ruby ever, but it works. I’ll clean it up when I need to.
The next step is to wire this up in your favorite hotkey/launcher. I use SlickRun because it’s awesome.
Now I can use SlickRun to launch my Ruby script. I can continue engaging the audience while the system updates, builds, and a browser shows up with the new content.
There are many ways to solve this particular problem. The steps above are how I chose to do it this time. Hopefully it’s useful to you!