Sha256: a688aa3023f44e0bd21da0d17171d9e8ad70eeba47f64b681b68b67d36347e89

Contents?: true

Size: 929 Bytes

Versions: 17

Compression:

Stored size: 929 Bytes

Contents

<% if automation == 'selenium' -%>
      def new_driver(*opts)
      @config = YAML.load_file('config/config.yml')
      browser = @config['browser'].to_sym
      @driver = Selenium::WebDriver.for(browser, capabilities: browser_options(*opts))
    end

    def browser_options(*opts)
      opts = opts.empty? ? @config['browser_options'] : opts
      create_options(*opts)
    end

    def create_options(*opts)
      browser = @config['browser'] == :ie ? @config['browser'].to_s.upcase : @config['browser'].to_s.capitalize
      caps = "Selenium::WebDriver::#{browser}::Options".constantize.new
      opts.each { |option| caps.add_argument(option) }
      caps
    end
<% elsif automation == 'cross_platform' -%>
  def new_driver
    platform = config['platform'].to_s
    @driver = Appium::Driver.new({ caps: caps[platform] })
  end
<% else -%>
  def new_driver
    @driver = Appium::Driver.new({ caps: caps })
  end
<% end -%>

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ruby_raider-0.6.0 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.5.9 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.5.8 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.5.7 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.5.6 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.5.5 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.5.4 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.5.3 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.5.2 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.5.1 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.5.0 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.4.9 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.4.8 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.4.7 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.4.6 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.4.5 lib/generators/templates/helpers/partials/driver_and_options.tt
ruby_raider-0.4.4 lib/generators/templates/helpers/partials/driver_and_options.tt