Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.

Troubleshooting

hubertlepicki edited this page Aug 13, 2010 · 30 revisions

Cucumber not ripe? Can’t find your peeler? These are some common problems people have experienced. -And how to address them.

Console output isn’t right on Windows

Missing “a” characters in the output? Do your “æøå” characters print like garbled Commodore 64 characters? There are four steps to fix this.

First – make sure your .feature files are saved in UTF-8 format.

Second – add require 'cucumber/formatters/unicode' to your env.rb file.

Third – set your command window’s font to a font that has the characters you’re outputting – for example Upper Left corner icon menu → Properties → Font → Lucida Grande.

Fourth – in your command prompt, change the codepage:

chcp 1252

If you want to do this permanently – look here.
Now you should be able to get aæøå in your output on Windows.

Note that codepage 1252 is not UTF-8 – it’s essentially a superset of ISO-8859-1. Ideally you’d set it to 65001, which is UTF-8, but this has the unfortunate side effect of temporarily neutering all your computer’s bat files so they cannot be executed (including cucumber.bat and rake.bat).

For more info, see Lighthouse issue #81

Changes made to models while running stories with Selenium are not visible from within step definitions code

If you run Cucumber with Selenium, it creates 2 instances of Rails application – one for use by Cucumber/features and another one that’s used by Selenium. By default, all operations on database are wrapped up with transaction, that is rolled back after running each story.

This is happening if you have enabled Cucumber::Rails.use_transactional_fixtures option in your env.rb file. To solve this problem, you need to comment out this option and handle table cleanup yourself, for example using Before block. Please read Hooks to get an idea how to use it.

Sqlite adapter throws SQLite3::BusyException when using Cucumber with Selenium

Cause and solution to this problem is exactly the same as with not being able to see changes made to database when using Cucumber with Selenium. In short, you need to comment out Cucumber::Rails.use_transactional_fixtures from your env.rb file.

Clone this wiki locally