[rspec-users] [cucumber] webrat+selenium integration problem: record n
ben at benmabey.com
Tue Mar 24 18:55:47 EDT 2009
Balint Erdi wrote:
> @Ben: Thank you, I fixed that and am using your database_cleaner to
> truncate the database.
> Turns out the problem (or rather, another problem) was that I set up a
> separate environment (selenium) for the selenium tests but still some of
> the steps used the test environment and thus the database record was
> generated in the test database not in the selenium one where it should
> have been.
> I struggled to get the record creation happen in the selenium database
> but finally I gave up and am now using the test for both selenium and
> "plain" cucumber features. So the database_cleaner serves me even
> better. It works! My current config is here:
> http://gist.github.com/83635. Once again, thank you for your help.
Couple things I'd like to point out. In your enhanced.rb you don't need
to do the Before hook yourself. You can just require
'database_cleaner/cucumber'. I've updated your gist to use that.
In your plain.rb it seems like you are trying to truncate your database
just once upon startup. If that is the case then the recommended way is
to use the clean_with method like so:
Again, I have updated the gist to reflect this.
> @Mike: I may check that out, thank you!
> Ben Mabey wrote:
>> Balint Erdi wrote:
>>> And I fill in "password" with "secret"
>>> 5. the users table in the database that selenium uses is empty.
>>> (mysql> select * from users;
>>> Empty set (0.00 sec) ). That surprises me a bit since in theory
>>> selenium does not use transactional fixtures so the record should
>>> appear right away after (1) runs.
>> Webrat's Selenium adapter will not change your DB settings. On line 10
>> on your env.rb file you actually have transactional support turned on.
>> You need to comment that line out when using Selenium. For more info
>> please read about this problem on the wiki:
More information about the rspec-users