Skip to content
Allure report logoAllure Report
Main Navigation ModulesDocumentationStart

English

Español

English

Español

Appearance

Sidebar Navigation

Introduction

Install & Upgrade

Install for Windows

Install for macOS

Install for Linux

Install for Node.js

Upgrade Allure

Getting started

How to view a report

Improving readability of your test reports

Improving navigation in your test report

Features

Test steps

Attachments

Test statuses

Sorting and filtering

Defect categories

Visual analytics

Test stability analysis

History and retries

Timeline

Export to CSV

Export metrics

Guides

JUnit 5 parametrization

JUnit 5 & Selenide: screenshots and attachments

JUnit 5 & Selenium: screenshots and attachments

Setting up JUnit 5 with GitHub Actions

Pytest parameterization

Pytest & Selenium: screenshots and attachments

Pytest & Playwright: screenshots and attachments

Pytest & Playwright: videos

Playwright parameterization

How it works

Overview

Test result file

Container file

Categories file

Environment file

Executor file

History files

Integrations

Azure DevOps

Bamboo

GitHub Actions

Jenkins

JetBrains IDEs

TeamCity

Visual Studio Code

Frameworks

Behat

Getting started

Configuration

Reference

Behave

Getting started

Configuration

Reference

Codeception

Getting started

Configuration

Reference

CodeceptJS

Getting started

Configuration

Reference

Cucumber.js

Getting started

Configuration

Reference

Cucumber-JVM

Getting started

Configuration

Reference

Cucumber.rb

Getting started

Configuration

Reference

Cypress

Getting started

Configuration

Reference

Jasmine

Getting started

Configuration

Reference

JBehave

Getting started

Configuration

Reference

Jest

Getting started

Configuration

Reference

JUnit 4

Getting started

Configuration

Reference

JUnit 5

Getting started

Configuration

Reference

Mocha

Getting started

Configuration

Reference

Newman

Getting started

Configuration

Reference

NUnit

Getting started

Configuration

Reference

PHPUnit

Getting started

Configuration

Reference

Playwright

Getting started

Configuration

Reference

pytest

Getting started

Configuration

Reference

Pytest-BDD

Getting started

Configuration

Reference

Reqnroll

Getting started

Configuration

Reference

REST Assured

Getting started

Configuration

Robot Framework

Getting started

Configuration

Reference

RSpec

Getting started

Configuration

Reference

SpecFlow

Getting started

Configuration

Reference

Spock

Getting started

Configuration

Reference

TestNG

Getting started

Configuration

Reference

Vitest

Getting started

Configuration

Reference

WebdriverIO

Getting started

Configuration

Reference

xUnit.net

Getting started

Configuration

Reference

On this page

Allure Behat reference ​

These are the attributes and methods that you can use to integrate your Behat tests with Allure Report.

Severity ​

Set the test's severity.

To enable this, specify the severity_key configuration option. Use this key as a prefix in the Gherkin tags, followed by one of the values: “trivial”, “minor”, “normal”, “critical”, or “blocker”.

The example below assumes that you use have configured severity: as the prefix.

gherkin
Feature: Labels

  @severity:critical
  Scenario: Create new label for authorized user
    When I open labels page
    And I create label with title "hello"
    Then I should see label with title "hello"

Link ​

Add links related to the test via Gherkin tags. Two types of links are supported: issue links and TMS links.

To enable this, specify the issue_tag_prefix and test_id_tag_prefix configuration options.

The example below assumes that you use have configured issue: and tms: as the prefixes.

gherkin
Feature: Labels

  @issue:https://issues.example.org/AUTH-123
  @tms:https://tms.example.org/TMS-456
  Scenario: Create new label for authorized user
    When I open labels page
    And I create label with title "hello"
    Then I should see label with title "hello"

Behavior-based hierarchy ​

Any Gherkin tag is considered the test's user story for the Allure's behavior-based hierarchy, unless the tag has a known prefix or is ignored, according to the configuration.

