lib/generators/templates/helpers/driver_helper.tt in ruby_raider-0.7.3 vs lib/generators/templates/helpers/driver_helper.tt in ruby_raider-0.7.4

- old
+ new

@@ -5,26 +5,27 @@ require 'webdrivers' <% else -%> require 'appium_lib' <% end -%> -module Raider - module DriverHelper - attr_reader :driver +module DriverHelper + <% if automation == 'selenium' -%> + def driver(*opts) + @driver ||= create_driver(*opts) + end + <% else -%> + def driver + @driver ||= create_driver + end + <%- end -%> - <%= ERB.new(File.read(File.expand_path('./partials/driver_and_options.tt', __dir__)), trim_mode: '-').result(binding).strip! %> - - <% if automation == 'cross_platform' -%> private - def config - YAML.load_file('config/config.yml') - end -<% end -%> + <%= ERB.new(File.read(File.expand_path('./partials/driver_and_options.tt', __dir__)), trim_mode: '-').result(binding).strip! %> + <%- if automation != 'selenium' -%> - # :reek:UtilityFunction - def caps - YAML.load_file('config/capabilities.yml') - end + # :reek:UtilityFunction + def caps + YAML.load_file('config/capabilities.yml') + end <%- end -%> -end end