calabash-cucumber 0.14.1 → 0.14.2.pre1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44d1708b6d5566733c61a00e1783d07c8292da76
4
- data.tar.gz: f681223caa78b7e984ded6cb74ddde9d45c754fd
3
+ metadata.gz: b3d24ef92d4b66bd13c1ceb292b84588c6adbc3e
4
+ data.tar.gz: 9206b69d1c119c7d97d6a2820e656af3771e5731
5
5
  SHA512:
6
- metadata.gz: 24c3fd3e101013ab438f6d3a9f2303fcfc90ba16bd82d04cb71c0406d74725675ac6feac128005b2bb8e529329d0293dfdb7d05a373ec20de1c22d86a7dd89c5
7
- data.tar.gz: c9bccbae8a82ffca1e3d513c184e146ab387a196976cc032ce730065a78364c6456819e378a4bd5dd66a14629713b75d11a638ef6ecd6b688f2f06d6443ed77c
6
+ metadata.gz: 310f714054788df414ae01f55a3aec7cf1af8501bd3da89cae3e9b8bf771262eb53c9537319e6a89c8f2d14d6acb0bb8afd6c716d7bdc2e460a2c53f066a2269
7
+ data.tar.gz: a820f3287a1aedbd678010cd53056e201691aef72d4484bafc50587f6c5817caf24427097dca06a4ea44a9b4f18b1e92eb5c38ba46e55f8ac7e417317196dfa4
Binary file
Binary file
@@ -739,6 +739,40 @@ module Calabash
739
739
  texts
740
740
  end
741
741
 
742
+ # Set the sliders indicated by `uiquery` to `value`.
743
+ #
744
+ # @example
745
+ # slider_set_value "UISlider marked:'office slider'", 2
746
+ # slider_set_value "slider marked:'weather slider'", -1
747
+ # slider_set_value "* marked:'science slider'", 3
748
+ # slider_set_value "UISlider", 11
749
+ #
750
+ # @param [String] uiquery A query.
751
+ # @param [Number] value The value to set the slider to. value.to_s should
752
+ # produce a String representation of a Number.
753
+ # @param [options] options Options to control the behavior of the gesture.
754
+ # @option options [Boolean] :animate (true) Animate the change.
755
+ # @option options [Boolean] :notify_targets (true) Simulate a UIEvent by
756
+ # calling every target/action pair defined on the UISliders matching
757
+ # `uiquery`.
758
+ # @raise [RuntimeError] When setting the value of the sliders match by
759
+ # `uiquery` is not successful.
760
+ # @return [Array<String>] An array of query results.
761
+ def slider_set_value(uiquery, value, options={})
762
+ default_options = {:animate => true,
763
+ :notify_targets => true}
764
+ merged_options = default_options.merge(options)
765
+
766
+ value_str = value.to_s
767
+
768
+ args = [merged_options[:animate], merged_options[:notify_targets]]
769
+ views_touched = map(uiquery, :changeSlider, value_str, *args)
770
+
771
+ msg = "Could not set value of slider to '#{value}' using query '#{uiquery}'"
772
+ assert_map_results(views_touched, msg)
773
+ views_touched
774
+ end
775
+
742
776
  # Calls a method on the app's AppDelegate object.
743
777
  #
744
778
  # This is an escape hatch for calling an arbitrary hook inside
@@ -78,24 +78,24 @@ module Calabash
78
78
  res
79
79
  end
80
80
 
81
- # asserts the result of a calabash `map` call and raises an error with
81
+ # Asserts the result of a calabash `map` call and raises an error with
82
82
  # `msg` if no valid results are found.
83
83
  #
84
- # casual gem users should never need to call this method; this is a
84
+ # Casual gem users should never need to call this method; this is a
85
85
  # convenience method for gem maintainers.
86
86
  #
87
- # raises an error if `map_results`:
87
+ # Raises an error if `map_results`:
88
88
  #
89
89
  # is an empty list #=> []
90
90
  # contains a '<VOID>' string #=> [ "<VOID>" ]
91
91
  # contains '*****' string #=> [ "*****" ]
92
92
  # contains a single nil #=> [ nil ]
93
93
  #
94
- # when evaluating whether a `map` call is successful it is important to
94
+ # When evaluating whether a `map` call is successful it is important to
95
95
  # note that sometimes a <tt>[ nil ]</tt> or <tt>[nil, <val>, nil]</tt> is
96
96
  # a valid result.
97
97
  #
98
- # consider a controller with 3 labels:
98
+ # Consider a controller with 3 labels:
99
99
  #
100
100
  # label @ index 0 has text "foo"
101
101
  # label @ index 1 has text nil (the [label text] => nil)
@@ -104,13 +104,13 @@ module Calabash
104
104
  # map('label', :text) => ['foo', nil, 'bar']
105
105
  # map('label index:1', :text) => [nil]
106
106
  #
107
- # in other cases, <tt>[ nil ]</tt> should be treated as an invalid result
107
+ # In other cases, <tt>[ nil ]</tt> should be treated as an invalid result
108
108
  #
109
109
  # # invalid
110
110
  # > mark = 'mark does not exist'
111
111
  # > map('tableView', :scrollToRowWithMark, mark, args) => [ nil ]
112
112
  #
113
- # here a <tt>[ nil ]</tt> should be considered invalid because the
113
+ # Here a <tt>[ nil ]</tt> should be considered invalid because the
114
114
  # the operation could not be performed because there is not row that
115
115
  # matches `mark`
116
116
  def assert_map_results(map_results, msg)
@@ -119,7 +119,6 @@ module Calabash
119
119
  screenshot_and_raise msg
120
120
  end
121
121
  end
122
-
123
122
  end
124
123
  end
125
- end
124
+ end
@@ -3,10 +3,10 @@ module Calabash
3
3
 
4
4
  # @!visibility public
5
5
  # The Calabash iOS gem version.
6
- VERSION = '0.14.1'
6
+ VERSION = '0.14.2.pre1'
7
7
 
8
8
  # @!visibility public
9
9
  # The minimum required version of the Calabash embedded server.
10
- MIN_SERVER_VERSION = '0.14.1'
10
+ MIN_SERVER_VERSION = '0.14.2.pre1'
11
11
  end
12
12
  end
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.2.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-29 00:00:00.000000000 Z
11
+ date: 2015-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -546,12 +546,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
546
546
  version: '1.9'
547
547
  required_rubygems_version: !ruby/object:Gem::Requirement
548
548
  requirements:
549
- - - ">="
549
+ - - ">"
550
550
  - !ruby/object:Gem::Version
551
- version: '0'
551
+ version: 1.3.1
552
552
  requirements: []
553
553
  rubyforge_project:
554
- rubygems_version: 2.4.5
554
+ rubygems_version: 2.2.2
555
555
  signing_key:
556
556
  specification_version: 4
557
557
  summary: Client for calabash-ios-server for automated functional testing on iOS