Hacker News new | ask | show | jobs
by stu_k 3397 days ago
The title is slightly misleading. This just looks like an alternative way to run Cucumber, not a complete alternative to Selenium.
1 comments

It didn't even occur to me that there were other ways of using Selenium than Selenium-WebDriver!
Well a key property of Selenium is that it's cross-browser. Whilst it's nice to imagine that the web is in a position where running all your tests in some version of Blink means that your site will work on Firefox/Edge/Safari, I fear that the reality is still rather different.
This is not an alternative way of using selenium. It's a way to avoid using selenium. The advantage over selenium is that tests and application code are run in the same process, so they tend to be faster, less brittle and easier to debug. The downside is that they are not cross-browser.
There are also other ways of using Selenium, though, that I had mentally disregarded and ignored as probably not useful.

You can also get this behavior (basically single thread of execution) with cucumber-rails and Selenium (or probably any driver other than Selenium, for that matter). I'm not saying the application code is literally run in the same thread or process as the test executor, but in effect they do. Your Ruby process is in charge of setting up the HTTP server, as well as driving whatever driver (Selenium, Phantom, ...) you're using for Cucumber.

So serendipitously, with (MRI) Ruby being a single-threaded beast, you do still get that behavior and quality of being able to catch errors that pop up on either side, making it much easier to debug misbehaving server or tests.