Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Standup 4/21/2009: Webrat save_and_open_page, CSS regression, Rubymine UTF8

Interesting Things

  • Webrat, the acceptance testing framework that is all the rage right now, has a neat lesser-known save_and_open_page command that is helpful for debugging when your tests go wrong. Essentially, this command dumps the current HTML to the browser and lets you inspect the state of the page visually at any point within your test.

  • Rubymine, Pivotal’s favorite Ruby IDE, doesn’t really support UTF8. You can type UTF8 characters seemingly fine … but somewhere along the way it doesn’t save properly. Apparently this has been an issue with Rubymine for quite some time. Frustrating.

Ask for Help

  • Anyone know a reliable way of CSS regression testing? When we are refactoring CSS or markup, it would be great if there was an automated way to detect visual breakages. Some ideas floating around involve taking screenshots through Webkit’s API and comparing them pixel by pixel. This kind of thing has been attempted twice by Pivots without much success. Anybody have a good solution?

  1. Visnu says:

    You know, a javascript check after the page is rendered might help and give more informative breakage information. A traversal of all Dom nodes and getStyle (prototype) comparison with previous values. Wouldn’t catch everything like display:none but could catch some things much more meaningfully than comparing screenshots.

  2. Chris Eppstein says:

    One idea to address Visual Breakage is to use humans in the form of Mechanical Turk. Take two screen shots of all your major pages before and after, and pay someone a few cents to compare them and say if they’re the same or not. If the human eye can’t detect the difference, it probably doesn’t matter.

    I don’t think a good automated approach exists and I don’t know if one ever will before sentient AI ;-)

    Also, if you’re refactoring Sass stylesheets, I would encourage you to write a basic unit test for the compilation of them. Compass comes with a base test case for this purpose: At we use it like so:

  3. Try adding “-Dfile.encoding=UTF-8″ to your JVM startup options, might help.

  4. RubyMine on Linux (Ubuntu 8.10, 64bit) does seem to record UTF-8 characters correctly.

    Running on Sun JVM 1.6

  5. Michael Nutt says:

    I was working on a css regression tester that did pixel-based comparisons a while back. It prompted for each visual difference and used an ImageMagick feature that flashed between the original and new version, making it easy to see which pixels had changed.

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *