Giter VIP home page Giter VIP logo

allure-cucumber's Introduction

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

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.