appom 0.3.1 → 0.4.0
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 +4 -4
- data/lib/appom/element_container.rb +25 -13
- data/lib/appom/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dfe63bdf19bf6f40316e2936d3999a4b38c318fea12b9c6c4da67349ac0e5d5
|
4
|
+
data.tar.gz: 0fd90a46359d87728ef19c10369710a47957ce23773e7b850531e9751a5656c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 257d602e52213df6d7cf4bc87c8b40aa97926047bfa0af025f226c68c215a8261cf6e8e6327de02c12ddec8acf14b8b5455e6daa4197156cb2c5c7c91c4236fc
|
7
|
+
data.tar.gz: d8ddb29f6881a3e9ab4204917642f36f2767359f77e614fe43785c36e24bd8cef8331500edc0c8c8f2f669cf97f1527485d918b4bbba102740f3c808032fe71c
|
@@ -4,18 +4,30 @@ module Appom
|
|
4
4
|
klass.extend ClassMethods
|
5
5
|
end
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
# Raise if contain a block
|
8
|
+
def raise_if_block(obj, name, has_block, type)
|
9
|
+
return unless has_block
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
return unless has_block
|
11
|
+
puts "Type passed in: #{type}"
|
12
|
+
puts "#{obj.class}##{name} does not accept blocks"
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
raise Appom::UnsupportedBlockError
|
15
|
+
end
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
##
|
18
|
+
# Options re-combiner. This takes the original inputs and combines
|
19
|
+
# them such that there is only one hash passed as a final argument
|
20
|
+
# to Appium.
|
21
|
+
#
|
22
|
+
def merge_args(find_args, runtime_args)
|
23
|
+
find_args = find_args.dup.flatten
|
24
|
+
runtime_args = runtime_args.dup
|
25
|
+
|
26
|
+
[*find_args, *runtime_args]
|
27
|
+
end
|
28
|
+
|
29
|
+
module ClassMethods
|
30
|
+
attr_reader :mapped_items
|
19
31
|
|
20
32
|
##
|
21
33
|
#
|
@@ -31,9 +43,9 @@ module Appom
|
|
31
43
|
#
|
32
44
|
def element(name, *find_args)
|
33
45
|
build(name, *find_args) do |*runtime_args, &block|
|
34
|
-
raise_if_block(self, name, !block.nil?, :element)
|
35
46
|
define_method(name) do
|
36
|
-
|
47
|
+
raise_if_block(self, name, !block.nil?, :element)
|
48
|
+
find(*merge_args(find_args, runtime_args))
|
37
49
|
end
|
38
50
|
end
|
39
51
|
end
|
@@ -52,9 +64,9 @@ module Appom
|
|
52
64
|
#
|
53
65
|
def elements(name, *find_args)
|
54
66
|
build(name, *find_args) do |*runtime_args, &block|
|
55
|
-
raise_if_block(self, name, !block.nil?, :elements)
|
56
67
|
define_method(name) do
|
57
|
-
|
68
|
+
raise_if_block(self, name, !block.nil?, :elements)
|
69
|
+
all(*merge_args(find_args, runtime_args))
|
58
70
|
end
|
59
71
|
end
|
60
72
|
end
|
data/lib/appom/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harry.Tran
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appium_lib
|