appium_lib_core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.rubocop.yml +20 -0
- data/.travis.yml +16 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +202 -0
- data/README.md +5 -0
- data/Rakefile +62 -0
- data/Thorfile +7 -0
- data/appium_lib_core.gemspec +35 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/appium_lib_core.rb +41 -0
- data/lib/appium_lib_core/android.rb +5 -0
- data/lib/appium_lib_core/android/device.rb +174 -0
- data/lib/appium_lib_core/android/espresso/bridge.rb +16 -0
- data/lib/appium_lib_core/android/search_context.rb +18 -0
- data/lib/appium_lib_core/android/touch.rb +17 -0
- data/lib/appium_lib_core/android/uiautomator1/bridge.rb +16 -0
- data/lib/appium_lib_core/android/uiautomator2/bridge.rb +16 -0
- data/lib/appium_lib_core/android_espresso.rb +5 -0
- data/lib/appium_lib_core/android_uiautomator2.rb +5 -0
- data/lib/appium_lib_core/common.rb +6 -0
- data/lib/appium_lib_core/common/base.rb +8 -0
- data/lib/appium_lib_core/common/base/bridge.rb +47 -0
- data/lib/appium_lib_core/common/base/capabilities.rb +16 -0
- data/lib/appium_lib_core/common/base/command.rb +10 -0
- data/lib/appium_lib_core/common/base/driver.rb +51 -0
- data/lib/appium_lib_core/common/base/http_default.rb +13 -0
- data/lib/appium_lib_core/common/base/search_context.rb +89 -0
- data/lib/appium_lib_core/common/base/wait.rb +56 -0
- data/lib/appium_lib_core/common/command.rb +77 -0
- data/lib/appium_lib_core/common/device.rb +567 -0
- data/lib/appium_lib_core/common/error.rb +18 -0
- data/lib/appium_lib_core/common/log.rb +30 -0
- data/lib/appium_lib_core/common/logger.rb +30 -0
- data/lib/appium_lib_core/device/multi_touch.rb +48 -0
- data/lib/appium_lib_core/device/touch_actions.rb +191 -0
- data/lib/appium_lib_core/driver.rb +459 -0
- data/lib/appium_lib_core/ios.rb +7 -0
- data/lib/appium_lib_core/ios/device.rb +54 -0
- data/lib/appium_lib_core/ios/search_context.rb +27 -0
- data/lib/appium_lib_core/ios/touch.rb +17 -0
- data/lib/appium_lib_core/ios/uiautomation/bridge.rb +18 -0
- data/lib/appium_lib_core/ios/uiautomation/patch.rb +20 -0
- data/lib/appium_lib_core/ios/xcuitest/bridge.rb +18 -0
- data/lib/appium_lib_core/ios/xcuitest/device.rb +66 -0
- data/lib/appium_lib_core/ios/xcuitest/search_context.rb +40 -0
- data/lib/appium_lib_core/ios_xcuitest.rb +8 -0
- data/lib/appium_lib_core/patch.rb +78 -0
- data/lib/appium_lib_core/version.rb +6 -0
- data/release_notes.md +0 -0
- metadata +262 -0
| @@ -0,0 +1,54 @@ | |
| 1 | 
            +
            module Appium
         | 
| 2 | 
            +
              module Ios
         | 
| 3 | 
            +
                module Device
         | 
| 4 | 
            +
                  extend Forwardable
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                  # @!method touch_id(match = true)
         | 
| 7 | 
            +
                  # An instance method of Appium::Core::Device .
         | 
| 8 | 
            +
                  # Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint.
         | 
| 9 | 
            +
                  # @param [Boolean] match fingerprint validity. Defaults to true.
         | 
| 10 | 
            +
                  # @return [String]
         | 
| 11 | 
            +
                  #
         | 
| 12 | 
            +
                  # @example
         | 
| 13 | 
            +
                  #
         | 
| 14 | 
            +
                  #   @driver.touch_id true #=> Simulate valid fingerprint
         | 
| 15 | 
            +
                  #   @driver.touch_id false #=> Simulate invalid fingerprint
         | 
| 16 | 
            +
                  #
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                  # @!method toggle_touch_id_enrollment(enabled = true)
         | 
| 19 | 
            +
                  # An instance method of Appium::Core::Device .
         | 
| 20 | 
            +
                  # Toggle touch id enrollment on an iOS Simulator.
         | 
| 21 | 
            +
                  # @param [Boolean] enabled Enable toggle touch id enrollment. Set true by default.
         | 
| 22 | 
            +
                  # @return [String]
         | 
| 23 | 
            +
                  #
         | 
| 24 | 
            +
                  # @example
         | 
| 25 | 
            +
                  #
         | 
