Sha256: a6e4892f2cd4b6003a88d5a7bce2ac563d923c24912ea663c494d82ba65e0494
Contents?: true
Size: 971 Bytes
Versions: 11
Compression:
Stored size: 971 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 # :reek:FeatureEnvy def create_options(*opts) load_browser = @config['browser'].to_s browser = load_browser == 'ie' ? load_browser.upcase : load_browser.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
11 entries across 11 versions & 1 rubygems