Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Allure Cucumber Adaptor

This repository contains Allure adaptor for Cucumber framework.

Installation

Add this line to your application's Gemfile:

gem 'allure-cucumber'

And then execute:

  $ bundle

Or install it yourself as:

  $ gem install allure-cucumber

Configuration

Common allure configuration is set via Allure.configure method. To change id, add the following in features/support/env.rb file:

Allure.configure do |c|
  c.results_directory = "/whatever/you/like"
  c.clean_results_directory = true
  c.logging_level = Logger::INFO
  # these are used for creating links to bugs or test cases where {} is replaced with keys of relevant items
  c.link_tms_pattern = "http://www.jira.com/browse/{}"
  c.link_issue_pattern = "http://www.jira.com/browse/{}"
end

By default, allure-cucumber will analyze your cucumber tags looking for Test Management, Issue Management, and Severity hooks. Links to TMS and ISSUE and test severity will be displayed in the report. By default these prefixes are used:

    DEFAULT_TMS_PREFIX      = 'TMS:'
    DEFAULT_ISSUE_PREFIX    = 'ISSUE:'
    DEFAULT_SEVERITY_PREFIX = 'SEVERITY:'

Example:

  @SEVERITY:trivial @ISSUE:YZZ-100 @TMS:9901
  Scenario: Leave First Name Blank
    When I register an account without a first name
    Then exactly (1) [validation_error] should be visible

You can configure these prefixes as well as tms and issue tracker urls like this:

AllureCucumber.configure do |c|
  c.tms_prefix      = 'HIPTEST--'
  c.issue_prefix    = 'JIRA++'
  c.severity_prefix = 'URGENCY:'
end

Example:

  @URGENCY:critical @JIRA++YZZ-100 @HIPTEST--9901
  Scenario: Leave First Name Blank
    When I register an account without a first name
    Then exactly (1) [validation_error] should be visible

Additional special tags exists for setting status detail of test scenarios, allure will pick up following tags: @flaky, @known and @muted

Usage

Put the following in your features/support/env.rb file:

require 'allure-cucumber'

Use --format AllureCucumber::CucumberFormatter --out where/you-want-results while running cucumber or add it to cucumber.yml. Note that cucumber --out option overrides results_directory set via Allure.configure method.

You can also manually attach screenshots and links to test steps and test cases by interacting with allure lifecycle directly. For more info check out allure-ruby-commons

# file: features/support/env.rb

require "allure-cucumber"

Allure.add_attachment(name: "attachment", source: "Some string", type: Allure::ContentType::TXT, test_case: true)
Allure.add_link("Custom Url", "http://www.github.com")

How to generate report

This adaptor only generates json files containing information about tests. See wiki section on how to generate report.