| 26 | 
            +
                  #   @driver.toggle_touch_id_enrollment       #=> Enable toggle enrolled
         | 
| 27 | 
            +
                  #   @driver.toggle_touch_id_enrollment true  #=> Enable toggle enrolled
         | 
| 28 | 
            +
                  #   @driver.toggle_touch_id_enrollment false #=> Disable toggle enrolled
         | 
| 29 | 
            +
                  #
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                  ####
         | 
| 32 | 
            +
                  ## class << self
         | 
| 33 | 
            +
                  ####
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                  class << self
         | 
| 36 | 
            +
                    def extended(_mod)
         | 
| 37 | 
            +
                      ::Appium::Core::Device.extend_webdriver_with_forwardable
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                      ::Appium::Core::Device.add_endpoint_method(:touch_id) do
         | 
| 40 | 
            +
                        def touch_id(match = true)
         | 
| 41 | 
            +
                          execute :touch_id, {}, match: match
         | 
| 42 | 
            +
                        end
         | 
| 43 | 
            +
                      end
         | 
| 44 | 
            +
             | 
| 45 | 
            +
                      ::Appium::Core::Device.add_endpoint_method(:toggle_touch_id_enrollment) do
         | 
| 46 | 
            +
                        def toggle_touch_id_enrollment(enabled = true)
         | 
| 47 | 
            +
                          execute :toggle_touch_id_enrollment, {}, enabled: enabled
         | 
| 48 | 
            +
                        end
         | 
| 49 | 
            +
                      end
         | 
| 50 | 
            +
                    end
         | 
| 51 | 
            +
                  end
         | 
| 52 | 
            +
                end # module Device
         | 
| 53 | 
            +
              end # module iOS
         | 
| 54 | 
            +
            end # module Appium
         | 
| @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            module Appium
         | 
| 2 | 
            +
              module Core
         | 
| 3 | 
            +
                module Ios
         | 
| 4 | 
            +
                  module SearchContext
         | 
| 5 | 
            +
                    # @!method uiautomation_find
         | 
| 6 | 
            +
                    #   find_element/s can be used with a [UIAutomation command](https://developer.apple.com/library/ios/documentation/ToolsLanguages/Reference/UIAWindowClassReference/UIAWindow/UIAWindow.html#//apple_ref/doc/uid/TP40009930).
         | 
| 7 | 
            +
                    #
         | 
| 8 | 
            +
                    # @example
         | 
| 9 | 
            +
                    #   find_elements :uiautomation, 'elements()
         | 
| 10 | 
            +
                    #
         | 
| 11 | 
            +
                    #
         | 
| 12 | 
            +
                    # @!method ios_predicate_string_find
         | 
| 13 | 
            +
                    #   find_element/s can be used with a [Predicates](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Predicates/AdditionalChapters/Introduction.html)
         | 
| 14 | 
            +
                    #
         | 
| 15 | 
            +
                    # @example
         | 
| 16 | 
            +
                    #  find_elements :predicate, "isWDVisible == 1"
         | 
| 17 | 
            +
                    #  find_elements :predicate, 'wdName == "Buttons"'
         | 
| 18 | 
            +
                    #  find_elements :predicate, 'wdValue == "SearchBar" AND isWDDivisible == 1'
         | 
| 19 | 
            +
                    #
         | 
| 20 | 
            +
                    def self.extend
         | 
| 21 | 
            +
                      ::Appium::Core::Base::SearchContext.add_finders(uiautomation: '-ios uiautomation')
         | 
| 22 | 
            +
                      ::Appium::Core::Base::SearchContext.add_finders(predicate: '-ios predicate string')
         | 
| 23 | 
            +
                    end
         | 
| 24 | 
            +
                  end # class << self
         | 
| 25 | 
            +
                end # module Ios
         | 
| 26 | 
            +
              end # module Core
         | 
| 27 | 
            +
            end # module Appium
         | 
| @@ -0,0 +1,17 @@ | |
| 1 | 
            +
            module Appium
         | 
| 2 | 
            +
              module Core
         | 
| 3 | 
            +
                module Ios
         | 
| 4 | 
            +
                  module Touch
         | 
| 5 | 
            +
                    def self.extend_touch_actions
         | 
| 6 | 
            +
                      ::Appium::Core::TouchAction.class_eval do
         | 
| 7 | 
            +
                        def swipe_coordinates(start_x: 0, start_y: 0, offset_x: 0, offset_y: 0)
         | 
| 8 | 
            +
                          Appium::Logger.info "extended Appium::Core::Ios::Touch, start_x: #{start_x},"\
         | 
| 9 | 
            +
                            " start_y: #{start_y}, offset_x: #{offset_x}, offset_y: #{offset_y}"
         | 
| 10 | 
            +
                          { offset_x: offset_x, offset_y: offset_y }
         | 
