Allure adapter for rspec testing framework
Add it to gemfile:
gem 'allure-rspec'Require in spec_helper or any other setup file:
require `allure-rspec`There are no rspec adapter specific configuration options. Main allure configuration is described here
Via commandline, simply add:
--format AllureRspecFormatterRSpec configuration:
RSpec.configure do |c|
c.formatter = AllureRspecFormatter
endConfigure tms link pattern:
Allure.configure do |c|
c.link_tms_pattern = "http://www.jira.com/browse/{}"
endAdd tag to rspec test:
it "some test case", tms: "QA-123" do
# test
endIt's possible to add multiple tms links using tms_ pattern:
it "some test case", tms_1: "QA-123", tms_2: "QA-124" do
# test
endConfigure issue link pattern:
Allure.configure do |c|
c.link_issue_pattern = "http://www.jira.com/browse/{}"
endAdd tag to rspec test:
it "some test case", issue: "QA-123" do
# test
endIt's possible to add multiple tms links using issue_ pattern:
it "some test case", issue_1: "QA-123", issue_2: "QA-124" do
# test
endTest severity (normal by default) can be changed via severity tag:
it "some test case", severity: :critical do
# test
endCustom status details can be set via muted, known, flaky tags:
it "some test case", flaky: true, muted: false, known: true do
# test
endAdditional labels can be added using allure_ pattern:
it "some test case", allure_1: "visual_test", allure_2: "core_functionality" do
# test
endRspec example object has access to Allure helper methods. It can be used to add or run steps, add attachments, modify test case etc.
it "some test case" do |e|
e.run_step("my custom step") do
# some action
end
e.add_attachment(name: "attachment", source: "Some string", type: Allure::ContentType::TXT)
endReport is generated using allure commandline tool. Allure wiki.