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

Troubleshooting

aslakhellesoy 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 features/support/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 – or another truetype (TT) font.

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 features with Selenium, Watir, or other solutions requiring a separate server process are not visible from within step definitions code

When you run Cucumber with Selenium or a similar solution two processes are required: one for use by Cucumber/features and another one that’s used by Selenium (the server process.) By default in Rails, all operations on the database are wrapped within a transaction, that is rolled back after running each scenario.

This feature, of using transactions, is only enabled when you haveCucumber::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 the 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