gherkin
@UI @Labels
Feature: Labels

  Scenario: Create new label for authorized user
    When I open labels page
    And I create label with title "hello"
    Then I should see label with title "hello"

Test sub-steps ​

  • StepSupport::executeStep($name, $logic, $title = null)

To split a Gherkin step into smaller sub-steps:

  1. In your context class, add the StepSupport trait.

  2. In the step implementation, pass a lambda function or a method reference to $this->executeStep().

    The function or method should accept no arguments. During the execution of a sub-step, you can call $this->executeStep() again to split it into more sub-steps.

php
use Behat\Behat\Context\Context;
use Yandex\Allure\Adapter\Support\StepSupport;

class MyContext implements Context
{
    use StepSupport;

    /**
     * @When I go to the registration form
     */
    public function goToRegistrationForm()
    {
        $this->executeStep('Step 1', [$this, 'step1']);
        $this->executeStep('Step 2', [$this, 'step2']);
    }

    public function step1()
    {
        $this->executeStep('Step 1.1', function () {
            // ...
        });

        $this->executeStep('Step 1.2', function () {
            // ...
        });
    }

    public function step2()
    {
        $this->executeStep('Step 2.1', function () {
            // ...
        });

        $this->executeStep('Step 2.2', function () {
            // ...
        });
    }
}

Parametrized tests ​

In Gherkin, a Scenario Outline (or a Scenario Template) implements the parametrized tests pattern. A scenario outline must contain an Examples table, from which Behat loads sets of parameters, one row after another. Behat runs all the outline's steps multiple times — one per each set of parameters.

The example below shows a Gherkin file and a PHP implementation file of a test. In this example, In the test report, this test will include the three steps executed with the first set of parameter, then the three steps executed with the second set of parameters.

gherkin
Feature: User management

  Scenario Outline: Registration
    When I go to the registration form
    And I enter my details: "<login>", "<password>", "<name>", "<birthday>"
    Then the profile should be created

    Examples:
      | login   | password | name     | birthday   |
      | johndoe | qwerty   | John Doe | 1970-01-01 |
      | janedoe | 123456   | Jane Doe | 1111-11-11 |
php
use Behat\Behat\Context\Context;

class MyContext implements Context
{
    /**
     * @When I go to the registration form
     */
    public function goToRegistrationForm()
    {
    }

    /**
     * @When I enter my details: :login, :password, :name, :birthday
     */
    public function enterDetails($login, $password, $name, $birthday)
    {
    }

    /**
     * @When I go to the registration form
     */
    public function profileShouldBeCreated()
    {
    }
}

Attachments ​

  • AttachmentSupport::addAttachment($filePathOrContents, $caption, $type = null)

To create an attachment, add the AttachmentSupport trait to your context class and call $this->addAttachment() at any point during your test. Pass either the content string or the path from which the data will be read.

To ensure that the reader's web browser will display attachments correctly, it is recommended to specify each attachment's type. To do so, pass the media type of the content as $type. The media type affects how the data will be displayed in the test report, while the filename extension is appended to the filename when user wants to save the file. If not specified, Allure Behat will try to guess the type automatically based on the contents.

php
use Behat\Behat\Context\Context;
use Yandex\Allure\Adapter\Support\AttachmentSupport;

class MyContext implements Context
{
    use AttachmentSupport;

    /**
     * @When I go to the registration form
     */
    public function profileShouldBeCreated()
    {
        $this->addAttachment('/path/to/image.png', 'Screenshot', 'image/png');
    }
}
Pager
Previous pageConfiguration
Next pageGetting started
Powered by

Join our newsletter

Allure TestOps
  • Overview
  • Why choose us
  • Cloud
  • Self-hosted
  • Success Stories
Company
  • Documentation
  • Blog
  • About us
  • Contact
  • Events
© 2025 Qameta Software Inc. All rights reserved.