| 11 | 
            +
                        end
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
                    end
         | 
| 14 | 
            +
                  end
         | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
            end
         | 
| @@ -0,0 +1,18 @@ | |
| 1 | 
            +
            module Appium
         | 
| 2 | 
            +
              module Core
         | 
| 3 | 
            +
                module Ios
         | 
| 4 | 
            +
                  module Uiautomation
         | 
| 5 | 
            +
                    module Bridge
         | 
| 6 | 
            +
                      def self.for(target)
         | 
| 7 | 
            +
                        Core::Ios::SearchContext.extend
         | 
| 8 | 
            +
                        target.extend Appium::Ios::Device
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                        Core::Ios::Uiautomation.patch_webdriver_element
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                        Core::Ios::Touch.extend_touch_actions
         | 
| 13 | 
            +
                      end
         | 
| 14 | 
            +
                    end
         | 
| 15 | 
            +
                  end
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
              end
         | 
| 18 | 
            +
            end
         | 
| @@ -0,0 +1,20 @@ | |
| 1 | 
            +
            module Appium
         | 
| 2 | 
            +
              module Core
         | 
| 3 | 
            +
                module Ios
         | 
| 4 | 
            +
                  module Uiautomation
         | 
| 5 | 
            +
                    # @private
         | 
| 6 | 
            +
                    # class_eval inside a method because class Selenium::WebDriver::Element
         | 
| 7 | 
            +
                    # will trigger as soon as the file is required. in contrast a method
         | 
| 8 | 
            +
                    # will trigger only when invoked.
         | 
| 9 | 
            +
                    def self.patch_webdriver_element
         | 
| 10 | 
            +
                      ::Selenium::WebDriver::Element.class_eval do
         | 
| 11 | 
            +
                        # Cross platform way of entering text into a textfield
         | 
| 12 | 
            +
                        def type(text, driver)
         | 
| 13 | 
            +
                          driver.execute_script %(au.getElement('#{ref}').setValue('#{text}');)
         | 
| 14 | 
            +
                        end # def type
         | 
| 15 | 
            +
                      end # Selenium::WebDriver::Element.class_eval
         | 
| 16 | 
            +
                    end # def patch_webdriver_element
         | 
| 17 | 
            +
                  end # module Uiautomation
         | 
| 18 | 
            +
                end # module Ios
         | 
| 19 | 
            +
              end # module Core
         | 
| 20 | 
            +
            end # module Appium
         | 
| @@ -0,0 +1,18 @@ | |
| 1 | 
            +
            module Appium
         | 
| 2 | 
            +
              module Core
         | 
| 3 | 
            +
                module Ios
         | 
| 4 | 
            +
                  module Xcuitest
         | 
| 5 | 
            +
                    module Bridge
         | 
| 6 | 
            +
                      def self.for(target)
         | 
| 7 | 
            +
                        Core::Ios::SearchContext.extend
         | 
| 8 | 
            +
                        Core::Ios::Xcuitest::SearchContext.extend
         | 
| 9 | 
            +
                        target.extend Appium::Ios::Device
         | 
| 10 | 
            +
                        target.extend Appium::Ios::Xcuitest::Device
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                        Core::Ios::Touch.extend_touch_actions
         | 
| 13 | 
            +
                      end
         | 
| 14 | 
            +
                    end
         | 
| 15 | 
            +
                  end
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
              end
         | 
| 18 | 
            +
            end
         | 
| @@ -0,0 +1,66 @@ | |
| 1 | 
            +
            module Appium
         | 
| 2 | 
            +
              module Ios
         | 
| 3 | 
            +
                module Xcuitest
         | 
| 4 | 
            +
                  module Device
         | 
| 5 | 
            +
                    extend Forwardable
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                    # @!method hide_keyboard(close_key = nil, strategy = nil)
         | 
| 8 | 
            +
                    # Hide the onscreen keyboard
         | 
| 9 | 
            +
                    # @param [String] close_key The name of the key which closes the keyboard.
         | 
| 10 | 
            +
                    # @param [Symbol] strategy The symbol of the strategy which closes the keyboard.
         | 
| 11 | 
            +
                    #   XCUITest ignore this argument.
         | 
| 12 | 
            +
                    #   Default for iOS is `:pressKey`. Default for Android is `:tapOutside`.
         | 
| 13 | 
            +
                    #
         | 
| 14 | 
            +
                    # @example
         | 
| 15 | 
            +
                    #
         | 
| 16 | 
            +
                    #  @driver.hide_keyboard             # Close a keyboard with the 'Done' button
         | 
| 17 | 
            +
                    #  @driver.hide_keyboard('Finished') # Close a keyboard with the 'Finished' button
         | 
| 18 | 
            +
                    #
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                    # @!method background_app(duration = 0)
         | 
