Skip to content
Allure adaptor for Cucumber framework
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
features add support for embeddings (fixes #53, via #54) Feb 17, 2018
fixtures/minimal_cucumber_app/features/lib/support Added Cucumber scenarios to show how 'attach_file' works at this moment Oct 31, 2016
lib
.gitignore
Gemfile initial commit Jul 25, 2014
LICENSE
README.md
Rakefile fix for duplicate steps (via #65) Mar 20, 2018
allure-cucumber.gemspec fix regression introduced in #65 (fixes #67, fixes #68, fixes #69, via Jul 27, 2018

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

By default, Allure XML files are stored in gen/allure-results. To change this add the following in features/support/env.rb file:

AllureCucumber.configure do |c|
   c.output_dir = "/output/dir"
end

By default, the Allure XML files from earlier runs are deleted at the start of new run. This can be disabled by:

AllureCucumber.configure do |c|
  c.clean_dir  = false
end

By default, allure-cucumber will analyze your cucumber tags looking for Test Management, Issue Management, and Severity hooks. These hooks will be displayed in the generated allure report (see allure-core for further info).

    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 what allure-cucumber looks for by making the following changes

AllureCucumber.configure do |c|
  c.clean_dir  = false
  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

Compatability with Cucumber ~> 3

Add the following in features/support/env.rb file:

Cucumber::Core::Test::Step.module_eval do
  def name
    return text if self.text == 'Before hook'
    return text if self.text == 'After hook'
    "#{source.last.keyword}#{text}"
  end
end

More information in issue 63

Usage

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

require 'allure-cucumber'

Use --format AllureCucumber::Formatter --out where/you-want-results while running cucumber or add it to cucumber.yml

You can also attach screenshots, logs or test data to steps.

# file: features/support/env.rb

include AllureCucumber::DSL

attach_file(title, file)

How to generate report

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

You can’t perform that action at this time.