<%- if automation == 'sparkling_ios' -%> # frozen_string_literal: true require 'yaml' require 'sparkling_watir' module DriverHelper def app @app ||= create_app end private def create_app @app = SparklingWatir::App.new(caps: caps) end # :reek:UtilityFunction def caps YAML.load_file('config/capabilities.yml') end end <%- else -%> # frozen_string_literal: true require 'yaml' <% if automation == 'selenium' -%> require 'active_support/inflector' require 'selenium-webdriver' <% else -%> require 'appium_lib' <% end -%> module DriverHelper <% if automation == 'selenium' -%> def driver(*opts) @driver ||= create_driver(*opts) end <% else -%> def driver @driver ||= create_driver end <%- end -%> private <%= 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 <%- end -%> end <%- end -%>