| 21 | 
            +
                    # Backgrounds the app for a set number of seconds.
         | 
| 22 | 
            +
                    # This is a blocking application.
         | 
| 23 | 
            +
                    # @param [Integer] duration How many seconds to background the app for.
         | 
| 24 | 
            +
                    #
         | 
| 25 | 
            +
                    # @example
         | 
| 26 | 
            +
                    #
         | 
| 27 | 
            +
                    #   @driver.background_app
         | 
| 28 | 
            +
                    #   @driver.background_app(5)
         | 
| 29 | 
            +
                    #   @driver.background_app(-1) #=> the app never come back. https://github.com/appium/appium/issues/7741
         | 
| 30 | 
            +
                    #
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                    ####
         | 
| 33 | 
            +
                    ## class << self
         | 
| 34 | 
            +
                    ####
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                    class << self
         | 
| 37 | 
            +
                      def extended(_mod)
         | 
| 38 | 
            +
                        ::Appium::Core::Device.extend_webdriver_with_forwardable
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                        # Override
         | 
| 41 | 
            +
                        ::Appium::Core::Device.add_endpoint_method(:hide_keyboard) do
         | 
| 42 | 
            +
                          def hide_keyboard(close_key = nil, strategy = nil)
         | 
| 43 | 
            +
                            option = {}
         | 
| 44 | 
            +
             | 
| 45 | 
            +
                            option[:key] = close_key if close_key
         | 
| 46 | 
            +
                            option[:strategy] = strategy if strategy
         | 
| 47 | 
            +
             | 
| 48 | 
            +
                            execute :hide_keyboard, {}, option
         | 
| 49 | 
            +
                          end
         | 
| 50 | 
            +
                        end
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                        # Override
         | 
| 53 | 
            +
                        ::Appium::Core::Device.add_endpoint_method(:background_app) do
         | 
| 54 | 
            +
                          def background_app(duration = 0)
         | 
| 55 | 
            +
                            # https://github.com/appium/ruby_lib/issues/500, https://github.com/appium/appium/issues/7741
         | 
| 56 | 
            +
                            # `execute :background_app, {}, seconds: { timeout: duration_milli_sec }` works over Appium 1.6.4
         | 
| 57 | 
            +
                            duration_milli_sec = duration.nil? ? nil : duration * 1000
         | 
| 58 | 
            +
                            execute :background_app, {}, seconds: { timeout: duration_milli_sec }
         | 
| 59 | 
            +
                          end
         | 
| 60 | 
            +
                        end
         | 
| 61 | 
            +
                      end
         | 
| 62 | 
            +
                    end # class << self
         | 
| 63 | 
            +
                  end # module Device
         | 
| 64 | 
            +
                end # module Xcuitest
         | 
| 65 | 
            +
              end # module Ios
         | 
| 66 | 
            +
            end # module Appium
         | 
| @@ -0,0 +1,40 @@ | |
| 1 | 
            +
            module Appium
         | 
| 2 | 
            +
              module Core
         | 
| 3 | 
            +
                module Ios
         | 
| 4 | 
            +
                  module Xcuitest
         | 
| 5 | 
            +
                    module SearchContext
         | 
| 6 | 
            +
                      # @!method ios_class_chain_find
         | 
| 7 | 
            +
                      #   Only for XCUITest(WebDriverAgent)
         | 
| 8 | 
            +
                      #   find_element/s can be used with a [class chain]( https://github.com/facebook/WebDriverAgent/wiki/Queries)
         | 
| 9 | 
            +
                      #
         | 
| 10 | 
            +
                      # @example
         | 
| 11 | 
            +
                      #
         | 
| 12 | 
            +
                      #   # select the third child button of the first child window element
         | 
| 13 | 
            +
                      #   find_elements :class_chain, 'XCUIElementTypeWindow/XCUIElementTypeButton[3]'
         | 
| 14 | 
            +
                      #
         | 
| 15 | 
            +
                      #   # select all the children windows
         | 
| 16 | 
            +
                      #   find_elements :class_chain, 'XCUIElementTypeWindow'
         | 
| 17 | 
            +
                      #
         | 
| 18 | 
            +
                      #   # select the second last child of the second child window
         | 
| 19 | 
            +
                      #   find_elements :class_chain, 'XCUIElementTypeWindow[2]/XCUIElementTypeAny[-2]'
         | 
| 20 | 
            +
                      #
         | 
| 21 | 
            +
                      #   # matching predicate. <code>`</code> is the mark.
         | 
| 22 | 
            +
                      #   find_elements :class_chain, 'XCUIElementTypeWindow[`visible = 1][`name = \"bla\"`]'
         | 
| 23 | 
            +
                      #
         | 
