candroid_helpers 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4f0a26cc4a1321f1ea3fcd425b7eca936c4a299
4
- data.tar.gz: 151d617e35cc4cd635b7f816e46e231f04e4febb
3
+ metadata.gz: 28bc269b6ec9f7c0d505d6642bdc97e2938eaecf
4
+ data.tar.gz: 4d4823545b10e76e05a57f0483824df60f1736f5
5
5
  SHA512:
6
- metadata.gz: 6b3466041d212d8aacc20841208bfc2c6b179fe64a85adc7d8899849b8d83f38c8c84bde570ee067d1bc32fb9e8a4b2949d4ad14a81a479a9e39d9847eeccce2
7
- data.tar.gz: 6a9bfe42e9f3a9e1558bdb9848c605c1be5745863b6087a4b083209fd99564f044f770d5d39486a56a2d7619e04c0bf6e26cf2a484680db31d2f939c7e55ddab
6
+ metadata.gz: 1ffdc2d49187d0326b43193987a607254028887db550e0acfd017900830e897c34484f3262c3ded70148e410dab5f123eb0a8b4312d2180f81e1ba91715feefd
7
+ data.tar.gz: 5e22c9f4d301b0ec96648ba9ff2b7ba76020728e356cfd78441ad33ca6d3ab24623a7eff187e586f7ebff896a661007ef60d5be1fa234150572c31f53552907b
@@ -44,4 +44,36 @@ module CandroidHelpers
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 EditText indices.
58
+ def enter_text_by_index arr = []
59
+ arr.each_with_index do |string, index|
60
+ unless query("EditText index:#{index}").empty?
61
+ query "EditText index:#{index}", setText: string
62
+ end
63
+ end
64
+ end
65
+
66
+ # Takes in a hash where the keys
67
+ # correspond to the ids of the
68
+ # text fields and the values correspond
69
+ # to the strings you want to enter.
70
+ def enter_text opts = {}
71
+ opts.each do |key, value|
72
+ key = key.to_s
73
+ unless query("EditText id:'#{key}'").empty?
74
+ query "EditText id:'#{key}'", setText: value
75
+ end
76
+ end
77
+ end
78
+
47
79
  end
@@ -1,3 +1,3 @@
1
1
  module CandroidHelpers
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: candroid_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-android
@@ -92,6 +92,6 @@ rubyforge_project:
92
92
  rubygems_version: 2.1.10
93
93
  signing_key:
94
94
  specification_version: 4
95
- summary: candroid_helpers-0.0.3
95
+ summary: candroid_helpers-0.0.4
96
96
  test_files: []
97
97
  has_rdoc: