page-object 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/ChangeLog +4 -0
- data/features/radio_button_group.feature +4 -4
- data/lib/page-object/page_populator.rb +10 -0
- data/lib/page-object/version.rb +1 -1
- data/spec/page-object/elements/select_list_spec.rb +1 -1
- data/spec/page-object/elements/selenium_element_spec.rb +1 -1
- data/spec/page-object/elements/table_cell_spec.rb +1 -1
- data/spec/page-object/elements/watir_element_spec.rb +1 -1
- data/spec/page-object/page-object_spec.rb +2 -2
- data/spec/page-object/page_factory_spec.rb +1 -1
- data/spec/page-object/page_populator_spec.rb +6 -0
- data/spec/page-object/platforms/selenium_webdriver/selenium_page_object_spec.rb +1 -1
- data/spec/page-object/selenium_accessors_spec.rb +1 -1
- data/spec/page-object/watir_accessors_spec.rb +1 -1
- metadata +24 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a30377dc0af7ba09c90456f8e21a54a59f55f43f
|
4
|
+
data.tar.gz: 23f24c2b8aecef31248f0316f68d6fe523bd2598
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b9fe63e3d0c4d464b92aed01b9cf33caf9db545c0df3ee5e989a85579bc4093ebc7336ad2a25d5af699fdac667cc7580442e7ea2f3bb4f81aa8e69ed97463c1
|
7
|
+
data.tar.gz: 70c3f5da44e5b37fcfca5cac3388793ce1a156dceb5cc02706a6abf1406601b95c4a33f79359f15cedafb3d83f68bf457c2564e032a4dc1df4638ce674bcfdb5
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.1.1
|
data/ChangeLog
CHANGED
@@ -16,12 +16,12 @@ Feature: Radio Button Groups
|
|
16
16
|
Scenario: Selecting grouped radio buttons by value
|
17
17
|
When I select the "ched" radio button in the group
|
18
18
|
Then the "ched" radio button should be selected in the group
|
19
|
-
|
20
|
-
|
19
|
+
And the "emmen" radio button should not be selected
|
20
|
+
And the "muen" radio button should not be selected
|
21
21
|
When I select the "muen" radio button in the group
|
22
22
|
Then the "ched" radio button should not be selected
|
23
|
-
|
24
|
-
|
23
|
+
And the "emmen" radio button should not be selected
|
24
|
+
And the "muen" radio button should be selected in the group
|
25
25
|
|
26
26
|
Scenario: Getting an array of elements for each radio button in the group
|
27
27
|
When I ask for the elements of a radio button group
|
@@ -32,6 +32,7 @@ module PageObject
|
|
32
32
|
def populate_page_with(data)
|
33
33
|
data.each do |key, value|
|
34
34
|
populate_checkbox(key, value) if is_checkbox?(key) and is_enabled?(key)
|
35
|
+
populate_radiobuttongroup(key, value) if is_radiobuttongroup?(key)
|
35
36
|
populate_radiobutton(key, value) if is_radiobutton?(key) and is_enabled?(key)
|
36
37
|
populate_text(key, value) if is_text?(key) and is_enabled?(key)
|
37
38
|
end
|
@@ -53,6 +54,10 @@ module PageObject
|
|
53
54
|
return self.send "clear_#{key}"
|
54
55
|
end
|
55
56
|
|
57
|
+
def populate_radiobuttongroup(key, value)
|
58
|
+
return self.send("select_#{key}", value)
|
59
|
+
end
|
60
|
+
|
56
61
|
def is_text?(key)
|
57
62
|
respond_to?("#{key}=".to_sym)
|
58
63
|
end
|
@@ -65,7 +70,12 @@ module PageObject
|
|
65
70
|
respond_to?("select_#{key}".to_sym)
|
66
71
|
end
|
67
72
|
|
73
|
+
def is_radiobuttongroup?(key)
|
74
|
+
respond_to?("select_#{key}".to_sym) and respond_to?("#{key}_values")
|
75
|
+
end
|
76
|
+
|
68
77
|
def is_enabled?(key)
|
78
|
+
return false if is_radiobuttongroup?(key)
|
69
79
|
return true if (self.send "#{key}_element").tag_name == "textarea"
|
70
80
|
element = self.send("#{key}_element")
|
71
81
|
element.enabled? and element.visible?
|
data/lib/page-object/version.rb
CHANGED
@@ -126,7 +126,7 @@ describe PageObject::Elements::SelectList do
|
|
126
126
|
sel_list.should_receive(:find_elements).and_return(opts)
|
127
127
|
opts[0].should_receive(:selected?).twice.and_return(true)
|
128
128
|
opts[0].should_receive(:text).and_return('blah')
|
129
|
-
selenium_sel_list.selected?('blah').should
|
129
|
+
selenium_sel_list.selected?('blah').should be true
|
130
130
|
end
|
131
131
|
|
132
132
|
it "should be able to clear selected options" do
|
@@ -58,7 +58,7 @@ describe "Element for Selenium" do
|
|
58
58
|
|
59
59
|
it "should know how to retrieve the value of an attribute" do
|
60
60
|
@selenium_driver.should_receive(:attribute).and_return(true)
|
61
|
-
@selenium_element.attribute('readonly').should
|
61
|
+
@selenium_element.attribute('readonly').should be true
|
62
62
|
end
|
63
63
|
|
64
64
|
it "should be clickable" do
|
@@ -15,7 +15,7 @@ describe PageObject::Elements::TableCell do
|
|
15
15
|
it "should always be enabled" do
|
16
16
|
table_cell_element = double('table_cell_element')
|
17
17
|
table_cell = PageObject::Elements::TableCell.new(table_cell_element, :platform => :selenium_webdriver)
|
18
|
-
table_cell.enabled?.should
|
18
|
+
table_cell.enabled?.should be true
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -56,7 +56,7 @@ describe "Element for Watir" do
|
|
56
56
|
it "should know how to retrieve the value of an attribute" do
|
57
57
|
watir_driver.stub(:attribute_value).and_return(true)
|
58
58
|
watir_driver.stub(:attribute).and_return(true)
|
59
|
-
watir_element.attribute("readonly").should
|
59
|
+
watir_element.attribute("readonly").should be true
|
60
60
|
end
|
61
61
|
|
62
62
|
it "should be clickable" do
|
@@ -123,7 +123,7 @@ describe PageObject do
|
|
123
123
|
end
|
124
124
|
|
125
125
|
@page = CallbackPage.new(watir_browser)
|
126
|
-
@page.initialize_page_called.should
|
126
|
+
@page.initialize_page_called.should be true
|
127
127
|
end
|
128
128
|
|
129
129
|
it "should call initialize_accessors if it exists" do
|
@@ -137,7 +137,7 @@ describe PageObject do
|
|
137
137
|
end
|
138
138
|
|
139
139
|
@page = CallbackPage.new(watir_browser)
|
140
|
-
@page.initialize_accessors_called.should
|
140
|
+
@page.initialize_accessors_called.should be true
|
141
141
|
end
|
142
142
|
|
143
143
|
it "should call initialize_accessors before initialize_page if both exist" do
|
@@ -9,6 +9,7 @@ class PageObjectTestPageObject
|
|
9
9
|
file_field(:ff, :id => 'id')
|
10
10
|
checkbox(:cb, :id => 'id')
|
11
11
|
radio_button(:rb, :id => 'id')
|
12
|
+
radio_button_group(:rbg, :id => 'id')
|
12
13
|
end
|
13
14
|
|
14
15
|
describe PageObject::PagePopulator do
|
@@ -86,6 +87,11 @@ describe PageObject::PagePopulator do
|
|
86
87
|
page_object.populate_page_with('rb' => false)
|
87
88
|
end
|
88
89
|
|
90
|
+
it "should select the correct element from a radio button group" do
|
91
|
+
page_object.should_receive(:select_rbg).with('blah')
|
92
|
+
page_object.populate_page_with('rbg' => 'blah')
|
93
|
+
end
|
94
|
+
|
89
95
|
it "should not populate a checkbox if it is disabled" do
|
90
96
|
page_object.should_not_receive(:check_cb)
|
91
97
|
page_object.should_receive(:cb_element).twice.and_return(browser)
|
@@ -49,7 +49,7 @@ describe PageObject::Platforms::SeleniumWebDriver::PageObject do
|
|
49
49
|
it "should know it is not exist" do
|
50
50
|
selenium_browser.should_receive(:find_element).twice.and_raise(Selenium::WebDriver::Error::NoSuchElementError)
|
51
51
|
page = SeleniumTestPageObject.new(selenium_browser)
|
52
|
-
page.link_element(:text => 'blah').element.exists?.should
|
52
|
+
page.link_element(:text => 'blah').element.exists?.should be false
|
53
53
|
end
|
54
54
|
|
55
55
|
it "should know it is not visible" do
|
@@ -271,7 +271,7 @@ describe PageObject::Accessors do
|
|
271
271
|
it "should know if a check box element is selected" do
|
272
272
|
selenium_browser.should_receive(:find_element).and_return(selenium_browser)
|
273
273
|
selenium_browser.should_receive(:selected?).and_return(true)
|
274
|
-
selenium_page_object.active_checked?.should
|
274
|
+
selenium_page_object.active_checked?.should be true
|
275
275
|
end
|
276
276
|
|
277
277
|
it "should retrieve a checkbox element" do
|
@@ -580,7 +580,7 @@ describe PageObject::Accessors do
|
|
580
580
|
it "should know if a check box element is selected" do
|
581
581
|
watir_browser.should_receive(:checkbox).and_return(watir_browser)
|
582
582
|
watir_browser.should_receive(:set?).and_return(true)
|
583
|
-
watir_page_object.active_checked?.should
|
583
|
+
watir_page_object.active_checked?.should be true
|
584
584
|
end
|
585
585
|
|
586
586
|
it "should retrieve a checkbox element" do
|
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: page-object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: watir-webdriver
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.6.8
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.6.8
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: selenium-webdriver
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.40.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.40.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: page_navigation
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.9'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.9'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 2.14.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 2.14.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: cucumber
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 1.3.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.3.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: yard
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 0.7.2
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.7.2
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rack
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '1.0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '1.0'
|
111
111
|
description: Page Object DSL that works with both Watir and Selenium
|
@@ -115,11 +115,11 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
-
- .gitignore
|
119
|
-
- .rspec
|
120
|
-
- .ruby-gemset
|
121
|
-
- .ruby-version
|
122
|
-
- .travis.yml
|
118
|
+
- ".gitignore"
|
119
|
+
- ".rspec"
|
120
|
+
- ".ruby-gemset"
|
121
|
+
- ".ruby-version"
|
122
|
+
- ".travis.yml"
|
123
123
|
- ChangeLog
|
124
124
|
- Gemfile
|
125
125
|
- Guardfile
|
@@ -383,17 +383,17 @@ require_paths:
|
|
383
383
|
- lib
|
384
384
|
required_ruby_version: !ruby/object:Gem::Requirement
|
385
385
|
requirements:
|
386
|
-
- -
|
386
|
+
- - ">="
|
387
387
|
- !ruby/object:Gem::Version
|
388
388
|
version: '0'
|
389
389
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
390
390
|
requirements:
|
391
|
-
- -
|
391
|
+
- - ">="
|
392
392
|
- !ruby/object:Gem::Version
|
393
393
|
version: '0'
|
394
394
|
requirements: []
|
395
395
|
rubyforge_project: page-object
|
396
|
-
rubygems_version: 2.
|
396
|
+
rubygems_version: 2.2.2
|
397
397
|
signing_key:
|
398
398
|
specification_version: 4
|
399
399
|
summary: Page Object DSL for browser testing
|