Sha256: 07ffe5fe24dc9c685aac15fadad54cb542d94902afdd779ed5fe57634da280c8

Contents?: true

Size: 1.28 KB

Versions: 18

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

require_relative 'generator'

class HelpersGenerator < Generator
  def generate_helpers
    generate_browser_helper
    generate_driver_helper
    generate_appium_helper
    generate_allure_helper

    if visual?
      generate_visual_helper
      generate_visual_spec_helper
    else
      generate_spec_helper
    end
  end

  private

  def generate_allure_helper
    template('helpers/allure_helper.tt', "#{name}/helpers/allure_helper.rb")
  end

  def generate_browser_helper
    return if selenium? || mobile?

    template('helpers/browser_helper.tt', "#{name}/helpers/browser_helper.rb")
  end

  def generate_spec_helper
    return if cucumber?

    template('helpers/spec_helper.tt', "#{name}/helpers/spec_helper.rb")
  end

  def generate_driver_helper
    return if watir?

    template('helpers/driver_helper.tt', "#{name}/helpers/driver_helper.rb")
  end

  def generate_appium_helper
    return unless cross_platform?

    template('helpers/appium_helper.tt', "#{name}/helpers/appium_helper.rb")
  end

  def generate_visual_helper
    template('helpers/visual_helper.tt', "#{name}/helpers/visual_helper.rb")
  end

  def generate_visual_spec_helper
    return if cucumber?

    template('helpers/visual_spec_helper.tt', "#{name}/helpers/spec_helper.rb")
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ruby_raider-0.9.3 lib/generators/helper_generator.rb
ruby_raider-0.9.2 lib/generators/helper_generator.rb
ruby_raider-0.9.1 lib/generators/helper_generator.rb
ruby_raider-0.9.0 lib/generators/helper_generator.rb
ruby_raider-0.8.9 lib/generators/helper_generator.rb
ruby_raider-0.8.8 lib/generators/helper_generator.rb
ruby_raider-0.8.6 lib/generators/helper_generator.rb
ruby_raider-0.8.5 lib/generators/helper_generator.rb
ruby_raider-0.8.3 lib/generators/helper_generator.rb
ruby_raider-0.8.2 lib/generators/helper_generator.rb
ruby_raider-0.8.1 lib/generators/helper_generator.rb
ruby_raider-0.8.0 lib/generators/helper_generator.rb
ruby_raider-0.7.9 lib/generators/helper_generator.rb
ruby_raider-0.7.8 lib/generators/helper_generator.rb
ruby_raider-0.7.7 lib/generators/helper_generator.rb
ruby_raider-0.7.6 lib/generators/helper_generator.rb
ruby_raider-0.7.5 lib/generators/helper_generator.rb
ruby_raider-0.7.4 lib/generators/helper_generator.rb