Clone existing project to set up a Quick Build project to run cucumber tests
BuildWise
User Guide
by Zhimin Zhan
2023-10-06
The test project https://github.com/testwisely/agiletravel-ui-tests/tree/master/selenium-webdriver-cucumber
The key file is Rakefile, which BuildWise invokes to run selected cucumber feature tests
I highlight some differences from the Rakefile for RSpec:
- Require Cucumber's built-in Rake task defititions
require 'cucumber' require 'cucumber/rake/task'
- Specify the feature files to run
def features_for_quick_build # list test files to be run in a quick build [ "features/login.feature", "features/flight.feature", "features/payment.feature" ] end
The method is used in task:Cucumber::Rake::Task.new("ui_tests:quick")
. - Cucumber running options:
# feel free to add/rmeove formatter, junit is required for CI reporting t.cucumber_opts = [ "--format progress -o log/features.log", "--format junit -o log/", "--format html -o log/features.html", # "--format pretty", # can be quite lengthy file_list ]
The important format option for CI server here isjunit
, which generates test results in JUnit style. Most CI servers support this style.