Sha256: 1f6e6e738b5abace022490dc5afd793066e2636a00d487620624d1b4ffd71702

Contents?: true

Size: 897 Bytes

Versions: 13

Compression:

Stored size: 897 Bytes

Contents

# 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 Raider
  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
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ruby_raider-0.3.5 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.3.4 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.3.3 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.3.2 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.3.1 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.3.0 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.2.9 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.2.8 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.2.7 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.2.6 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.2.5 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.2.4 lib/generators/templates/helpers/allure_helper.tt
ruby_raider-0.2.3 lib/generators/templates/helpers/allure_helper.tt