| 24 | 
            +
                      #   # containing predicate. `$` is the mark.
         | 
| 25 | 
            +
                      #   # Require appium-xcuitest-driver 2.54.0+
         | 
| 26 | 
            +
                      #   # PR: https://github.com/facebook/WebDriverAgent/pull/707/files
         | 
| 27 | 
            +
                      #   find_elements :class_chain, 'XCUIElementTypeWindow[$name = \"bla$$$bla\"$]'
         | 
| 28 | 
            +
                      #   e = find_element :class_chain, "**/XCUIElementTypeWindow[$name == 'Buttons'$]"
         | 
| 29 | 
            +
                      #   e.tag_name #=> "XCUIElementTypeWindow"
         | 
| 30 | 
            +
                      #   e = find_element :class_chain, "**/XCUIElementTypeStaticText[$name == 'Buttons'$]"
         | 
| 31 | 
            +
                      #   e.tag_name #=> "XCUIElementTypeStaticText"
         | 
| 32 | 
            +
                      #
         | 
| 33 | 
            +
                      def self.extend
         | 
| 34 | 
            +
                        ::Appium::Core::Base::SearchContext.add_finders(class_chain: '-ios class chain')
         | 
| 35 | 
            +
                      end
         | 
| 36 | 
            +
                    end
         | 
| 37 | 
            +
                  end # class << self
         | 
| 38 | 
            +
                end # module Ios
         | 
| 39 | 
            +
              end # module Core
         | 
| 40 | 
            +
            end # module Appium
         | 
| @@ -0,0 +1,78 @@ | |
| 1 | 
            +
            # rubocop:disable Style/ClassAndModuleChildren
         | 
| 2 | 
            +
            module Appium
         | 
| 3 | 
            +
              module Core
         | 
| 4 | 
            +
                # Implement useful features for element.
         | 
| 5 | 
            +
                # Patch for Selenium Webdriver.
         | 
| 6 | 
            +
                class Selenium::WebDriver::Element
         | 
| 7 | 
            +
                  # Note: For testing .text should be used over value, and name.
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                  # Returns the value attribute
         | 
| 10 | 
            +
                  #
         | 
| 11 | 
            +
                  # Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element for iOS
         | 
| 12 | 
            +
                  # @return [String]
         | 
| 13 | 
            +
                  #
         | 
| 14 | 
            +
                  # @example
         | 
| 15 | 
            +
                  #
         | 
| 16 | 
            +
                  #   e = @driver.find_element :accessibility_id, 'something'
         | 
| 17 | 
            +
                  #   e.value
         | 
| 18 | 
            +
                  #
         | 
| 19 | 
            +
                  def value
         | 
| 20 | 
            +
                    attribute :value
         | 
| 21 | 
            +
                  end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                  # Returns the name attribute
         | 
| 24 | 
            +
                  #
         | 
| 25 | 
            +
                  # Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element for iOS
         | 
| 26 | 
            +
                  # @return [String]
         | 
| 27 | 
            +
                  #
         | 
| 28 | 
            +
                  # @example
         | 
| 29 | 
            +
                  #
         | 
| 30 | 
            +
                  #   e = @driver.find_element :accessibility_id, 'something'
         | 
| 31 | 
            +
                  #   e.name
         | 
| 32 | 
            +
                  #
         | 
| 33 | 
            +
                  def name
         | 
| 34 | 
            +
                    attribute :name
         | 
| 35 | 
            +
                  end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                  # Enable access to iOS accessibility label
         | 
| 38 | 
            +
                  # accessibility identifier is supported as 'name'
         | 
| 39 | 
            +
                  # @return [String]
         | 
| 40 | 
            +
                  #
         | 
| 41 | 
            +
                  # @example
         | 
| 42 | 
            +
                  #
         | 
| 43 | 
            +
                  #   e = @driver.find_element :accessibility_id, 'something'
         | 
| 44 | 
            +
                  #   e.label
         | 
| 45 | 
            +
                  #
         | 
| 46 | 
            +
                  def label
         | 
| 47 | 
            +
                    attribute :label
         | 
| 48 | 
            +
                  end
         | 
| 49 | 
            +
             | 
| 50 | 
            +
                  # Alias for type
         | 
| 51 | 
            +
                  alias type send_keys
         | 
| 52 | 
            +
             | 
| 53 | 
            +
                  # For use with location_rel.
         | 
| 54 | 
            +
                  #
         | 
| 55 | 
            +
                  # @return [::Selenium::WebDriver::Point] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 }
         | 
| 56 | 
            +
                  #
         | 
| 57 | 
            +
                  # @example
         | 
| 58 | 
            +
                  #
         | 
| 59 | 
            +
                  #   e = @driver.find_element :accessibility_id, 'something'
         | 
