ae_page_objects 2.0.0.beta3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ae_page_objects/core/dsl.rb +10 -17
- data/lib/ae_page_objects/elements/collection.rb +1 -1
- data/lib/ae_page_objects/node.rb +12 -0
- data/lib/ae_page_objects/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07b1aa2d9ab91e3a68f304324dd9dc0cdcbebed7
|
4
|
+
data.tar.gz: 13159dd12b104dc829e8c6450abd1c2424e008ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3b15a9735cd27e4469fdb91e9e2b45915be6c3d25be77245c1ec029f299d68052d441a474276a4ecef78674c5bf285f9fca238f8d51d0f9d0b697fa6e24c7b6
|
7
|
+
data.tar.gz: d0a87ab50beee65b9354a637cb6f66a7e0e350750548dac3ada72be78dac3b557921fb980714f4d8e9c62108c22b9d35f3529aa85c805c13073fcdd5ea97a826
|
@@ -16,18 +16,23 @@ module AePageObjects
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def element(name, options = {}, &block)
|
19
|
-
options
|
19
|
+
options = options.dup
|
20
20
|
options[:name] ||= name
|
21
|
+
options[:is] ||= Element
|
22
|
+
|
23
|
+
if block_given?
|
24
|
+
options[:is] = Class.new(options[:is], &block)
|
25
|
+
end
|
21
26
|
|
22
|
-
|
27
|
+
element_class = options[:is]
|
23
28
|
|
24
|
-
self.element_attributes[name.to_sym] =
|
29
|
+
self.element_attributes[name.to_sym] = element_class
|
25
30
|
|
26
31
|
define_method name do
|
27
|
-
|
32
|
+
self.element(options)
|
28
33
|
end
|
29
34
|
|
30
|
-
|
35
|
+
element_class
|
31
36
|
end
|
32
37
|
|
33
38
|
# Defines a collection of elements. Blocks are evaluated on the item class used by the
|
@@ -182,17 +187,5 @@ module AePageObjects
|
|
182
187
|
self.element_attributes[element_name] = element_klazz
|
183
188
|
end
|
184
189
|
end
|
185
|
-
|
186
|
-
private
|
187
|
-
|
188
|
-
def field_klass(options, &block)
|
189
|
-
klass = options.delete(:is) || Element
|
190
|
-
|
191
|
-
if block_given?
|
192
|
-
Class.new(klass, &block)
|
193
|
-
else
|
194
|
-
klass
|
195
|
-
end
|
196
|
-
end
|
197
190
|
end
|
198
191
|
end
|
@@ -57,7 +57,7 @@ module AePageObjects
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def item_at(index)
|
60
|
-
|
60
|
+
element(is: item_class_at(index), name: index, locator: item_locator_at(index))
|
61
61
|
end
|
62
62
|
|
63
63
|
def item_class_at(index)
|
data/lib/ae_page_objects/node.rb
CHANGED
@@ -60,6 +60,18 @@ module AePageObjects
|
|
60
60
|
RUBY
|
61
61
|
end
|
62
62
|
|
63
|
+
def element(options_or_locator)
|
64
|
+
options = if options_or_locator.is_a?(Hash)
|
65
|
+
options_or_locator.dup
|
66
|
+
else
|
67
|
+
{:locator => options_or_locator}
|
68
|
+
end
|
69
|
+
|
70
|
+
element_class = options.delete(:is) || Element
|
71
|
+
|
72
|
+
ElementProxy.new(element_class, self, options)
|
73
|
+
end
|
74
|
+
|
63
75
|
private
|
64
76
|
|
65
77
|
def eval_locator(locator)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ae_page_objects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Donnie Tognazzini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -75,9 +75,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: 1.9.3
|
76
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- - "
|
78
|
+
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version:
|
80
|
+
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
83
|
rubygems_version: 2.4.3
|