# frozen_string_literal: true <%=- ERB.new(File.read(File.expand_path('./partials/allure_requirements.tt', __dir__))).result(binding).strip! -%> <%- allure = ERB.new(File.read(File.expand_path('./partials/allure_imports.tt', __dir__))).result(binding).strip! -%> module AllureHelper class << self def configure <%= allure %>.configure do |config| config.results_directory = 'allure-results' config.clean_results_directory = true end end def add_screenshot(screenshot_name) Allure.add_attachment( name: name, source: File.open("allure-results/screenshots/#{screenshot_name}.png"), type: Allure::ContentType::PNG, test_case: true ) end <%- if framework == 'rspec' -%> def formatter AllureRspecFormatter end <%- end -%> end end