candroid_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 +4 -4
- data/lib/candroid_helpers.rb +32 -0
- data/lib/candroid_helpers/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28bc269b6ec9f7c0d505d6642bdc97e2938eaecf
|
4
|
+
data.tar.gz: 4d4823545b10e76e05a57f0483824df60f1736f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ffdc2d49187d0326b43193987a607254028887db550e0acfd017900830e897c34484f3262c3ded70148e410dab5f123eb0a8b4312d2180f81e1ba91715feefd
|
7
|
+
data.tar.gz: 5e22c9f4d301b0ec96648ba9ff2b7ba76020728e356cfd78441ad33ca6d3ab24623a7eff187e586f7ebff896a661007ef60d5be1fa234150572c31f53552907b
|
data/lib/candroid_helpers.rb
CHANGED
@@ -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
|
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.
|
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-
|
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.
|
95
|
+
summary: candroid_helpers-0.0.4
|
96
96
|
test_files: []
|
97
97
|
has_rdoc:
|