cios_helpers 0.0.3 → 0.0.4

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: 1ba32397e2ab8887a313db3ff724cf54f59a9879
4
- data.tar.gz: 370f204b1b23797a17484fa4b31c8721a6f6dd6e
3
+ metadata.gz: d7c5f3f3bffbf0e5b0b6a70d0c097ff026c8ef4d
4
+ data.tar.gz: 6b0eba97e6aeac2076b528044ab7ee6701682e1a
5
5
  SHA512:
6
- metadata.gz: 7eb19c2f326a764c365c5a7ca0a182063e7a2cfe8b7a3b6a66c74eac6d87cbd6879fd60991bbe4005e4108cc039dd039355f1ef171a73a099b7add2fca3cc2d7
7
- data.tar.gz: 451e6603d609ef698c619568b70833d97eba18ef1fba0dc9c72a0b130fdacd2ec015e41b341afcf757c3f7a550fd3c1cd158b039abf66b709d413dfb8e7717c3
6
+ metadata.gz: 02cd73f22ae21643f8f04b88611313fc739d3961577ab277a858a01279c1d356302970196d6bcf13bc2f2c1a66dbb2ff846b3f8e7e21edbda4b992508eb20ed7
7
+ data.tar.gz: 50e5b5fa088109066dcb8e2ddaadede22b1e4e17910bc95eae96d90c131fbf4fad1298f9e9cda78b910b1671eefbc15381736861ae1a24282c2237f31f179f2a
data/lib/cios_helpers.rb CHANGED
@@ -44,4 +44,39 @@ module CiosHelpers
44
44
  trait # Return the one trait
45
45
  end
46
46
 
47
+ # Takes in a hash with the element key specified.
48
+ # Touches the given element if it exists in the
49
+ # current view.
50
+ def touch_if opts = {}
51
+ raise "No element given." if opts[:element].nil?
52
+ touch opts[:element] if element_exists opts[:element]
53
+ end
54
+
55
+ # Takes in an array of strings.
56
+ # Enters in the strings in order of
57
+ # the TextField indices.
58
+ def enter_text_by_index arr = []
59
+ arr.each_with_index do |string, index|
60
+ unless query("TextField index:#{index}").empty?
61
+ touch "TextField index:#{index}"
62
+ wait_for_elements_exist ["Keyboard"]
63
+ keyboard_enter_text string
64
+ end
65
+ end
66
+ end
67
+
68
+ # Takes in a hash where the keys
69
+ # correspond to the ids or label of the
70
+ # text fields and the values correspond
71
+ # to the strings you want to enter.
72
+ def enter_text opts = {}
73
+ opts.each do |key, value|
74
+ unless query("TextField marked:'#{key}'").empty?
75
+ touch "TextField marked:'#{key}'"
76
+ wait_for_elements_exist ["Keyboard"]
77
+ keyboard_enter_text value
78
+ end
79
+ end
80
+ end
81
+
47
82
  end
@@ -1,3 +1,3 @@
1
1
  module CiosHelpers
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cios_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Escribano
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-06 00:00:00.000000000 Z
12
+ date: 2014-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: calabash-cucumber
@@ -92,6 +92,6 @@ rubyforge_project:
92
92
  rubygems_version: 2.1.10
93
93
  signing_key:
94
94
  specification_version: 4
95
- summary: cios_helpers-0.0.3
95
+ summary: cios_helpers-0.0.4
96
96
  test_files: []
97
97
  has_rdoc: