Now let's run the feature. We can't get too excited yet since we expect our tests to all fail. We haven't written any code, after all, but we can confirm that we've got everything configured properly and get started with the BDD process. Let's run our feature for the first time:
I've only shown the top part of the output for the sake of brevity. While the feature was running, you should also have seen Mozilla Firefox launch and display an error message before it closed itself:
Not very impressive. Note that we set APP_HOST
to the apparently random value of http://localhost:9292
and since we have no web server running at that URL, or even any code that could be run yet, it makes sense that we got a failure. Another point to pay attention to is that Capybara's error message was as follows:
Unable to find field "What needs to be done?"
It would have been nice for Capybara to tell us that the browser was not able to even connect to the URL we supplied, but the error message...