appium_lib 9.14.3 → 9.15.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,6 +22,7 @@ if defined?(Minitest::VERSION)
22
22
  end
23
23
 
24
24
  require 'appium_lib_core'
25
+ require 'uri'
25
26
 
26
27
  module Appium
27
28
  REQUIRED_VERSION_XCUITEST = '1.6.0'.freeze
@@ -384,31 +385,15 @@ module Appium
384
385
  def self.absolute_app_path(opts)
385
386
  raise 'opts must be a hash' unless opts.is_a? Hash
386
387
  caps = opts[:caps] || {}
387
- appium_lib_opts = opts[:appium_lib] || {}
388
- server_url = appium_lib_opts.fetch :server_url, false
389
-
390
388
  app_path = caps[:app]
391
389
  raise 'absolute_app_path invoked and app is not set!' if app_path.nil? || app_path.empty?
392
- # may be absolute path to file on remote server.
393
- # if the file is on the remote server then we can't check if it exists
394
- return app_path if server_url
395
390
  # Sauce storage API. http://saucelabs.com/docs/rest#storage
396
391
  return app_path if app_path.start_with? 'sauce-storage:'
397
- return app_path if app_path =~ /^http/ # public URL for Sauce
398
- if app_path =~ /^(\/|[a-zA-Z]:)/ # absolute file path
399
- app_path = File.expand_path app_path unless File.exist? app_path
400
- raise "App doesn't exist. #{app_path}" unless File.exist? app_path
401
- return app_path
402
- end
392
+ return app_path if app_path =~ URI::DEFAULT_PARSER.make_regexp # public URL for Sauce
403
393
 
404
- # if it doesn't contain a slash then it's a bundle id
405
- return app_path unless app_path =~ /[\/\\]/
406
-
407
- # relative path that must be expanded.
408
- # absolute_app_path is called from load_settings
409
- # and the txt file path is the base of the app path in that case.
410
394
  app_path = File.expand_path app_path
411
- raise "App doesn't exist #{app_path}" unless File.exist? app_path
395
+ raise "App doesn't exist. #{app_path}" unless File.exist? app_path
396
+
412
397
  app_path
413
398
  end
414
399
 
@@ -16,6 +16,8 @@ module Appium
16
16
  end
17
17
 
18
18
  # @param [string] direction Either 'up', 'down', 'left' or 'right'.
19
+ # @option opts [Double] :distance scroll distance, proportional to scroll view height.
20
+ # the value is supposed to be in between 0.0 and 1.0.
19
21
  # @option opts [String] :name the accessibility id of the child element, to which scrolling is performed.
20
22
  # @option opts [Element] :element Element id to long tap on.
21
23
  # @option opts [bool] :to_visible Boolean parameter. If set to true then asks to scroll to the first visible
@@ -26,11 +28,17 @@ module Appium
26
28
  # ```ruby
27
29
  # scroll direction: "down"
28
30
  # ```
29
- def scroll(direction:, name: nil, element: nil, to_visible: nil, predicate_string: nil)
31
+ def scroll(direction:, # rubocop:disable Metrics/ParameterLists
32
+ distance: nil,
33
+ name: nil,
34
+ element: nil,
35
+ to_visible: nil,
36
+ predicate_string: nil)
30
37
  return 'Set "up", "down", "left" or "right" for :direction' unless %w(up down left right).include?(direction)
31
38
 
32
39
  args = { direction: direction }
33
40
  args[:element] = element.ref if element
41
+ args[:distance] = distance if distance
34
42
  args[:name] = name if name
35
43
  args[:toVisible] = to_visible if to_visible
36
44
  args[:predicateString] = predicate_string if predicate_string
@@ -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.3'.freeze unless defined? ::Appium::VERSION
4
- DATE = '2018-07-07'.freeze unless defined? ::Appium::DATE
3
+ VERSION = '9.15.0'.freeze unless defined? ::Appium::VERSION
4
+ DATE = '2018-08-10'.freeze unless defined? ::Appium::DATE
5
5
  end
data/readme.md CHANGED
@@ -24,6 +24,10 @@ The `ruby_lib` wrap the driver and serve many helpful methods for users.
24
24
  - [Appium](https://github.com/appium/appium#requirements)
25
25
  - Ruby: 2.2+
26
26
 
27
+ ### Ruby Lib and Appium
28
+ - Ruby library version over `9.8.0` requires Appium over `1.8`
29
+ - Ruby library version under `9.7.5` can work with Appium under `1.7`
30
+
27
31
  ## Start appium server
28
32
 
29
33
  ```bash
@@ -70,6 +74,8 @@ gem install --no-rdoc --no-ri appium_lib
70
74
  # Load Pry
71
75
  `Pry.config.pager = false` is set if you have no `.pryrc` files and `Pry` is defined.
72
76
 
77
+ # Run tests in parallel
78
+ This repository has examples for running tests in parallel. Read [ios_tests](https://github.com/appium/ruby_lib/tree/master/ios_tests) to see them.
73
79
 
74
80
  # Contribute
75
81
  ## How to add new commands for `driver`
@@ -1,3 +1,10 @@
1
+ #### v9.14.3 2018-07-07
2
+
3
+ - [355ce1a](https://github.com/appium/ruby_lib/commit/355ce1a1618a06353da5dbc02eeb339031e9ded1) [Release 9 14 3 (#799)](https://github.com/appium/ruby_lib/issues/799)
4
+ - [cc35f60](https://github.com/appium/ruby_lib/commit/cc35f60ee1b42204a9a368e1e7679354e4f05ee7) [update (#798)](https://github.com/appium/ruby_lib/issues/798)
5
+ - [08edb8c](https://github.com/appium/ruby_lib/commit/08edb8c92aa62d7227a9a49c9d33bcbb82de7841) [add tizen (#797)](https://github.com/appium/ruby_lib/issues/797)
6
+
7
+
1
8
  #### v9.14.2 2018-06-25
2
9
 
3
10
  - [15d656c](https://github.com/appium/ruby_lib/commit/15d656c7de10a52f3da233a78e939733d9ca4f2a) [Release 9 14 2 (#796)](https://github.com/appium/ruby_lib/issues/796)
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.3
4
+ version: 9.15.0
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-07-07 00:00:00.000000000 Z
11
+ date: 2018-08-10 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.8.0
19
+ version: 1.9.0
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.8.0
26
+ version: 1.9.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tomlrb
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -198,6 +198,7 @@ extensions: []
198
198
  extra_rdoc_files: []
199
199
  files:
200
200
  - ".github/ISSUE_TEMPLATE.md"
201
+ - ".github/PULL_REQUEST_TEMPLATE.md"
201
202
  - ".gitignore"
202
203
  - ".rubocop.yml"
203
204
  - ".travis.yml"