| 60 | 
            +
                  #   e.location_rel @driver
         | 
| 61 | 
            +
                  #
         | 
| 62 | 
            +
                  def location_rel(driver)
         | 
| 63 | 
            +
                    rect = self.rect
         | 
| 64 | 
            +
                    location_x = rect.x.to_f
         | 
| 65 | 
            +
                    location_y = rect.y.to_f
         | 
| 66 | 
            +
             | 
| 67 | 
            +
                    size_width  = rect.width.to_f
         | 
| 68 | 
            +
                    size_height = rect.height.to_f
         | 
| 69 | 
            +
             | 
| 70 | 
            +
                    center_x = location_x + (size_width / 2.0)
         | 
| 71 | 
            +
                    center_y = location_y + (size_height / 2.0)
         | 
| 72 | 
            +
             | 
| 73 | 
            +
                    w = driver.window_size
         | 
| 74 | 
            +
                    ::Selenium::WebDriver::Point.new "#{center_x} / #{w.width.to_f}", "#{center_y} / #{w.height.to_f}"
         | 
| 75 | 
            +
                  end
         | 
| 76 | 
            +
                end
         | 
| 77 | 
            +
              end # module Core
         | 
| 78 | 
            +
            end # module Appium
         | 
    
        data/release_notes.md
    ADDED
    
    | 
            File without changes
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,262 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: appium_lib_core
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.1.0
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - Kazuaki MATSUO
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 | 
            +
            bindir: exe
         | 
| 10 | 
            +
            cert_chain: []
         | 
| 11 | 
            +
            date: 2017-11-04 00:00:00.000000000 Z
         | 
| 12 | 
            +
            dependencies:
         | 
| 13 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            +
              name: selenium-webdriver
         | 
| 15 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 | 
            +
                requirements:
         | 
| 17 | 
            +
                - - "~>"
         | 
| 18 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            +
                    version: '3.4'
         | 
| 20 | 
            +
                - - ">="
         | 
| 21 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 22 | 
            +
                    version: 3.4.1
         | 
| 23 | 
            +
              type: :runtime
         | 
| 24 | 
            +
              prerelease: false
         | 
| 25 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 26 | 
            +
                requirements:
         | 
| 27 | 
            +
                - - "~>"
         | 
| 28 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 29 | 
            +
                    version: '3.4'
         | 
| 30 | 
            +
                - - ">="
         | 
| 31 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 32 | 
            +
                    version: 3.4.1
         | 
| 33 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 34 | 
            +
              name: json
         | 
| 35 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 36 | 
            +
                requirements:
         | 
| 37 | 
            +
                - - ">="
         | 
| 38 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 39 | 
            +
                    version: '1.8'
         | 
| 40 | 
            +
              type: :runtime
         | 
| 41 | 
            +
              prerelease: false
         | 
| 42 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 43 | 
            +
                requirements:
         | 
| 44 | 
            +
                - - ">="
         | 
| 45 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 46 | 
            +
                    version: '1.8'
         | 
| 47 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 48 | 
            +
              name: bundler
         | 
| 49 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 50 | 
            +
                requirements:
         | 
| 51 | 
            +
                - - "~>"
         | 
| 52 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 53 | 
            +
                    version: '1.14'
         | 
| 54 | 
            +
              type: :development
         | 
| 55 | 
            +
              prerelease: false
         | 
| 56 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 57 | 
            +
                requirements:
         | 
| 58 | 
            +
                - - "~>"
         | 
| 59 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 60 | 
            +
                    version: '1.14'
         | 
| 61 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 62 | 
            +
              name: rake
         | 
| 63 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 64 | 
            +
                requirements:
         | 
| 65 | 
            +
                - - "~>"
         | 
| 66 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 67 | 
            +
                    version: '10.0'
         | 
| 68 | 
            +
              type: :development
         | 
| 69 | 
            +
              prerelease: false
         | 
| 70 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 71 | 
            +
                requirements:
         | 
| 72 | 
            +
                - - "~>"
         | 
| 73 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 74 | 
            +
                    version: '10.0'
         | 
| 75 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 76 | 
            +
              name: yard
         | 
| 77 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 78 | 
            +
                requirements:
         | 
| 79 | 
            +
                - - "~>"
         | 
| 80 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 81 | 
            +
                    version: '0.9'
         | 
| 82 | 
            +
              type: :development
         | 
| 83 | 
            +
              prerelease: false
         | 
| 84 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 85 | 
            +
                requirements:
         | 
| 86 | 
            +
                - - "~>"
         | 
| 87 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 88 | 
            +
                    version: '0.9'
         | 
| 89 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 90 | 
            +
              name: minitest
         | 
| 91 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 92 | 
            +
                requirements:
         | 
| 93 | 
            +
                - - "~>"
         | 
