Clone existing project to set up a Quick Build project to run cucumber tests

Open Video

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:

  1. Require Cucumber's built-in Rake task defititions
    require 'cucumber'
    require 'cucumber/rake/task'
  2. 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").
  3. 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 is junit, which generates test results in JUnit style. Most CI servers support this style.