appium_lib 9.14.1 → 9.14.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -631,6 +631,43 @@ module Appium
631
631
  @driver.find_element(*args)
632
632
  end
633
633
 
634
+ # Return ImageElement if current view has a partial image
635
+ #
636
+ # @param [String] png_img_path A path to a partial image you'd like to find
637
+ # @param [Flood] match_threshold At what normalized threshold to reject
638
+ # @param [Bool] visualize Makes the endpoint to return an image, which contains the visualized result of
639
+ # the corresponding picture matching operation. This option is disabled by default.
640
+ #
641
+ # @return [::Appium::Core::ImageElement]
642
+ # @raise [::Appium::Core::Error::NoSuchElementError|::Appium::Core::Error::CoreError] No such element
643
+ #
644
+ # @example
645
+ #
646
+ # @driver.find_element_by_image './test/functional/data/test_element_image.png'
647
+ #
648
+ DEFAULT_MATCH_THRESHOLD = 0.5
649
+ def find_element_by_image(png_img_path, match_threshold: DEFAULT_MATCH_THRESHOLD, visualize: false)
650
+ @driver.find_element_by_image(png_img_path, match_threshold: match_threshold, visualize: visualize)
651
+ end
652
+
653
+ # Return ImageElement if current view has partial images
654
+ #
655
+ # @param [[String]] png_img_paths Paths to a partial image you'd like to find
656
+ # @param [Flood] match_threshold At what normalized threshold to reject
657
+ # @param [Bool] visualize Makes the endpoint to return an image, which contains the visualized result of
658
+ # the corresponding picture matching operation. This option is disabled by default.
659
+ #
660
+ # @return [[::Appium::Core::ImageElement]]
661
+ # @return [::Appium::Core::Error::CoreError]
662
+ #
663
+ # @example
664
+ #
665
+ # @driver.find_elements_by_image ['./test/functional/data/test_element_image.png']
666
+ #
667
+ def find_elements_by_image(png_img_paths, match_threshold: DEFAULT_MATCH_THRESHOLD, visualize: false)
668
+ @driver.find_elements_by_image(png_img_paths, match_threshold: match_threshold, visualize: visualize)
669
+ end
670
+
634
671
  # Calls @driver.set_location
635
672
  #
636
673
  # @note This method does not work on real devices.
@@ -14,6 +14,7 @@ module Appium
14
14
  target.extend Appium::Ios::Xcuitest::MultiAppHandler
15
15
  target.extend Appium::Ios::Xcuitest::Element
16
16
  target.extend Appium::Ios::Xcuitest::Command
17
+ target.extend Appium::Ios::Xcuitest::GetContext
17
18
  end
18
19
  end
19
20
  end
@@ -2,6 +2,7 @@ require_relative 'command/pasteboard'
2
2
  require_relative 'command/gestures'
3
3
  require_relative 'command/source'
4
4
  require_relative 'command/multi_app_handler'
5
+ require_relative 'command/get_context'
5
6
 
6
7
  module Appium
7
8
  module Ios
@@ -0,0 +1,26 @@
1
+ require 'base64'
2
+
3
+ module Appium
4
+ module Ios
5
+ module Xcuitest
6
+ module Certificate
7
+ # Generates Apple's over-the-air configuration profile for certificate deployment
8
+ # based on the given PEM certificate content.
9
+ # https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/iPhoneOTAConfiguration/Introduction/Introduction.html
10
+ # https://github.com/appium/appium-xcuitest-driver/pull/652
11
+ #
12
+ # @param [string] cer_file The content of the certificate file.
13
+ #
14
+ # @example
15
+ #
16
+ # install_certificate cer_file: "path/to/cert.cer"
17
+ #
18
+ def install_certificate(cer_file:)
19
+ args = { content: Base64.encode64(cer_file) }
20
+
21
+ @driver.execute_script 'mobile: installCertificate', args
22
+ end
23
+ end
24
+ end # module Xcuitest
25
+ end # module Ios
26
+ end # module Appium
@@ -0,0 +1,20 @@
1
+ module Appium
2
+ module Ios
3
+ module Xcuitest
4
+ # Get the contexts available, with information about the url and title of each webview
5
+ module GetContext
6
+ #
7
+ # Get contexts
8
+ #
9
+ # @example
10
+ #
11
+ # xcuitest_get_contexts #=> [{ 'id' => 'NATIVE_APP' },
12
+ # # { 'id' => 'WEBVIEW_41467.1', 'title' => 'Apple', 'url' => 'https://www.apple.com/' }]
13
+ #
14
+ def xcuitest_get_contexts
15
+ @driver.execute_script 'mobile: getContexts', {}
16
+ end
17
+ end # module GetContext
18
+ end # module Xcuitest
19
+ end # module Ios
20
+ end # module Appium
@@ -1,5 +1,5 @@
1
1
  module Appium