| 94 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 95 | 
            +
                    version: '5.0'
         | 
| 96 | 
            +
              type: :development
         | 
| 97 | 
            +
              prerelease: false
         | 
| 98 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 99 | 
            +
                requirements:
         | 
| 100 | 
            +
                - - "~>"
         | 
| 101 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 102 | 
            +
                    version: '5.0'
         | 
| 103 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 104 | 
            +
              name: minitest-reporters
         | 
| 105 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 106 | 
            +
                requirements:
         | 
| 107 | 
            +
                - - "~>"
         | 
| 108 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 109 | 
            +
                    version: '1.1'
         | 
| 110 | 
            +
              type: :development
         | 
| 111 | 
            +
              prerelease: false
         | 
| 112 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 113 | 
            +
                requirements:
         | 
| 114 | 
            +
                - - "~>"
         | 
| 115 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 116 | 
            +
                    version: '1.1'
         | 
| 117 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 118 | 
            +
              name: webmock
         | 
| 119 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 120 | 
            +
                requirements:
         | 
| 121 | 
            +
                - - "~>"
         | 
| 122 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 123 | 
            +
                    version: 3.1.0
         | 
| 124 | 
            +
              type: :development
         | 
| 125 | 
            +
              prerelease: false
         | 
| 126 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 127 | 
            +
                requirements:
         | 
| 128 | 
            +
                - - "~>"
         | 
| 129 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 130 | 
            +
                    version: 3.1.0
         | 
| 131 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 132 | 
            +
              name: pry
         | 
| 133 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 134 | 
            +
                requirements:
         | 
| 135 | 
            +
                - - ">="
         | 
| 136 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 137 | 
            +
                    version: '0'
         | 
| 138 | 
            +
              type: :development
         | 
| 139 | 
            +
              prerelease: false
         | 
| 140 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 141 | 
            +
                requirements:
         | 
| 142 | 
            +
                - - ">="
         | 
| 143 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 144 | 
            +
                    version: '0'
         | 
| 145 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 146 | 
            +
              name: rubocop
         | 
| 147 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 148 | 
            +
                requirements:
         | 
| 149 | 
            +
                - - ">="
         | 
| 150 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 151 | 
            +
                    version: '0'
         | 
| 152 | 
            +
              type: :development
         | 
| 153 | 
            +
              prerelease: false
         | 
| 154 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 155 | 
            +
                requirements:
         | 
| 156 | 
            +
                - - ">="
         | 
| 157 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 158 | 
            +
                    version: '0'
         | 
| 159 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 160 | 
            +
              name: appium_thor
         | 
| 161 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 162 | 
            +
                requirements:
         | 
| 163 | 
            +
                - - "~>"
         | 
| 164 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 165 | 
            +
                    version: '0.0'
         | 
| 166 | 
            +
                - - ">="
         | 
| 167 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 168 | 
            +
                    version: 0.0.7
         | 
| 169 | 
            +
              type: :development
         | 
| 170 | 
            +
              prerelease: false
         | 
| 171 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 172 | 
            +
                requirements:
         | 
| 173 | 
            +
                - - "~>"
         | 
| 174 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 175 | 
            +
                    version: '0.0'
         | 
| 176 | 
            +
                - - ">="
         | 
| 177 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 178 | 
            +
                    version: 0.0.7
         | 
| 179 | 
            +
            description: Minimal Ruby library for Appium.
         | 
| 180 | 
            +
            email:
         | 
| 181 | 
            +
            - fly.49.89.over@gmail.com
         | 
| 182 | 
            +
            executables: []
         | 
| 183 | 
            +
            extensions: []
         | 
| 184 | 
            +
            extra_rdoc_files: []
         | 
| 185 | 
            +
            files:
         | 
| 186 | 
            +
            - ".gitignore"
         | 
| 187 | 
            +
            - ".rubocop.yml"
         | 
| 188 | 
            +
            - ".travis.yml"
         | 
| 189 | 
            +
            - CHANGELOG.md
         | 
| 190 | 
            +
            - Gemfile
         | 
| 191 | 
            +
            - LICENSE.txt
         | 
| 192 | 
            +
            - README.md
         | 
| 193 | 
            +
            - Rakefile
         | 
| 194 | 
            +
            - Thorfile
         | 
| 195 | 
            +
            - appium_lib_core.gemspec
         | 
| 196 | 
            +
            - bin/console
         | 
| 197 | 
            +
            - bin/setup
         | 
| 198 | 
            +
            - lib/appium_lib_core.rb
         | 
| 199 | 
            +
            - lib/appium_lib_core/android.rb
         | 
| 200 | 
            +
            - lib/appium_lib_core/android/device.rb
         | 
| 201 | 
            +
            - lib/appium_lib_core/android/espresso/bridge.rb
         | 
