Sha256: fa21661968c685f3b92f7c02d1db4fa969efd20517b740572458b58f0fbcd07c

Contents?: true

Size: 906 Bytes

Versions: 27

Compression:

Stored size: 906 Bytes

Contents

module Appium
  module Ios
    # @private
    # class_eval inside a method because class Selenium::WebDriver::Element
    # will trigger as soon as the file is required. in contrast a method
    # will trigger only when invoked.
    def patch_webdriver_element
      Selenium::WebDriver::Element.class_eval do
        # Enable access to iOS accessibility label
        # accessibility identifier is supported as 'name'
        def label
          attribute('label')
        end

        # Cross platform way of entering text into a textfield
        def type(text)
          if $driver.automation_name_is_xcuitest?
            send_keys text
          else
            $driver.execute_script %(au.getElement('#{ref}').setValue('#{text}');)
          end
        end # def type
      end # Selenium::WebDriver::Element.class_eval
    end # def patch_webdriver_element
  end # module Ios
end # module Appium

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
appium_lib-9.5.0 lib/appium_lib/ios/patch.rb
appium_lib-9.4.10 lib/appium_lib/ios/patch.rb
appium_lib-9.4.9 lib/appium_lib/ios/patch.rb
appium_lib-9.4.8 lib/appium_lib/ios/patch.rb
appium_lib-9.4.7 lib/appium_lib/ios/patch.rb
appium_lib-9.4.6 lib/appium_lib/ios/patch.rb
appium_lib-9.4.5 lib/appium_lib/ios/patch.rb
appium_lib-9.4.4 lib/appium_lib/ios/patch.rb
appium_lib-9.4.3 lib/appium_lib/ios/patch.rb
appium_lib-9.4.2 lib/appium_lib/ios/patch.rb
appium_lib-9.4.1 lib/appium_lib/ios/patch.rb
appium_lib-9.4.0 lib/appium_lib/ios/patch.rb
appium_lib-9.3.8 lib/appium_lib/ios/patch.rb
appium_lib-9.3.7 lib/appium_lib/ios/patch.rb
appium_lib-9.3.6 lib/appium_lib/ios/patch.rb
appium_lib-9.3.5 lib/appium_lib/ios/patch.rb
appium_lib-9.3.4 lib/appium_lib/ios/patch.rb
appium_lib-9.3.3 lib/appium_lib/ios/patch.rb
appium_lib-9.3.2 lib/appium_lib/ios/patch.rb
appium_lib-9.3.1 lib/appium_lib/ios/patch.rb