page-object 0.2.5 → 0.3.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.
- data/ChangeLog +25 -0
- data/Rakefile +3 -3
- data/features/element.feature +232 -1
- data/features/frames.feature +1 -1
- data/features/html/modal.html +17 -0
- data/features/html/modal_1.html +38 -0
- data/features/html/modal_2.html +27 -0
- data/features/html/nested_elements.html +42 -0
- data/features/html/static_elements.html +1 -0
- data/features/modal_dialog.feature +15 -0
- data/features/nested_elements.feature +73 -0
- data/features/step_definitions/frames_steps.rb +1 -1
- data/features/step_definitions/modal_dialog_steps.rb +62 -0
- data/features/step_definitions/nested_elements_steps.rb +165 -0
- data/features/support/page.rb +1 -0
- data/features/support/url_helper.rb +8 -0
- data/lib/page-object.rb +26 -0
- data/lib/page-object/accessors.rb +36 -36
- data/lib/page-object/elements/button.rb +3 -3
- data/lib/page-object/elements/check_box.rb +7 -7
- data/lib/page-object/elements/element.rb +16 -10
- data/lib/page-object/elements/form.rb +7 -7
- data/lib/page-object/elements/image.rb +7 -7
- data/lib/page-object/elements/link.rb +3 -3
- data/lib/page-object/elements/ordered_list.rb +7 -7
- data/lib/page-object/elements/radio_button.rb +7 -7
- data/lib/page-object/elements/select_list.rb +7 -7
- data/lib/page-object/elements/table.rb +7 -7
- data/lib/page-object/elements/table_row.rb +7 -7
- data/lib/page-object/elements/text_area.rb +7 -7
- data/lib/page-object/elements/text_field.rb +7 -7
- data/lib/page-object/elements/unordered_list.rb +7 -7
- data/lib/page-object/nested_elements.rb +72 -0
- data/lib/page-object/platforms.rb +2 -2
- data/lib/page-object/platforms/selenium_webdriver.rb +17 -0
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/button.rb +1 -1
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/check_box.rb +1 -1
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/element.rb +1 -1
- data/lib/page-object/platforms/{watir → selenium_webdriver}/form.rb +1 -1
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/image.rb +1 -1
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/link.rb +1 -1
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/ordered_list.rb +2 -2
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/page_object.rb +59 -59
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/radio_button.rb +1 -1
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/select_list.rb +2 -2
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/table.rb +2 -2
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/table_row.rb +2 -2
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/text_area.rb +1 -1
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/text_field.rb +1 -1
- data/lib/page-object/platforms/{selenium → selenium_webdriver}/unordered_list.rb +2 -2
- data/lib/page-object/platforms/watir_webdriver.rb +17 -0
- data/lib/page-object/platforms/{watir → watir_webdriver}/check_box.rb +1 -1
- data/lib/page-object/platforms/{watir → watir_webdriver}/element.rb +1 -1
- data/lib/page-object/platforms/{selenium → watir_webdriver}/form.rb +1 -1
- data/lib/page-object/platforms/{watir → watir_webdriver}/image.rb +1 -1
- data/lib/page-object/platforms/{watir → watir_webdriver}/ordered_list.rb +2 -2
- data/lib/page-object/platforms/watir_webdriver/page_object.rb +486 -0
- data/lib/page-object/platforms/{watir → watir_webdriver}/radio_button.rb +1 -1
- data/lib/page-object/platforms/{watir → watir_webdriver}/select_list.rb +3 -3
- data/lib/page-object/platforms/{watir → watir_webdriver}/table.rb +2 -2
- data/lib/page-object/platforms/{watir → watir_webdriver}/table_row.rb +2 -2
- data/lib/page-object/platforms/{watir → watir_webdriver}/text_area.rb +1 -1
- data/lib/page-object/platforms/{watir → watir_webdriver}/text_field.rb +1 -1
- data/lib/page-object/platforms/{watir → watir_webdriver}/unordered_list.rb +2 -2
- data/lib/page-object/version.rb +1 -1
- data/page-object.gemspec +1 -1
- data/spec/page-object/elements/button_spec.rb +1 -1
- data/spec/page-object/elements/check_box_spec.rb +1 -1
- data/spec/page-object/elements/element_spec.rb +9 -5
- data/spec/page-object/elements/form_spec.rb +2 -2
- data/spec/page-object/elements/image_spec.rb +4 -4
- data/spec/page-object/elements/link_spec.rb +1 -1
- data/spec/page-object/elements/nested_element_spec.rb +185 -0
- data/spec/page-object/elements/ordered_list_spec.rb +6 -6
- data/spec/page-object/elements/radio_button_spec.rb +1 -1
- data/spec/page-object/elements/select_list_spec.rb +5 -5
- data/spec/page-object/elements/table_row_spec.rb +6 -6
- data/spec/page-object/elements/table_spec.rb +2 -2
- data/spec/page-object/elements/text_area_spec.rb +1 -1
- data/spec/page-object/elements/text_field_spec.rb +1 -1
- data/spec/page-object/elements/unordered_list_spec.rb +6 -6
- data/spec/page-object/page-object_spec.rb +12 -2
- data/spec/page-object/platforms/{selenium → selenium_webdriver}/selenium_page_object_spec.rb +2 -2
- data/spec/page-object/platforms/selenium_webdriver_spec.rb +29 -0
- data/spec/page-object/platforms/{watir_spec.rb → watir_webdriver_spec.rb} +11 -6
- metadata +58 -39
- data/lib/page-object/platforms/selenium.rb +0 -16
- data/lib/page-object/platforms/watir.rb +0 -16
- data/lib/page-object/platforms/watir/page_object.rb +0 -482
- data/spec/page-object/platforms/selenium_spec.rb +0 -26
|
@@ -22,7 +22,7 @@ describe PageObject::Elements::RadioButton do
|
|
|
22
22
|
describe "interface" do
|
|
23
23
|
context "for selenium" do
|
|
24
24
|
let(:selenium_rb) { double('radio_button') }
|
|
25
|
-
let(:radio_button) { PageObject::Elements::RadioButton.new(selenium_rb, :platform => :
|
|
25
|
+
let(:radio_button) { PageObject::Elements::RadioButton.new(selenium_rb, :platform => :selenium_webdriver) }
|
|
26
26
|
|
|
27
27
|
it "should select" do
|
|
28
28
|
selenium_rb.should_receive(:click)
|
|
@@ -31,14 +31,14 @@ describe PageObject::Elements::SelectList do
|
|
|
31
31
|
|
|
32
32
|
context "for watir" do
|
|
33
33
|
it "should return an option when indexed" do
|
|
34
|
-
watir_sel_list = PageObject::Elements::SelectList.new(sel_list, :platform => :
|
|
34
|
+
watir_sel_list = PageObject::Elements::SelectList.new(sel_list, :platform => :watir_webdriver)
|
|
35
35
|
sel_list.stub(:wd).and_return(sel_list)
|
|
36
36
|
sel_list.should_receive(:find_elements).with(:xpath, ".//child::option").and_return(opts)
|
|
37
37
|
watir_sel_list[0].should be_instance_of PageObject::Elements::Option
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
it "should return an array of options" do
|
|
41
|
-
watir_sel_list = PageObject::Elements::SelectList.new(sel_list, :platform => :
|
|
41
|
+
watir_sel_list = PageObject::Elements::SelectList.new(sel_list, :platform => :watir_webdriver)
|
|
42
42
|
sel_list.stub(:wd).and_return(sel_list)
|
|
43
43
|
sel_list.should_receive(:find_elements).with(:xpath, ".//child::option").and_return(opts)
|
|
44
44
|
watir_sel_list.options.size.should == 2
|
|
@@ -47,19 +47,19 @@ describe PageObject::Elements::SelectList do
|
|
|
47
47
|
|
|
48
48
|
context "for selenium" do
|
|
49
49
|
it "should return an option when indexed" do
|
|
50
|
-
selenium_sel_list = PageObject::Elements::SelectList.new(sel_list, :platform => :
|
|
50
|
+
selenium_sel_list = PageObject::Elements::SelectList.new(sel_list, :platform => :selenium_webdriver)
|
|
51
51
|
sel_list.should_receive(:find_elements).with(:xpath, ".//child::option").and_return(opts)
|
|
52
52
|
selenium_sel_list[1].should be_instance_of PageObject::Elements::Option
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
it "should return an array of options" do
|
|
56
|
-
selenium_sel_list = PageObject::Elements::SelectList.new(sel_list, :platform => :
|
|
56
|
+
selenium_sel_list = PageObject::Elements::SelectList.new(sel_list, :platform => :selenium_webdriver)
|
|
57
57
|
sel_list.should_receive(:find_elements).with(:xpath, ".//child::option").and_return(opts)
|
|
58
58
|
selenium_sel_list.options.size.should == 2
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
it "should select an element" do
|
|
62
|
-
selenium_sel_list = PageObject::Elements::SelectList.new(sel_list, :platform => :
|
|
62
|
+
selenium_sel_list = PageObject::Elements::SelectList.new(sel_list, :platform => :selenium_webdriver)
|
|
63
63
|
sel_list.should_receive(:send_keys).with('something')
|
|
64
64
|
selenium_sel_list.select 'something'
|
|
65
65
|
end
|
|
@@ -8,21 +8,21 @@ describe PageObject::Elements::TableRow do
|
|
|
8
8
|
describe "interface" do
|
|
9
9
|
context "for selenium" do
|
|
10
10
|
it "should return a table cell when indexed" do
|
|
11
|
-
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :
|
|
11
|
+
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :selenium_webdriver)
|
|
12
12
|
table_row_driver.should_receive(:find_elements).with(:xpath, ".//child::td|th").and_return(table_cell)
|
|
13
13
|
table_cell.should_receive(:[]).and_return(table_cell)
|
|
14
14
|
table_row[0].should be_instance_of PageObject::Elements::TableCell
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
it "should retrun the number of columns" do
|
|
18
|
-
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :
|
|
18
|
+
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :selenium_webdriver)
|
|
19
19
|
table_row_driver.should_receive(:find_elements).with(:xpath, ".//child::td|th").and_return(table_row_driver)
|
|
20
20
|
table_row_driver.should_receive(:size).and_return(3)
|
|
21
21
|
table_row.columns.should == 3
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
it "should iterate over the table columns" do
|
|
25
|
-
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :
|
|
25
|
+
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :selenium_webdriver)
|
|
26
26
|
table_row.should_receive(:columns).and_return(2)
|
|
27
27
|
table_row.stub(:[]).and_return(table_row_driver)
|
|
28
28
|
count = 0
|
|
@@ -37,13 +37,13 @@ describe PageObject::Elements::TableRow do
|
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
it "should return a table cell when indexed" do
|
|
40
|
-
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :
|
|
40
|
+
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :watir_webdriver)
|
|
41
41
|
table_row_driver.should_receive(:[]).with(1).and_return(table_cell)
|
|
42
42
|
table_row[1].should be_instance_of PageObject::Elements::TableCell
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
it "should return the number of columns" do
|
|
46
|
-
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :
|
|
46
|
+
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :watir_webdriver)
|
|
47
47
|
table_row_driver.stub(:wd).and_return(table_row_driver)
|
|
48
48
|
table_row_driver.should_receive(:find_elements).with(:xpath, ".//child::td|th").and_return(table_row_driver)
|
|
49
49
|
table_row_driver.should_receive(:size).and_return(3)
|
|
@@ -51,7 +51,7 @@ describe PageObject::Elements::TableRow do
|
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
it "should iterate over the table columns" do
|
|
54
|
-
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :
|
|
54
|
+
table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :watir_webdriver)
|
|
55
55
|
table_row.should_receive(:columns).and_return(2)
|
|
56
56
|
table_row.stub(:[])
|
|
57
57
|
count = 0
|
|
@@ -27,7 +27,7 @@ describe PageObject::Elements::Table do
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
context "for watir" do
|
|
30
|
-
let(:watir_table) { PageObject::Elements::Table.new(table_element, :platform => :
|
|
30
|
+
let(:watir_table) { PageObject::Elements::Table.new(table_element, :platform => :watir_webdriver) }
|
|
31
31
|
|
|
32
32
|
it "should return a table row when indexed" do
|
|
33
33
|
table_element.stub(:[]).with(1).and_return(table_element)
|
|
@@ -50,7 +50,7 @@ describe PageObject::Elements::Table do
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
context "for selenium" do
|
|
53
|
-
let(:selenium_table) { PageObject::Elements::Table.new(table_element, :platform => :
|
|
53
|
+
let(:selenium_table) { PageObject::Elements::Table.new(table_element, :platform => :selenium_webdriver) }
|
|
54
54
|
|
|
55
55
|
it "should return a table row when indexed" do
|
|
56
56
|
table_element.should_receive(:find_elements).with(:xpath, ".//child::tr").and_return(table_element)
|
|
@@ -34,7 +34,7 @@ describe PageObject::Elements::TextArea do
|
|
|
34
34
|
context "for Selenium" do
|
|
35
35
|
it "should set its' value" do
|
|
36
36
|
text_area_element = double('text_area')
|
|
37
|
-
text_area = PageObject::Elements::TextArea.new(text_area_element, :platform => :
|
|
37
|
+
text_area = PageObject::Elements::TextArea.new(text_area_element, :platform => :selenium_webdriver)
|
|
38
38
|
text_area_element.should_receive(:clear)
|
|
39
39
|
text_area_element.should_receive(:send_keys).with('Joseph')
|
|
40
40
|
text_area.value = 'Joseph'
|
|
@@ -35,7 +35,7 @@ describe PageObject::Elements::TextField do
|
|
|
35
35
|
context "for selenium" do
|
|
36
36
|
it "should set its' value" do
|
|
37
37
|
text_field_element = double('selenium_text_field')
|
|
38
|
-
selenium_text_field = PageObject::Elements::TextField.new(text_field_element, :platform => :
|
|
38
|
+
selenium_text_field = PageObject::Elements::TextField.new(text_field_element, :platform => :selenium_webdriver)
|
|
39
39
|
text_field_element.should_receive(:clear)
|
|
40
40
|
text_field_element.should_receive(:send_keys).with('Joseph')
|
|
41
41
|
selenium_text_field.value = 'Joseph'
|
|
@@ -25,7 +25,7 @@ describe PageObject::Elements::UnorderedList do
|
|
|
25
25
|
|
|
26
26
|
context "for watir" do
|
|
27
27
|
it "should return a list item when indexed" do
|
|
28
|
-
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :
|
|
28
|
+
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :watir_webdriver)
|
|
29
29
|
ul_element.stub(:wd).and_return(ul_element)
|
|
30
30
|
ul_element.stub(:find_elements).and_return(ul_element)
|
|
31
31
|
ul_element.stub(:[])
|
|
@@ -33,7 +33,7 @@ describe PageObject::Elements::UnorderedList do
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
it "should know how many items it contains" do
|
|
36
|
-
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :
|
|
36
|
+
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :watir_webdriver)
|
|
37
37
|
ul_element.stub(:wd).and_return(ul_element)
|
|
38
38
|
ul_element.stub(:find_elements).and_return(ul_element)
|
|
39
39
|
ul_element.stub(:size).and_return(5)
|
|
@@ -41,7 +41,7 @@ describe PageObject::Elements::UnorderedList do
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
it "should know how to iterate over the items" do
|
|
44
|
-
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :
|
|
44
|
+
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :watir_webdriver)
|
|
45
45
|
ul.should_receive(:items).and_return(5)
|
|
46
46
|
ul.stub(:[])
|
|
47
47
|
count = 0
|
|
@@ -52,21 +52,21 @@ describe PageObject::Elements::UnorderedList do
|
|
|
52
52
|
|
|
53
53
|
context "for selenium" do
|
|
54
54
|
it "should return a list item when indexed" do
|
|
55
|
-
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :
|
|
55
|
+
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :selenium_webdriver)
|
|
56
56
|
ul_element.should_receive(:find_elements).and_return(ul_element)
|
|
57
57
|
ul_element.stub(:[])
|
|
58
58
|
ul[1].should be_instance_of PageObject::Elements::ListItem
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
it "should know how many items it contains" do
|
|
62
|
-
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :
|
|
62
|
+
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :selenium_webdriver)
|
|
63
63
|
ul_element.should_receive(:find_elements).and_return(ul_element)
|
|
64
64
|
ul_element.should_receive(:size).and_return(5)
|
|
65
65
|
ul.items.should == 5
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
it "should know how to iterate over the items" do
|
|
69
|
-
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :
|
|
69
|
+
ul = PageObject::Elements::UnorderedList.new(ul_element, :platform => :selenium_webdriver)
|
|
70
70
|
ul.should_receive(:items).and_return(5)
|
|
71
71
|
ul.stub(:[])
|
|
72
72
|
count = 0
|
|
@@ -15,13 +15,13 @@ describe PageObject do
|
|
|
15
15
|
|
|
16
16
|
context "when created with a watir-webdriver browser" do
|
|
17
17
|
it "should include the WatirPageObject module" do
|
|
18
|
-
watir_page_object.platform.should be_kind_of PageObject::
|
|
18
|
+
watir_page_object.platform.should be_kind_of PageObject::Platforms::WatirWebDriver::PageObject
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
context "when created with a selenium browser" do
|
|
23
23
|
it "should include the SeleniumPageObject module" do
|
|
24
|
-
selenium_page_object.platform.should be_kind_of
|
|
24
|
+
selenium_page_object.platform.should be_kind_of PageObject::Platforms::SeleniumWebDriver::PageObject
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
|
|
@@ -109,6 +109,11 @@ describe PageObject do
|
|
|
109
109
|
end
|
|
110
110
|
end
|
|
111
111
|
|
|
112
|
+
it "should convert a modal popup to a window" do
|
|
113
|
+
watir_browser.should_receive(:execute_script)
|
|
114
|
+
watir_page_object.modal_dialog {}
|
|
115
|
+
end
|
|
116
|
+
|
|
112
117
|
it "should switch to a new window with a given title" do
|
|
113
118
|
watir_browser.should_receive(:window).with(:title => /My\ Title/).and_return(watir_browser)
|
|
114
119
|
watir_browser.should_receive(:use)
|
|
@@ -182,6 +187,11 @@ describe PageObject do
|
|
|
182
187
|
end
|
|
183
188
|
end
|
|
184
189
|
|
|
190
|
+
it "should convert a modal popup to a window" do
|
|
191
|
+
selenium_browser.should_receive(:execute_script)
|
|
192
|
+
selenium_page_object.modal_dialog {}
|
|
193
|
+
end
|
|
194
|
+
|
|
185
195
|
it "should switch to a new window with a given title" do
|
|
186
196
|
selenium_browser.should_receive(:window_handles).and_return(["win1"])
|
|
187
197
|
selenium_browser.should_receive(:switch_to).twice.and_return(selenium_browser)
|
data/spec/page-object/platforms/{selenium → selenium_webdriver}/selenium_page_object_spec.rb
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
|
-
require 'page-object/platforms/
|
|
2
|
+
require 'page-object/platforms/selenium_webdriver/page_object'
|
|
3
3
|
require 'page-object/elements'
|
|
4
4
|
|
|
5
5
|
class SeleniumTestPageObject
|
|
6
6
|
include PageObject
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
describe PageObject::Platforms::
|
|
9
|
+
describe PageObject::Platforms::SeleniumWebDriver::PageObject do
|
|
10
10
|
let(:selenium_browser) { mock_selenium_browser }
|
|
11
11
|
let(:selenium_page_object) { SeleniumTestPageObject.new(selenium_browser) }
|
|
12
12
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
describe PageObject::Platforms::SeleniumWebDriver do
|
|
5
|
+
|
|
6
|
+
it "should be registered as an adapter" do
|
|
7
|
+
PageObject::Platforms.get[:selenium_webdriver].should be PageObject::Platforms::SeleniumWebDriver
|
|
8
|
+
|
|
9
|
+
end
|
|
10
|
+
describe 'create page object' do
|
|
11
|
+
let(:browser) { double('browser') }
|
|
12
|
+
let(:subject) { PageObject::Platforms::SeleniumWebDriver.create_page_object(browser) }
|
|
13
|
+
|
|
14
|
+
it "should create a SeleniumPageObject" do
|
|
15
|
+
subject.should be_kind_of PageObject::Platforms::SeleniumWebDriver::PageObject
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
describe "is for?" do
|
|
20
|
+
it "should be true when the browser is a selenium driver" do
|
|
21
|
+
browser = mock_selenium_browser()
|
|
22
|
+
PageObject::Platforms::SeleniumWebDriver.is_for?(browser).should == true
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "should be false when the browser is anything else" do
|
|
26
|
+
PageObject::Platforms::SeleniumWebDriver.is_for?("asdf").should == false
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
describe PageObject::Platforms::
|
|
3
|
+
describe PageObject::Platforms::WatirWebDriver do
|
|
4
|
+
|
|
4
5
|
it "should be in the PageObjects Adapters list" do
|
|
5
|
-
PageObject::Platforms.get[:
|
|
6
|
+
PageObject::Platforms.get[:watir_webdriver].should be PageObject::Platforms::WatirWebDriver
|
|
6
7
|
end
|
|
8
|
+
|
|
7
9
|
describe "create page object" do
|
|
8
10
|
let(:browser) { double('browser') }
|
|
9
|
-
let(:subject) { PageObject::Platforms::
|
|
11
|
+
let(:subject) { PageObject::Platforms::WatirWebDriver.create_page_object(browser) }
|
|
12
|
+
|
|
10
13
|
it "should create a WatirPageObject" do
|
|
11
|
-
subject.should be_kind_of PageObject::
|
|
14
|
+
subject.should be_kind_of PageObject::Platforms::WatirWebDriver::PageObject
|
|
12
15
|
end
|
|
16
|
+
|
|
13
17
|
it "should give the watir page object the browser" do
|
|
14
18
|
subject.browser.should be browser
|
|
15
19
|
end
|
|
@@ -17,11 +21,12 @@ describe PageObject::Platforms::Watir do
|
|
|
17
21
|
describe "is for?" do
|
|
18
22
|
it "should be true when the browser is Watir::Browser" do
|
|
19
23
|
browser = mock_watir_browser()
|
|
20
|
-
PageObject::Platforms::
|
|
24
|
+
PageObject::Platforms::WatirWebDriver.is_for?(browser).should be true
|
|
21
25
|
end
|
|
26
|
+
|
|
22
27
|
it "should be false at any other point" do
|
|
23
28
|
browser = 'asdf'
|
|
24
|
-
PageObject::Platforms::
|
|
29
|
+
PageObject::Platforms::WatirWebDriver.is_for?('asdf').should be false
|
|
25
30
|
end
|
|
26
31
|
end
|
|
27
32
|
end
|
metadata
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: page-object
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 0.
|
|
5
|
+
version: 0.3.0
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Jeff Morgan
|
|
@@ -10,7 +10,7 @@ autorequire:
|
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
12
|
|
|
13
|
-
date: 2011-
|
|
13
|
+
date: 2011-09-04 00:00:00 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: watir-webdriver
|
|
@@ -31,7 +31,7 @@ dependencies:
|
|
|
31
31
|
requirements:
|
|
32
32
|
- - ">="
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: 2.
|
|
34
|
+
version: 2.5.0
|
|
35
35
|
type: :runtime
|
|
36
36
|
version_requirements: *id002
|
|
37
37
|
- !ruby/object:Gem::Dependency
|
|
@@ -101,6 +101,10 @@ files:
|
|
|
101
101
|
- features/html/frames.html
|
|
102
102
|
- features/html/iframes.html
|
|
103
103
|
- features/html/images/circle.png
|
|
104
|
+
- features/html/modal.html
|
|
105
|
+
- features/html/modal_1.html
|
|
106
|
+
- features/html/modal_2.html
|
|
107
|
+
- features/html/nested_elements.html
|
|
104
108
|
- features/html/nested_frame_1.html
|
|
105
109
|
- features/html/nested_frame_2.html
|
|
106
110
|
- features/html/nested_frame_3.html
|
|
@@ -110,6 +114,8 @@ files:
|
|
|
110
114
|
- features/image.feature
|
|
111
115
|
- features/link.feature
|
|
112
116
|
- features/list_item.feature
|
|
117
|
+
- features/modal_dialog.feature
|
|
118
|
+
- features/nested_elements.feature
|
|
113
119
|
- features/ordered_list.feature
|
|
114
120
|
- features/page_level_actions.feature
|
|
115
121
|
- features/radio_button.feature
|
|
@@ -127,6 +133,8 @@ files:
|
|
|
127
133
|
- features/step_definitions/image_steps.rb
|
|
128
134
|
- features/step_definitions/link_steps.rb
|
|
129
135
|
- features/step_definitions/list_item_steps.rb
|
|
136
|
+
- features/step_definitions/modal_dialog_steps.rb
|
|
137
|
+
- features/step_definitions/nested_elements_steps.rb
|
|
130
138
|
- features/step_definitions/ordered_list_steps.rb
|
|
131
139
|
- features/step_definitions/page_level_actions_steps.rb
|
|
132
140
|
- features/step_definitions/page_traversal_steps.rb
|
|
@@ -172,38 +180,39 @@ files:
|
|
|
172
180
|
- lib/page-object/elements/text_field.rb
|
|
173
181
|
- lib/page-object/elements/unordered_list.rb
|
|
174
182
|
- lib/page-object/loads_platform.rb
|
|
183
|
+
- lib/page-object/nested_elements.rb
|
|
175
184
|
- lib/page-object/page_factory.rb
|
|
176
185
|
- lib/page-object/platforms.rb
|
|
177
|
-
- lib/page-object/platforms/
|
|
178
|
-
- lib/page-object/platforms/
|
|
179
|
-
- lib/page-object/platforms/
|
|
180
|
-
- lib/page-object/platforms/
|
|
181
|
-
- lib/page-object/platforms/
|
|
182
|
-
- lib/page-object/platforms/
|
|
183
|
-
- lib/page-object/platforms/
|
|
184
|
-
- lib/page-object/platforms/
|
|
185
|
-
- lib/page-object/platforms/
|
|
186
|
-
- lib/page-object/platforms/
|
|
187
|
-
- lib/page-object/platforms/
|
|
188
|
-
- lib/page-object/platforms/
|
|
189
|
-
- lib/page-object/platforms/
|
|
190
|
-
- lib/page-object/platforms/
|
|
191
|
-
- lib/page-object/platforms/
|
|
192
|
-
- lib/page-object/platforms/
|
|
193
|
-
- lib/page-object/platforms/
|
|
194
|
-
- lib/page-object/platforms/
|
|
195
|
-
- lib/page-object/platforms/
|
|
196
|
-
- lib/page-object/platforms/
|
|
197
|
-
- lib/page-object/platforms/
|
|
198
|
-
- lib/page-object/platforms/
|
|
199
|
-
- lib/page-object/platforms/
|
|
200
|
-
- lib/page-object/platforms/
|
|
201
|
-
- lib/page-object/platforms/
|
|
202
|
-
- lib/page-object/platforms/
|
|
203
|
-
- lib/page-object/platforms/
|
|
204
|
-
- lib/page-object/platforms/
|
|
205
|
-
- lib/page-object/platforms/
|
|
206
|
-
- lib/page-object/platforms/
|
|
186
|
+
- lib/page-object/platforms/selenium_webdriver.rb
|
|
187
|
+
- lib/page-object/platforms/selenium_webdriver/button.rb
|
|
188
|
+
- lib/page-object/platforms/selenium_webdriver/check_box.rb
|
|
189
|
+
- lib/page-object/platforms/selenium_webdriver/element.rb
|
|
190
|
+
- lib/page-object/platforms/selenium_webdriver/form.rb
|
|
191
|
+
- lib/page-object/platforms/selenium_webdriver/image.rb
|
|
192
|
+
- lib/page-object/platforms/selenium_webdriver/link.rb
|
|
193
|
+
- lib/page-object/platforms/selenium_webdriver/ordered_list.rb
|
|
194
|
+
- lib/page-object/platforms/selenium_webdriver/page_object.rb
|
|
195
|
+
- lib/page-object/platforms/selenium_webdriver/radio_button.rb
|
|
196
|
+
- lib/page-object/platforms/selenium_webdriver/select_list.rb
|
|
197
|
+
- lib/page-object/platforms/selenium_webdriver/table.rb
|
|
198
|
+
- lib/page-object/platforms/selenium_webdriver/table_row.rb
|
|
199
|
+
- lib/page-object/platforms/selenium_webdriver/text_area.rb
|
|
200
|
+
- lib/page-object/platforms/selenium_webdriver/text_field.rb
|
|
201
|
+
- lib/page-object/platforms/selenium_webdriver/unordered_list.rb
|
|
202
|
+
- lib/page-object/platforms/watir_webdriver.rb
|
|
203
|
+
- lib/page-object/platforms/watir_webdriver/check_box.rb
|
|
204
|
+
- lib/page-object/platforms/watir_webdriver/element.rb
|
|
205
|
+
- lib/page-object/platforms/watir_webdriver/form.rb
|
|
206
|
+
- lib/page-object/platforms/watir_webdriver/image.rb
|
|
207
|
+
- lib/page-object/platforms/watir_webdriver/ordered_list.rb
|
|
208
|
+
- lib/page-object/platforms/watir_webdriver/page_object.rb
|
|
209
|
+
- lib/page-object/platforms/watir_webdriver/radio_button.rb
|
|
210
|
+
- lib/page-object/platforms/watir_webdriver/select_list.rb
|
|
211
|
+
- lib/page-object/platforms/watir_webdriver/table.rb
|
|
212
|
+
- lib/page-object/platforms/watir_webdriver/table_row.rb
|
|
213
|
+
- lib/page-object/platforms/watir_webdriver/text_area.rb
|
|
214
|
+
- lib/page-object/platforms/watir_webdriver/text_field.rb
|
|
215
|
+
- lib/page-object/platforms/watir_webdriver/unordered_list.rb
|
|
207
216
|
- lib/page-object/version.rb
|
|
208
217
|
- page-object.gemspec
|
|
209
218
|
- spec/page-object/accessors_spec.rb
|
|
@@ -217,6 +226,7 @@ files:
|
|
|
217
226
|
- spec/page-object/elements/image_spec.rb
|
|
218
227
|
- spec/page-object/elements/link_spec.rb
|
|
219
228
|
- spec/page-object/elements/list_item_spec.rb
|
|
229
|
+
- spec/page-object/elements/nested_element_spec.rb
|
|
220
230
|
- spec/page-object/elements/ordered_list_spec.rb
|
|
221
231
|
- spec/page-object/elements/radio_button_spec.rb
|
|
222
232
|
- spec/page-object/elements/select_list_spec.rb
|
|
@@ -229,9 +239,9 @@ files:
|
|
|
229
239
|
- spec/page-object/loads_platform_spec.rb
|
|
230
240
|
- spec/page-object/page-object_spec.rb
|
|
231
241
|
- spec/page-object/page_factory_spec.rb
|
|
232
|
-
- spec/page-object/platforms/
|
|
233
|
-
- spec/page-object/platforms/
|
|
234
|
-
- spec/page-object/platforms/
|
|
242
|
+
- spec/page-object/platforms/selenium_webdriver/selenium_page_object_spec.rb
|
|
243
|
+
- spec/page-object/platforms/selenium_webdriver_spec.rb
|
|
244
|
+
- spec/page-object/platforms/watir_webdriver_spec.rb
|
|
235
245
|
- spec/spec_helper.rb
|
|
236
246
|
homepage: http://github.com/cheezy/page-object
|
|
237
247
|
licenses: []
|
|
@@ -275,6 +285,10 @@ test_files:
|
|
|
275
285
|
- features/html/frames.html
|
|
276
286
|
- features/html/iframes.html
|
|
277
287
|
- features/html/images/circle.png
|
|
288
|
+
- features/html/modal.html
|
|
289
|
+
- features/html/modal_1.html
|
|
290
|
+
- features/html/modal_2.html
|
|
291
|
+
- features/html/nested_elements.html
|
|
278
292
|
- features/html/nested_frame_1.html
|
|
279
293
|
- features/html/nested_frame_2.html
|
|
280
294
|
- features/html/nested_frame_3.html
|
|
@@ -284,6 +298,8 @@ test_files:
|
|
|
284
298
|
- features/image.feature
|
|
285
299
|
- features/link.feature
|
|
286
300
|
- features/list_item.feature
|
|
301
|
+
- features/modal_dialog.feature
|
|
302
|
+
- features/nested_elements.feature
|
|
287
303
|
- features/ordered_list.feature
|
|
288
304
|
- features/page_level_actions.feature
|
|
289
305
|
- features/radio_button.feature
|
|
@@ -301,6 +317,8 @@ test_files:
|
|
|
301
317
|
- features/step_definitions/image_steps.rb
|
|
302
318
|
- features/step_definitions/link_steps.rb
|
|
303
319
|
- features/step_definitions/list_item_steps.rb
|
|
320
|
+
- features/step_definitions/modal_dialog_steps.rb
|
|
321
|
+
- features/step_definitions/nested_elements_steps.rb
|
|
304
322
|
- features/step_definitions/ordered_list_steps.rb
|
|
305
323
|
- features/step_definitions/page_level_actions_steps.rb
|
|
306
324
|
- features/step_definitions/page_traversal_steps.rb
|
|
@@ -331,6 +349,7 @@ test_files:
|
|
|
331
349
|
- spec/page-object/elements/image_spec.rb
|
|
332
350
|
- spec/page-object/elements/link_spec.rb
|
|
333
351
|
- spec/page-object/elements/list_item_spec.rb
|
|
352
|
+
- spec/page-object/elements/nested_element_spec.rb
|
|
334
353
|
- spec/page-object/elements/ordered_list_spec.rb
|
|
335
354
|
- spec/page-object/elements/radio_button_spec.rb
|
|
336
355
|
- spec/page-object/elements/select_list_spec.rb
|
|
@@ -343,7 +362,7 @@ test_files:
|
|
|
343
362
|
- spec/page-object/loads_platform_spec.rb
|
|
344
363
|
- spec/page-object/page-object_spec.rb
|
|
345
364
|
- spec/page-object/page_factory_spec.rb
|
|
346
|
-
- spec/page-object/platforms/
|
|
347
|
-
- spec/page-object/platforms/
|
|
348
|
-
- spec/page-object/platforms/
|
|
365
|
+
- spec/page-object/platforms/selenium_webdriver/selenium_page_object_spec.rb
|
|
366
|
+
- spec/page-object/platforms/selenium_webdriver_spec.rb
|
|
367
|
+
- spec/page-object/platforms/watir_webdriver_spec.rb
|
|
349
368
|
- spec/spec_helper.rb
|