Allure Ruby Adaptor API
This is a helper library containing the basics for any ruby-based Allure adaptor. Using it you can easily implement the adaptor for your favorite ruby testing library or you can just create the report of any other kind using the basic Allure terms.
Setup
Add the dependency to your Gemfile
gem 'allure-ruby-commons'
Configuration
Following configuration options are supported:
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
Getting the configuration object:
Allure.configuration
Allure lifecycle
Reports are built using API defined in AllureLifecycle class and using allure specific entities defined in models. Example of building a simple test case can be seen in integration spec.
Convenience method Allure.lifecycle exists for getting thread specific allure lifecycle instance.
Additional methods in Allure exist to add various custom attributes to test report.
Allure.(name: "attachment", source: "Some string", type: Allure::ContentType::TXT, test_case: false)
Allure.(name: "attachment", source: "/path/to/test.txt", type: Allure::ContentType::TXT, test_case: false)
Allure.add_link(name: "Custom Url", url: "http://www.github.com")
Testing
Install dependencies:
bundle install
Run tests:
bundle exec rspec
Building
gem build allure-ruby-commons.gemspec