Sha256: 567b6be125a8bea83e30654408575f0caee47b75dffb2b1e8361de9a875bb976
Contents?: true
Size: 1.97 KB
Versions: 2
Compression:
Stored size: 1.97 KB
Contents
<% if automation == 'selenium' && axe? == true -%> def create_driver(browser, js_path, skip_iframes) AxeSelenium.configure(browser) do |config| config.jslib_path = js_path if js_path config.skip_iframes = skip_iframes if skip_iframes end.page end <% elsif automation == 'selenium' -%> def create_driver(*opts) @config = YAML.load_file('config/config.yml') browser = @config['browser'].to_sym Selenium::WebDriver.for(browser, options: create_webdriver_options(*opts)) end def browser_arguments(*opts) opts.empty? ? @config['browser_arguments'][@config['browser']] : opts end def driver_options @config['driver_options'] end # :reek:FeatureEnvy def create_webdriver_options(*opts) load_browser = @config['browser'].to_s browser = load_browser == 'ie' ? load_browser.upcase : load_browser.capitalize options = "Selenium::WebDriver::#{browser}::Options".constantize.new browser_arguments(*opts).each { |arg| options.add_argument(arg) } driver_options.each { |opt| options.add_option(opt.first, opt.last) } options end <% elsif automation == 'cross_platform' -%> def create_driver @driver = Appium::Driver.new({ caps: parsed_caps }) end def platform @platform ||= YAML.load_file('config/config.yml')['platform'].to_s end def platform_caps @platform_caps ||= YAML.load_file('config/capabilities.yml')[platform] end # :reek:UtilityFunction def parsed_caps platform_caps['appium:options']['app'] = parse_app_path(platform_caps['appium:options']['app']) platform_caps end def parse_app_path(path) File.expand_path(path, Dir.pwd) end <% else -%> def create_driver @driver = Appium::Driver.new({ caps: parsed_caps }) end # :reek:UtilityFunction def parsed_caps caps = YAML.load_file('config/capabilities.yml') caps['appium:options']['app'] = app_path(caps['appium:options']['app']) caps end def app_path(path) File.expand_path(path, Dir.pwd) end <% end -%>
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ruby_raider-0.9.3 | lib/generators/templates/helpers/partials/driver_and_options.tt |
ruby_raider-0.9.2 | lib/generators/templates/helpers/partials/driver_and_options.tt |