page-object 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +4 -0
- data/lib/page-object.rb +1 -0
- data/lib/page-object/elements/table.rb +5 -0
- data/lib/page-object/elements/table_row.rb +5 -0
- data/lib/page-object/page_factory.rb +1 -1
- data/lib/page-object/platforms/selenium_webdriver/table.rb +1 -1
- data/lib/page-object/platforms/selenium_webdriver/table_row.rb +1 -1
- data/lib/page-object/platforms/watir_webdriver/table.rb +1 -1
- data/lib/page-object/platforms/watir_webdriver/table_row.rb +1 -1
- data/lib/page-object/version.rb +1 -1
- data/page-object.gemspec +2 -2
- data/spec/page-object/page_factory_spec.rb +1 -1
- metadata +8 -8
data/ChangeLog
CHANGED
data/lib/page-object.rb
CHANGED
@@ -267,6 +267,7 @@ module PageObject
|
|
267
267
|
# * :id => Watir and Selenium
|
268
268
|
# * :index => Watir and Selenium
|
269
269
|
# * :name => Watir and Selenium
|
270
|
+
# * :class => Watir only
|
270
271
|
# @param frame passed from a previous call to in_frame. Used to nest calls
|
271
272
|
# @param block that contains the calls to elements that exist inside the frame.
|
272
273
|
#
|
@@ -44,6 +44,11 @@ module PageObject
|
|
44
44
|
".//child::tr"
|
45
45
|
end
|
46
46
|
|
47
|
+
def initialize_row(row_element, platform)
|
48
|
+
::PageObject::Elements::TableRow.new(row_element, platform)
|
49
|
+
end
|
50
|
+
|
51
|
+
|
47
52
|
def include_platform_for platform
|
48
53
|
super
|
49
54
|
if platform[:platform] == :watir_webdriver
|
@@ -26,6 +26,11 @@ module PageObject
|
|
26
26
|
".//child::td|th"
|
27
27
|
end
|
28
28
|
|
29
|
+
def initialize_cell(row_element, platform)
|
30
|
+
::PageObject::Elements::TableCell.new(row_element, platform)
|
31
|
+
end
|
32
|
+
|
33
|
+
|
29
34
|
def include_platform_for platform
|
30
35
|
super
|
31
36
|
if platform[:platform] == :watir_webdriver
|
@@ -31,7 +31,7 @@ module PageObject
|
|
31
31
|
# :another_route => [[PageOne,:method1, "arg1"], [PageTwoB,:method2b], [PageThree,:method3]]
|
32
32
|
# }
|
33
33
|
#
|
34
|
-
# Notice the first entry of :
|
34
|
+
# Notice the first entry of :another_route is passing an argument
|
35
35
|
# to the method.
|
36
36
|
#
|
37
37
|
module PageFactory
|
@@ -14,7 +14,7 @@ module PageObject
|
|
14
14
|
eles = table_rows
|
15
15
|
idx = find_index_by_title(idx, eles) if idx.kind_of?(String)
|
16
16
|
return nil unless idx
|
17
|
-
|
17
|
+
initialize_row(eles[idx], :platform => :selenium_webdriver)
|
18
18
|
end
|
19
19
|
|
20
20
|
#
|
@@ -14,7 +14,7 @@ module PageObject
|
|
14
14
|
els = table_cells
|
15
15
|
idx = find_index_by_title(idx) if idx.kind_of?(String)
|
16
16
|
return nil unless idx && columns >= idx + 1
|
17
|
-
|
17
|
+
initialize_cell(els[idx], :platform => :selenium_webdriver)
|
18
18
|
end
|
19
19
|
|
20
20
|
#
|
@@ -14,7 +14,7 @@ module PageObject
|
|
14
14
|
def [](idx)
|
15
15
|
idx = find_index_by_title(idx) if idx.kind_of?(String)
|
16
16
|
return nil unless idx
|
17
|
-
|
17
|
+
initialize_row(element[idx], :platform => :watir_webdriver)
|
18
18
|
end
|
19
19
|
|
20
20
|
#
|
@@ -12,7 +12,7 @@ module PageObject
|
|
12
12
|
def [](idx)
|
13
13
|
idx = find_index_by_title(idx) if idx.kind_of?(String)
|
14
14
|
return nil unless idx && columns >= idx + 1
|
15
|
-
|
15
|
+
initialize_cell(element[idx], :platform => :watir_webdriver)
|
16
16
|
end
|
17
17
|
|
18
18
|
#
|
data/lib/page-object/version.rb
CHANGED
data/page-object.gemspec
CHANGED
@@ -20,8 +20,8 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
22
|
s.add_dependency 'watir-webdriver', '>= 0.6.2'
|
23
|
-
s.add_dependency 'selenium-webdriver', '>= 2.
|
24
|
-
s.add_dependency 'page_navigation', '>= 0.
|
23
|
+
s.add_dependency 'selenium-webdriver', '>= 2.30.0'
|
24
|
+
s.add_dependency 'page_navigation', '>= 0.6'
|
25
25
|
|
26
26
|
s.add_development_dependency 'rspec', '>= 2.12.0'
|
27
27
|
s.add_development_dependency 'cucumber', '>= 1.2.0'
|
@@ -220,7 +220,7 @@ describe PageObject::PageFactory do
|
|
220
220
|
expect { @world.navigate_to(AnotherPage) }.to raise_error
|
221
221
|
end
|
222
222
|
|
223
|
-
it "should know how to continue
|
223
|
+
it "should know how to continue routing from a location" do
|
224
224
|
PageObject::PageFactory.routes = {
|
225
225
|
:default => [[FactoryTestPage, :a_method],
|
226
226
|
[AnotherPage, :b_method],
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: page-object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: watir-webdriver
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 2.
|
37
|
+
version: 2.30.0
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 2.
|
45
|
+
version: 2.30.0
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: page_navigation
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
53
|
+
version: '0.6'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
61
|
+
version: '0.6'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rspec
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -397,7 +397,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
397
397
|
version: '0'
|
398
398
|
segments:
|
399
399
|
- 0
|
400
|
-
hash:
|
400
|
+
hash: 2605320443104154235
|
401
401
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
402
402
|
none: false
|
403
403
|
requirements:
|
@@ -406,7 +406,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
406
406
|
version: '0'
|
407
407
|
segments:
|
408
408
|
- 0
|
409
|
-
hash:
|
409
|
+
hash: 2605320443104154235
|
410
410
|
requirements: []
|
411
411
|
rubyforge_project: page-object
|
412
412
|
rubygems_version: 1.8.24
|