Sha256: 61632f4723bb89d47e4bc7411c7a9dc1fd68c06d5cc0b87e2806e98a2ea9e535

Contents?: true

Size: 525 Bytes

Versions: 30

Compression:

Stored size: 525 Bytes

Contents

module Raider
  module AppiumHelper
    def element(opts = {})
      return driver.find_element(strategy(opts) => selector(opts)) if opts[os]

      driver.find_element(opts)
    end

    def elements(opts = {})
      return driver.find_elements(strategy(opts) => selector(opts)) if opts[os]

      driver.find_elements(opts)
    end

    def os
      driver.appium_device
    end

    private

    def strategy(opts)
      opts[os].keys.first
    end

    def selector(opts)
      opts[os][strategy(opts)]
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ruby_raider-0.7.3 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.7.2 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.7.1 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.7.0 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.6.9 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.6.8 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.6.7 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.6.6 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.6.5 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.6.4 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.6.3 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.6.2 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.6.1 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.6.0 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.5.9 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.5.8 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.5.7 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.5.6 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.5.5 lib/generators/templates/helpers/appium_helper.tt
ruby_raider-0.5.4 lib/generators/templates/helpers/appium_helper.tt