2
2
  # Version and Date are defined on the 'Appium' module, not 'Appium::Common'
3
- VERSION = '9.14.1'.freeze unless defined? ::Appium::VERSION
4
- DATE = '2018-05-31'.freeze unless defined? ::Appium::DATE
3
+ VERSION = '9.14.2'.freeze unless defined? ::Appium::VERSION
4
+ DATE = '2018-06-25'.freeze unless defined? ::Appium::DATE
5
5
  end
data/readme.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # appium_lib
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/appium_lib.svg)](http://badge.fury.io/rb/appium_lib)
4
- [![Dependency Status](https://gemnasium.com/appium/ruby_lib.svg)](https://gemnasium.com/appium/ruby_lib)
5
4
  [![Travis Master](https://travis-ci.org/appium/ruby_lib.svg?branch=master)](https://travis-ci.org/appium/ruby_lib/builds)
6
5
 
7
6
  [![Downloads](https://img.shields.io/gem/dt/appium_lib.svg)](https://rubygems.org/gems/appium_lib)
@@ -55,7 +54,7 @@ gem install --no-rdoc --no-ri appium_lib
55
54
 
56
55
  # Documentation
57
56
 
58
- - [Installing Appium on OS X](https://github.com/appium/ruby_console/blob/master/osx.md)
57
+ - [Getting started](https://github.com/appium/appium/blob/master/docs/en/about-appium/getting-started.md)
59
58
  - [Overview](https://github.com/appium/ruby_lib/blob/master/docs/docs.md)
60
59
  - [Ruby Android methods](https://github.com/appium/ruby_lib/blob/master/docs/android_docs.md)
61
60
  - [Ruby iOS methods](https://github.com/appium/ruby_lib/blob/master/docs/ios_docs.md)
@@ -1,3 +1,9 @@
1
+ #### v9.14.1 2018-05-31
2
+
3
+ - [cc322d6](https://github.com/appium/ruby_lib/commit/cc322d6a36ad85014b3eed1cdec4481f07b6a95d) [Release 9 14 1 (#787)](https://github.com/appium/ruby_lib/issues/787)
4
+ - [b2772d9](https://github.com/appium/ruby_lib/commit/b2772d952117a9e5d760904ddbfaf5828e8d44cf) [Fix an initialisation error (#786)](https://github.com/appium/ruby_lib/issues/786)
5
+
6
+
1
7
  #### v9.14.0 2018-05-28
2
8
 
3
9
  - [d60947d](https://github.com/appium/ruby_lib/commit/d60947df856da65dd31fcdbc34d71719a75d9003) [Release 9 14 0 (#783)](https://github.com/appium/ruby_lib/issues/783)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.14.1
4
+ version: 9.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-31 00:00:00.000000000 Z
11
+ date: 2018-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appium_lib_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.7.0
19
+ version: 1.7.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.7.0
26
+ version: 1.7.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tomlrb
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -257,7 +257,9 @@ files:
257
257
  - lib/appium_lib/ios/xcuitest.rb
258
258
  - lib/appium_lib/ios/xcuitest/bridge.rb
259
259
  - lib/appium_lib/ios/xcuitest/command.rb
260
+ - lib/appium_lib/ios/xcuitest/command/certificate.rb
260
261
  - lib/appium_lib/ios/xcuitest/command/gestures.rb
262
+ - lib/appium_lib/ios/xcuitest/command/get_context.rb
261
263
  - lib/appium_lib/ios/xcuitest/command/multi_app_handler.rb
262
264
  - lib/appium_lib/ios/xcuitest/command/pasteboard.rb
263
265
  - lib/appium_lib/ios/xcuitest/command/source.rb