Run a single Cucumber feature
script/cucumber features/feature_name.feature
Or, if you don't care about speed, you can use rake:
rake features FEATURE=features/feature_name.feature
Related cards:
Hack of the day: One-liner to run all Cucumber features matching a given string
The following will search for all .feature
files containing a search term and run them using geordi.
find features/ -name '*.feature' | xargs grep -li 'YOUR SEARCH TERM' | sort -u | tr '\n' ' ' | xargs ...
How to: Run geordi in a single proccess with parallel test setup
Geordi uses parallel_tests if available for running the test suite. To debug an application it is very unhandy to have multiple processes as your terminal I/O will ...
A nicer way to run RSpec and/or Cucumber
geordi, our collection of awesome shell scripts, has been extended by three scripts to help you call RSpec or Cucumber:
cuc
This script runs Cucumber the way you want it:
- Prints some line feeds to easi...
Hack of the day: One-liner to run all changed Cucumber features
Similar to our snippet that runs all Cucumber features matching a given string, the following will run all modified or new Cucumber features by looking at your git status:
git status --short | grep -v '^ D ' | grep '.featur...
Why your Cucumber feature loses cookies when run under Selenium
When your Cucumber feature seems to forget cookies / sessions when you run it with Selenium check if the test travels in time like here:
Given the date is 2017-10-20
When I sign in
Then I should see "Welcome!"
What happens here i...
Allow a user to run a single command with root privileges
It's that simple to allow one of your Linux users to run a single command as UID 0:
sudo visudo
- Add the line below to allow user 'deploy' to run
/usr/bin/bundle
with root privileges
deploy ALL=NOPASSWD: /usr/bin/bundle
RSpec: Run a single spec (Example or ExampleGroup)
RSpec allows you to mark a single Example/ExampleGroup so that only this will be run. This is very useful when using a test runner like guard.
Add the following config to spec/spec_helper.rb
:
RSpec.configure do |config|
# These two s...
Run a single test in Test::Unit
To run a single test file:
rake test:units TEST=test/unit/post_test.rb
rake test:functionals TEST=test/functional/posts_controller_test.rb
rake test:integration TEST=test/integration/admin_news_posts_test.rb
You may even run a single...
Skip Selenium scenarios in a Cucumber run
Cucumber scenarios that are tagged with @javascript
so they run with Selenium are very slow. You might not want to run them every time.
In order to skip all Selenium scenarios, call Cucumber like this:
cucumber --tags ~@javascript
Note th...
Run a single example group in RSpec
To only run a single describe
/context
block in a long spec, you can say
spec spec/models/note_spec.rb:545
... where the describe
block starts at line 545.
Note: This will only run examples that are direct children of this block, n...