| 202 | 
            +
            - lib/appium_lib_core/android/search_context.rb
         | 
| 203 | 
            +
            - lib/appium_lib_core/android/touch.rb
         | 
| 204 | 
            +
            - lib/appium_lib_core/android/uiautomator1/bridge.rb
         | 
| 205 | 
            +
            - lib/appium_lib_core/android/uiautomator2/bridge.rb
         | 
| 206 | 
            +
            - lib/appium_lib_core/android_espresso.rb
         | 
| 207 | 
            +
            - lib/appium_lib_core/android_uiautomator2.rb
         | 
| 208 | 
            +
            - lib/appium_lib_core/common.rb
         | 
| 209 | 
            +
            - lib/appium_lib_core/common/base.rb
         | 
| 210 | 
            +
            - lib/appium_lib_core/common/base/bridge.rb
         | 
| 211 | 
            +
            - lib/appium_lib_core/common/base/capabilities.rb
         | 
| 212 | 
            +
            - lib/appium_lib_core/common/base/command.rb
         | 
| 213 | 
            +
            - lib/appium_lib_core/common/base/driver.rb
         | 
| 214 | 
            +
            - lib/appium_lib_core/common/base/http_default.rb
         | 
| 215 | 
            +
            - lib/appium_lib_core/common/base/search_context.rb
         | 
| 216 | 
            +
            - lib/appium_lib_core/common/base/wait.rb
         | 
| 217 | 
            +
            - lib/appium_lib_core/common/command.rb
         | 
| 218 | 
            +
            - lib/appium_lib_core/common/device.rb
         | 
| 219 | 
            +
            - lib/appium_lib_core/common/error.rb
         | 
| 220 | 
            +
            - lib/appium_lib_core/common/log.rb
         | 
| 221 | 
            +
            - lib/appium_lib_core/common/logger.rb
         | 
| 222 | 
            +
            - lib/appium_lib_core/device/multi_touch.rb
         | 
| 223 | 
            +
            - lib/appium_lib_core/device/touch_actions.rb
         | 
| 224 | 
            +
            - lib/appium_lib_core/driver.rb
         | 
| 225 | 
            +
            - lib/appium_lib_core/ios.rb
         | 
| 226 | 
            +
            - lib/appium_lib_core/ios/device.rb
         | 
| 227 | 
            +
            - lib/appium_lib_core/ios/search_context.rb
         | 
| 228 | 
            +
            - lib/appium_lib_core/ios/touch.rb
         | 
| 229 | 
            +
            - lib/appium_lib_core/ios/uiautomation/bridge.rb
         | 
| 230 | 
            +
            - lib/appium_lib_core/ios/uiautomation/patch.rb
         | 
| 231 | 
            +
            - lib/appium_lib_core/ios/xcuitest/bridge.rb
         | 
| 232 | 
            +
            - lib/appium_lib_core/ios/xcuitest/device.rb
         | 
| 233 | 
            +
            - lib/appium_lib_core/ios/xcuitest/search_context.rb
         | 
| 234 | 
            +
            - lib/appium_lib_core/ios_xcuitest.rb
         | 
| 235 | 
            +
            - lib/appium_lib_core/patch.rb
         | 
| 236 | 
            +
            - lib/appium_lib_core/version.rb
         | 
| 237 | 
            +
            - release_notes.md
         | 
| 238 | 
            +
            homepage: https://github.com/appium/ruby_lib
         | 
| 239 | 
            +
            licenses:
         | 
| 240 | 
            +
            - Apache-2.0
         | 
| 241 | 
            +
            metadata: {}
         | 
| 242 | 
            +
            post_install_message: 
         | 
| 243 | 
            +
            rdoc_options: []
         | 
| 244 | 
            +
            require_paths:
         | 
| 245 | 
            +
            - lib
         | 
| 246 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 247 | 
            +
              requirements:
         | 
| 248 | 
            +
              - - ">="
         | 
| 249 | 
            +
                - !ruby/object:Gem::Version
         | 
| 250 | 
            +
                  version: '0'
         | 
| 251 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 252 | 
            +
              requirements:
         | 
| 253 | 
            +
              - - ">="
         | 
| 254 | 
            +
                - !ruby/object:Gem::Version
         | 
| 255 | 
            +
                  version: '0'
         | 
| 256 | 
            +
            requirements: []
         | 
| 257 | 
            +
            rubyforge_project: 
         | 
| 258 | 
            +
            rubygems_version: 2.6.8
         | 
| 259 | 
            +
            signing_key: 
         | 
| 260 | 
            +
            specification_version: 4
         | 
| 261 | 
            +
            summary: Minimal Ruby library for Appium.
         | 
| 262 | 
            +
            test_files: []
         |