mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-17 07:40:12 +01:00
Updated Testing (markdown)
parent
20e46141c3
commit
19d5f0a64c
1 changed files with 12 additions and 13 deletions
25
Testing.md
25
Testing.md
|
|
@ -33,7 +33,7 @@ bin/rake test test/models/project_test.rb test_has_default_context
|
||||||
|
|
||||||
### Running the acceptance tests
|
### Running the acceptance tests
|
||||||
|
|
||||||
Acceptance tests are written using Cucumber. For those features that require JavaScript/AJAX, Tracks uses Capybara and Selenium. Selenium, in turn, uses Firefox to run its tests.
|
Acceptance tests are written using Cucumber. For those features that require JavaScript/AJAX, Cucumber makes use of Capybara and Selenium to automate the Firefox web browser. You will need a recent version of Firefox to run these tests.
|
||||||
|
|
||||||
To run the entire Cucumber test suite, from the root directory of the project, run
|
To run the entire Cucumber test suite, from the root directory of the project, run
|
||||||
```
|
```
|
||||||
|
|
@ -51,27 +51,17 @@ To run a single test, include the path to the file and the test's starting line
|
||||||
bin/cucumber features/calendar.feature:45
|
bin/cucumber features/calendar.feature:45
|
||||||
```
|
```
|
||||||
|
|
||||||
Incomplete features can be marked as work-in-progress using the `@wip` tag in the feature file. They will not be executed as part of the normal test runs. Instead they can be manually run with
|
Incomplete features can be marked as work-in-progress using the `@wip` tag in the feature file. They will not be executed as part of the normal test runs. Instead they can be run manually with
|
||||||
```
|
```
|
||||||
bin/rake cucumber:wip
|
bin/rake cucumber:wip
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running the tests headless
|
## Running the tests headless
|
||||||
|
|
||||||
All tests will run on a headless setup except for the Selenium tests. They will need a web browser which will need a running X-server.
|
All tests will run on a headless setup except for the Selenium tests. They need a web browser, which requires a running X-server.
|
||||||
|
|
||||||
You can solve this by running a virtual framebuffer X server or by using the capybara-webkit driver.
|
You can solve this by running a virtual framebuffer X server or by using the capybara-webkit driver.
|
||||||
|
|
||||||
### Using webkit
|
|
||||||
|
|
||||||
Uncomment the capybara-webkit gem in the Gemfile and run bundle install. This will need the Qt development libraries on your system.
|
|
||||||
|
|
||||||
Run the features using webkit:
|
|
||||||
|
|
||||||
```
|
|
||||||
bundle exec rake cucumber JS_DRIVER=webkit
|
|
||||||
```
|
|
||||||
|
|
||||||
### Framebuffer
|
### Framebuffer
|
||||||
For the framebuffer in Fedora, you need to install the packages xorg-x11-server-Xvfb and xorg-x11-apps
|
For the framebuffer in Fedora, you need to install the packages xorg-x11-server-Xvfb and xorg-x11-apps
|
||||||
|
|
||||||
|
|
@ -83,6 +73,15 @@ DISPLAY=:99.0 bundle exec rake cucumber:selenium
|
||||||
killall Xvfb
|
killall Xvfb
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using webkit
|
||||||
|
|
||||||
|
Uncomment the capybara-webkit gem in the Gemfile and run bundle install. This will need the Qt development libraries on your system.
|
||||||
|
|
||||||
|
Run the features using webkit:
|
||||||
|
```
|
||||||
|
bundle exec rake cucumber JS_DRIVER=webkit
|
||||||
|
```
|
||||||
|
|
||||||
### Problems with cucumber selenium tests
|
### Problems with cucumber selenium tests
|
||||||
|
|
||||||
#### Sqlite3 Lock exceptions
|
#### Sqlite3 Lock exceptions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue