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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af66a2c786218a814f14fd33c4c565fd5dd5326e
4
- data.tar.gz: 3a75738d3b40ed53f93362381404cfd058e5ec27
3
+ metadata.gz: 07b1aa2d9ab91e3a68f304324dd9dc0cdcbebed7
4
+ data.tar.gz: 13159dd12b104dc829e8c6450abd1c2424e008ef
5
5
  SHA512:
6
- metadata.gz: 265b3d6d7837809c42e4dc79d3f1869d51707f90bd6efa97ed91b31ca783ebf60186d4a6468a6b09ba5f7b4a2bfb930f07683fcf2d9ffd3712447592c279c4bd
7
- data.tar.gz: ef0f45f8e1c6103a5f9a9f8a3d6f189a0753c2a8e3aaef012de27e6f957f7da949517a75cfdf14047d6eefdab769b9c74cd1b25c1bd6e7609703d798509516aa
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 = options.dup
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
- klass = field_klass(options, &block)
27
+ element_class = options[:is]
23
28
 
24
- self.element_attributes[name.to_sym] = klass
29
+ self.element_attributes[name.to_sym] = element_class
25
30
 
26
31
  define_method name do
27
- ElementProxy.new(klass, self, options)
32
+ self.element(options)
28
33
  end
29
34
 
30
- klass
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
- ElementProxy.new(item_class_at(index), self, :name => index, :locator => item_locator_at(index))
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)
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module AePageObjects
2
- VERSION = '2.0.0.beta3'.freeze
2
+ VERSION = '2.0.0'.freeze
3
3
  end
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.beta3
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-07 00:00:00.000000000 Z
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: 1.3.1
80
+ version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
83
  rubygems_version: 2.4.3