jeudi 16 juin 2016

Rails Integration Testing with Watir-Webdriver

I wrote several Rails 3 integration tests using Watir-Webdriver (0.9.1) that test whether a user can register. These tests run fine and pass. However, I've been running these tests with a rails server running so that Watir can access my site and work its way through the webpages. This presents a problem because that means I am running my tests on the development environment, and because of that I can't get accurate numbers for lines covered by my tests and all the information I input through Watir goes into a different database that my tests do not have access to.

If I try to run my rails server in the test environment, it gives me an error (SQLite3 ReadOnlyException) when I try to register a user. I've been led to believe that this is because SQLite3 does not want to be used by both the test server and my test code at the same time.

Is there a way to make it so that my integration tests do not actually need a rails server up in order to access my site? Or do I just need to use the development environment for my server and test to make sure the right data is being submitted somewhere else (i.e. a different type of test)?

Aucun commentaire:

Enregistrer un commentaire