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