page-object-lds 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +10 -0
- data/ChangeLog +799 -0
- data/Gemfile +13 -0
- data/Guardfile +20 -0
- data/LICENSE +20 -0
- data/README.md +111 -0
- data/Rakefile +35 -0
- data/cucumber.yml +10 -0
- data/features/area.feature +35 -0
- data/features/async.feature +30 -0
- data/features/audio.feature +68 -0
- data/features/bold.feature +21 -0
- data/features/button.feature +88 -0
- data/features/canvas.feature +37 -0
- data/features/check_box.feature +55 -0
- data/features/div.feature +45 -0
- data/features/element.feature +322 -0
- data/features/file_field.feature +40 -0
- data/features/form.feature +43 -0
- data/features/frames.feature +75 -0
- data/features/generic_elements.feature +29 -0
- data/features/gxt_table_extension.feature +24 -0
- data/features/headings.feature +97 -0
- data/features/hidden_field.feature +45 -0
- data/features/html/04-Death_Becomes_Fur.mp4 +0 -0
- data/features/html/04-Death_Becomes_Fur.oga +0 -0
- data/features/html/async.html +36 -0
- data/features/html/double_click.html +13 -0
- data/features/html/failure.html +8 -0
- data/features/html/frame_1.html +18 -0
- data/features/html/frame_2.html +16 -0
- data/features/html/frame_3.html +14 -0
- data/features/html/frames.html +12 -0
- data/features/html/hover.html +12 -0
- data/features/html/iframes.html +12 -0
- data/features/html/images/circle.png +0 -0
- data/features/html/images/img_pulpit.jpg +0 -0
- data/features/html/images/submit.gif +0 -0
- data/features/html/indexed_property.html +52 -0
- 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/movie.mp4 +0 -0
- data/features/html/movie.ogg +0 -0
- data/features/html/multi_elements.html +144 -0
- data/features/html/nested_elements.html +77 -0
- data/features/html/nested_frame_1.html +1 -0
- data/features/html/nested_frame_2.html +11 -0
- data/features/html/nested_frame_3.html +14 -0
- data/features/html/nested_frames.html +10 -0
- data/features/html/planets.gif +0 -0
- data/features/html/static_elements.html +205 -0
- data/features/html/success.html +8 -0
- data/features/html/sun.gif +0 -0
- data/features/html/sun.html +7 -0
- data/features/image.feature +50 -0
- data/features/indexed_property.feature +98 -0
- data/features/javascript.feature +28 -0
- data/features/label.feature +46 -0
- data/features/link.feature +52 -0
- data/features/list_item.feature +36 -0
- data/features/modal_dialog.feature +15 -0
- data/features/multi_elements.feature +492 -0
- data/features/nested_elements.feature +117 -0
- data/features/ordered_list.feature +56 -0
- data/features/page_level_actions.feature +90 -0
- data/features/paragraph.feature +35 -0
- data/features/radio_button.feature +58 -0
- data/features/radio_button_group.feature +29 -0
- data/features/sample-app/public/jquery-1.3.2.js +4376 -0
- data/features/sample-app/public/jquery.html +30 -0
- data/features/sample-app/public/prototype-1.6.0.3.js +4320 -0
- data/features/sample-app/public/prototype.html +35 -0
- data/features/sample-app/sample_app.rb +35 -0
- data/features/select_list.feature +86 -0
- data/features/span.feature +37 -0
- data/features/step_definitions/accessor_steps.rb +60 -0
- data/features/step_definitions/area_steps.rb +19 -0
- data/features/step_definitions/async_steps.rb +83 -0
- data/features/step_definitions/audio_steps.rb +27 -0
- data/features/step_definitions/bold_steps.rb +12 -0
- data/features/step_definitions/button_steps.rb +43 -0
- data/features/step_definitions/canvas_steps.rb +15 -0
- data/features/step_definitions/check_box_steps.rb +35 -0
- data/features/step_definitions/div_steps.rb +19 -0
- data/features/step_definitions/element_steps.rb +266 -0
- data/features/step_definitions/file_field_steps.rb +19 -0
- data/features/step_definitions/form_steps.rb +19 -0
- data/features/step_definitions/frames_steps.rb +159 -0
- data/features/step_definitions/generic_element_steps.rb +31 -0
- data/features/step_definitions/gxt_table_steps.rb +58 -0
- data/features/step_definitions/headings_steps.rb +12 -0
- data/features/step_definitions/hidden_field_steps.rb +27 -0
- data/features/step_definitions/image_steps.rb +27 -0
- data/features/step_definitions/indexed_property_steps.rb +129 -0
- data/features/step_definitions/javascript_steps.rb +53 -0
- data/features/step_definitions/label_steps.rb +19 -0
- data/features/step_definitions/link_steps.rb +40 -0
- data/features/step_definitions/list_item_steps.rb +19 -0
- data/features/step_definitions/modal_dialog_steps.rb +62 -0
- data/features/step_definitions/multi_elements_steps.rb +541 -0
- data/features/step_definitions/nested_elements_steps.rb +212 -0
- data/features/step_definitions/ordered_list_steps.rb +23 -0
- data/features/step_definitions/page_level_actions_steps.rb +135 -0
- data/features/step_definitions/page_traversal_steps.rb +4 -0
- data/features/step_definitions/paragraph_steps.rb +28 -0
- data/features/step_definitions/radio_button_group_steps.rb +36 -0
- data/features/step_definitions/radio_button_steps.rb +27 -0
- data/features/step_definitions/select_list_steps.rb +65 -0
- data/features/step_definitions/span_steps.rb +19 -0
- data/features/step_definitions/table_cell_steps.rb +15 -0
- data/features/step_definitions/table_steps.rb +70 -0
- data/features/step_definitions/text_area_steps.rb +35 -0
- data/features/step_definitions/text_field_steps.rb +35 -0
- data/features/step_definitions/unordered_list_steps.rb +23 -0
- data/features/step_definitions/video_steps.rb +45 -0
- data/features/support/ajax_text_environment.rb +26 -0
- data/features/support/env.rb +8 -0
- data/features/support/hooks.rb +8 -0
- data/features/support/page.rb +373 -0
- data/features/support/persistent_browser.rb +70 -0
- data/features/support/targets/firefox14_osx.rb +6 -0
- data/features/support/targets/firefox14_windows7.rb +6 -0
- data/features/support/url_helper.rb +57 -0
- data/features/table.feature +122 -0
- data/features/table_cell.feature +45 -0
- data/features/text_area.feature +51 -0
- data/features/text_field.feature +70 -0
- data/features/unordered_list.feature +56 -0
- data/features/video.feature +73 -0
- data/lib/page-object-lds.rb +421 -0
- data/lib/page-object/accessors.rb +1334 -0
- data/lib/page-object/core_ext/string.rb +5 -0
- data/lib/page-object/element_locators.rb +21 -0
- data/lib/page-object/elements/area.rb +31 -0
- data/lib/page-object/elements/audio.rb +9 -0
- data/lib/page-object/elements/bold.rb +11 -0
- data/lib/page-object/elements/button.rb +35 -0
- data/lib/page-object/elements/canvas.rb +23 -0
- data/lib/page-object/elements/check_box.rb +40 -0
- data/lib/page-object/elements/div.rb +19 -0
- data/lib/page-object/elements/element.rb +225 -0
- data/lib/page-object/elements/file_field.rb +41 -0
- data/lib/page-object/elements/form.rb +39 -0
- data/lib/page-object/elements/heading.rb +15 -0
- data/lib/page-object/elements/hidden_field.rb +22 -0
- data/lib/page-object/elements/image.rb +39 -0
- data/lib/page-object/elements/label.rb +19 -0
- data/lib/page-object/elements/link.rb +49 -0
- data/lib/page-object/elements/list_item.rb +19 -0
- data/lib/page-object/elements/media.rb +45 -0
- data/lib/page-object/elements/option.rb +10 -0
- data/lib/page-object/elements/ordered_list.rb +53 -0
- data/lib/page-object/elements/paragraph.rb +9 -0
- data/lib/page-object/elements/radio_button.rb +40 -0
- data/lib/page-object/elements/select_list.rb +45 -0
- data/lib/page-object/elements/span.rb +19 -0
- data/lib/page-object/elements/table.rb +82 -0
- data/lib/page-object/elements/table_cell.rb +28 -0
- data/lib/page-object/elements/table_row.rb +53 -0
- data/lib/page-object/elements/text_area.rb +41 -0
- data/lib/page-object/elements/text_field.rb +45 -0
- data/lib/page-object/elements/unordered_list.rb +54 -0
- data/lib/page-object/elements/video.rb +18 -0
- data/lib/page-object/indexed_properties.rb +36 -0
- data/lib/page-object/javascript/angularjs.rb +14 -0
- data/lib/page-object/javascript/jquery.rb +14 -0
- data/lib/page-object/javascript/prototype.rb +14 -0
- data/lib/page-object/javascript/yui.rb +19 -0
- data/lib/page-object/javascript_framework_facade.rb +80 -0
- data/lib/page-object/loads_platform.rb +26 -0
- data/lib/page-object/locator_generator.rb +130 -0
- data/lib/page-object/nested_elements.rb +17 -0
- data/lib/page-object/page_factory.rb +108 -0
- data/lib/page-object/page_populator.rb +83 -0
- data/lib/page-object/platforms.rb +19 -0
- data/lib/page-object/platforms/lds_watir_webdriver.rb +17 -0
- data/lib/page-object/platforms/lds_watir_webdriver/check_box.rb +29 -0
- data/lib/page-object/platforms/lds_watir_webdriver/element.rb +249 -0
- data/lib/page-object/platforms/lds_watir_webdriver/file_field.rb +16 -0
- data/lib/page-object/platforms/lds_watir_webdriver/form.rb +16 -0
- data/lib/page-object/platforms/lds_watir_webdriver/image.rb +22 -0
- data/lib/page-object/platforms/lds_watir_webdriver/link.rb +15 -0
- data/lib/page-object/platforms/lds_watir_webdriver/ordered_list.rb +35 -0
- data/lib/page-object/platforms/lds_watir_webdriver/page_object.rb +1044 -0
- data/lib/page-object/platforms/lds_watir_webdriver/radio_button.rb +22 -0
- data/lib/page-object/platforms/lds_watir_webdriver/select_list.rb +74 -0
- data/lib/page-object/platforms/lds_watir_webdriver/table.rb +38 -0
- data/lib/page-object/platforms/lds_watir_webdriver/table_row.rb +37 -0
- data/lib/page-object/platforms/lds_watir_webdriver/text_area.rb +23 -0
- data/lib/page-object/platforms/lds_watir_webdriver/text_field.rb +16 -0
- data/lib/page-object/platforms/lds_watir_webdriver/unordered_list.rb +36 -0
- data/lib/page-object/platforms/selenium_webdriver.rb +17 -0
- data/lib/page-object/platforms/selenium_webdriver/button.rb +15 -0
- data/lib/page-object/platforms/selenium_webdriver/check_box.rb +29 -0
- data/lib/page-object/platforms/selenium_webdriver/element.rb +291 -0
- data/lib/page-object/platforms/selenium_webdriver/file_field.rb +16 -0
- data/lib/page-object/platforms/selenium_webdriver/form.rb +16 -0
- data/lib/page-object/platforms/selenium_webdriver/image.rb +28 -0
- data/lib/page-object/platforms/selenium_webdriver/link.rb +23 -0
- data/lib/page-object/platforms/selenium_webdriver/ordered_list.rb +39 -0
- data/lib/page-object/platforms/selenium_webdriver/page_object.rb +1162 -0
- data/lib/page-object/platforms/selenium_webdriver/radio_button.rb +22 -0
- data/lib/page-object/platforms/selenium_webdriver/select_list.rb +93 -0
- data/lib/page-object/platforms/selenium_webdriver/surrogate_selenium_element.rb +42 -0
- data/lib/page-object/platforms/selenium_webdriver/table.rb +42 -0
- data/lib/page-object/platforms/selenium_webdriver/table_row.rb +43 -0
- data/lib/page-object/platforms/selenium_webdriver/text_area.rb +17 -0
- data/lib/page-object/platforms/selenium_webdriver/text_field.rb +17 -0
- data/lib/page-object/platforms/selenium_webdriver/unordered_list.rb +39 -0
- data/lib/page-object/platforms/watir_webdriver.rb +17 -0
- data/lib/page-object/platforms/watir_webdriver/check_box.rb +29 -0
- data/lib/page-object/platforms/watir_webdriver/element.rb +249 -0
- data/lib/page-object/platforms/watir_webdriver/file_field.rb +16 -0
- data/lib/page-object/platforms/watir_webdriver/form.rb +16 -0
- data/lib/page-object/platforms/watir_webdriver/image.rb +22 -0
- data/lib/page-object/platforms/watir_webdriver/link.rb +15 -0
- data/lib/page-object/platforms/watir_webdriver/ordered_list.rb +35 -0
- data/lib/page-object/platforms/watir_webdriver/page_object.rb +1044 -0
- data/lib/page-object/platforms/watir_webdriver/radio_button.rb +22 -0
- data/lib/page-object/platforms/watir_webdriver/select_list.rb +74 -0
- data/lib/page-object/platforms/watir_webdriver/table.rb +38 -0
- data/lib/page-object/platforms/watir_webdriver/table_row.rb +37 -0
- data/lib/page-object/platforms/watir_webdriver/text_area.rb +23 -0
- data/lib/page-object/platforms/watir_webdriver/text_field.rb +16 -0
- data/lib/page-object/platforms/watir_webdriver/unordered_list.rb +36 -0
- data/lib/page-object/version.rb +4 -0
- data/lib/page-object/widgets.rb +134 -0
- data/page-object-lds.gemspec +33 -0
- data/pageobject.gems +1 -0
- data/spec/page-object/accessors_spec.rb +40 -0
- data/spec/page-object/element_locators_spec.rb +1100 -0
- data/spec/page-object/elements/area_spec.rb +45 -0
- data/spec/page-object/elements/bold_spec.rb +29 -0
- data/spec/page-object/elements/button_spec.rb +50 -0
- data/spec/page-object/elements/canvas_spec.rb +40 -0
- data/spec/page-object/elements/check_box_spec.rb +49 -0
- data/spec/page-object/elements/div_spec.rb +28 -0
- data/spec/page-object/elements/element_spec.rb +114 -0
- data/spec/page-object/elements/file_field_spec.rb +39 -0
- data/spec/page-object/elements/form_spec.rb +28 -0
- data/spec/page-object/elements/heading_spec.rb +48 -0
- data/spec/page-object/elements/hidden_field_spec.rb +28 -0
- data/spec/page-object/elements/image_spec.rb +66 -0
- data/spec/page-object/elements/label_spec.rb +29 -0
- data/spec/page-object/elements/link_spec.rb +49 -0
- data/spec/page-object/elements/list_item_spec.rb +29 -0
- data/spec/page-object/elements/nested_element_spec.rb +254 -0
- data/spec/page-object/elements/option_spec.rb +11 -0
- data/spec/page-object/elements/ordered_list_spec.rb +94 -0
- data/spec/page-object/elements/paragraph_spec.rb +27 -0
- data/spec/page-object/elements/select_list_spec.rb +142 -0
- data/spec/page-object/elements/selenium/radio_button_spec.rb +44 -0
- data/spec/page-object/elements/selenium/text_field_spec.rb +49 -0
- data/spec/page-object/elements/selenium_element_spec.rb +172 -0
- data/spec/page-object/elements/span_spec.rb +26 -0
- data/spec/page-object/elements/table_cell_spec.rb +21 -0
- data/spec/page-object/elements/table_row_spec.rb +70 -0
- data/spec/page-object/elements/table_spec.rb +98 -0
- data/spec/page-object/elements/text_area_spec.rb +39 -0
- data/spec/page-object/elements/unordered_list_spec.rb +94 -0
- data/spec/page-object/elements/watir_element_spec.rb +141 -0
- data/spec/page-object/javascript_framework_facade_spec.rb +61 -0
- data/spec/page-object/loads_platform_spec.rb +53 -0
- data/spec/page-object/page-object_spec.rb +413 -0
- data/spec/page-object/page_factory_spec.rb +238 -0
- data/spec/page-object/page_populator_spec.rb +122 -0
- data/spec/page-object/platforms/selenium_webdriver/selenium_page_object_spec.rb +68 -0
- data/spec/page-object/platforms/selenium_webdriver_spec.rb +29 -0
- data/spec/page-object/platforms/watir_webdriver/watir_page_object_spec.rb +29 -0
- data/spec/page-object/platforms/watir_webdriver_spec.rb +9 -0
- data/spec/page-object/selenium_accessors_spec.rb +609 -0
- data/spec/page-object/watir_accessors_spec.rb +1134 -0
- data/spec/page-object/widget_spec.rb +226 -0
- data/spec/spec_helper.rb +44 -0
- metadata +430 -0
@@ -0,0 +1,1100 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class ElementLocatorsTestPageObject
|
4
|
+
include PageObject
|
5
|
+
end
|
6
|
+
|
7
|
+
|
8
|
+
describe PageObject::ElementLocators do
|
9
|
+
|
10
|
+
context "when using Watir" do
|
11
|
+
let(:watir_browser) { mock_watir_browser }
|
12
|
+
let(:watir_page_object) { ElementLocatorsTestPageObject.new(watir_browser) }
|
13
|
+
|
14
|
+
it "should find a button element" do
|
15
|
+
expect(watir_browser).to receive(:button).with(:id => 'blah').and_return(watir_browser)
|
16
|
+
element = watir_page_object.button_element(:id => 'blah')
|
17
|
+
expect(element).to be_instance_of PageObject::Elements::Button
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should find a button element using a default identifier" do
|
21
|
+
expect(watir_browser).to receive(:button).with(:index => 0).and_return(watir_browser)
|
22
|
+
watir_page_object.button_element
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should find all button elements" do
|
26
|
+
expect(watir_browser).to receive(:buttons).with(:id => 'blah').and_return([watir_browser])
|
27
|
+
elements = watir_page_object.button_elements(:id => 'blah')
|
28
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Button
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should find all buttons with no identifier" do
|
32
|
+
expect(watir_browser).to receive(:buttons).with({}).and_return([watir_browser])
|
33
|
+
watir_page_object.button_elements
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should find a text field element" do
|
37
|
+
expect(watir_browser).to receive(:text_field).with(:id => 'blah').and_return(watir_browser)
|
38
|
+
element = watir_page_object.text_field_element(:id => 'blah')
|
39
|
+
expect(element).to be_instance_of PageObject::Elements::TextField
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should find a text field element using a default identifier" do
|
43
|
+
expect(watir_browser).to receive(:text_field).with(:index => 0).and_return(watir_browser)
|
44
|
+
watir_page_object.text_field_element
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should find all text field elements" do
|
48
|
+
expect(watir_browser).to receive(:text_fields).with(:id => 'blah').and_return([watir_browser])
|
49
|
+
expect(watir_browser).to receive(:tag_name).and_return('input')
|
50
|
+
elements = watir_page_object.text_field_elements(:id => 'blah')
|
51
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::TextField
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should find all text fields with no identifier" do
|
55
|
+
expect(watir_browser).to receive(:text_fields).with({}).and_return([watir_browser])
|
56
|
+
expect(watir_browser).to receive(:tag_name).and_return('input')
|
57
|
+
watir_page_object.text_field_elements
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should find a hidden field element" do
|
61
|
+
expect(watir_browser).to receive(:hidden).with(:id => 'blah').and_return(watir_browser)
|
62
|
+
element = watir_page_object.hidden_field_element(:id => 'blah')
|
63
|
+
expect(element).to be_instance_of PageObject::Elements::HiddenField
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should find a hidden field using a default identifier" do
|
67
|
+
expect(watir_browser).to receive(:hidden).with(:index => 0).and_return(watir_browser)
|
68
|
+
watir_page_object.hidden_field_element
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should find all hidden field elements" do
|
72
|
+
expect(watir_browser).to receive(:hiddens).with(:id => 'blah').and_return([watir_browser])
|
73
|
+
elements = watir_page_object.hidden_field_elements(:id => 'blah')
|
74
|
+
expect(elements[0]).to be_instance_of(PageObject::Elements::HiddenField)
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should find all hidden field elements using no identifier" do
|
78
|
+
expect(watir_browser).to receive(:hiddens).with({}).and_return([watir_browser])
|
79
|
+
watir_page_object.hidden_field_elements
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should find a text area element" do
|
83
|
+
expect(watir_browser).to receive(:textarea).with(:id => 'blah').and_return(watir_browser)
|
84
|
+
element = watir_page_object.text_area_element(:id => 'blah')
|
85
|
+
expect(element).to be_instance_of PageObject::Elements::TextArea
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should find a text area using a default identifier" do
|
89
|
+
expect(watir_browser).to receive(:textarea).with(:index => 0).and_return(watir_browser)
|
90
|
+
watir_page_object.text_area_element
|
91
|
+
end
|
92
|
+
|
93
|
+
it "should find all text area elements" do
|
94
|
+
expect(watir_browser).to receive(:textareas).with(:id => 'blah').and_return([watir_browser])
|
95
|
+
elements = watir_page_object.text_area_elements(:id => 'blah')
|
96
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::TextArea
|
97
|
+
end
|
98
|
+
|
99
|
+
it "should find all text area elements using no identifier" do
|
100
|
+
expect(watir_browser).to receive(:textareas).with({}).and_return([watir_browser])
|
101
|
+
watir_page_object.text_area_elements
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should find a select list element" do
|
105
|
+
expect(watir_browser).to receive(:select_list).with(:id => 'blah').and_return(watir_browser)
|
106
|
+
element = watir_page_object.select_list_element(:id => 'blah')
|
107
|
+
expect(element).to be_instance_of PageObject::Elements::SelectList
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should find a select list using a default identifier" do
|
111
|
+
expect(watir_browser).to receive(:select_list).with(:index => 0).and_return(watir_browser)
|
112
|
+
watir_page_object.select_list_element
|
113
|
+
end
|
114
|
+
|
115
|
+
it "should find all select list elements" do
|
116
|
+
expect(watir_browser).to receive(:select_lists).with(:id => 'blah').and_return([watir_browser])
|
117
|
+
elements = watir_page_object.select_list_elements(:id => 'blah')
|
118
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::SelectList
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should find all select list elements using no identifier" do
|
122
|
+
expect(watir_browser).to receive(:select_lists).with({}).and_return([watir_browser])
|
123
|
+
watir_page_object.select_list_elements
|
124
|
+
end
|
125
|
+
|
126
|
+
it "should find a link element" do
|
127
|
+
expect(watir_browser).to receive(:link).with(:id => 'blah').and_return(watir_browser)
|
128
|
+
element = watir_page_object.link_element(:id => 'blah')
|
129
|
+
expect(element).to be_instance_of PageObject::Elements::Link
|
130
|
+
end
|
131
|
+
|
132
|
+
it "should find a link element using a default identifier" do
|
133
|
+
expect(watir_browser).to receive(:link).with(:index => 0).and_return(watir_browser)
|
134
|
+
watir_page_object.link_element
|
135
|
+
end
|
136
|
+
|
137
|
+
it "should find all link elements" do
|
138
|
+
expect(watir_browser).to receive(:links).with(:id => 'blah').and_return([watir_browser])
|
139
|
+
elements = watir_page_object.link_elements(:id => 'blah')
|
140
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Link
|
141
|
+
end
|
142
|
+
|
143
|
+
it "should find all links using no identifier" do
|
144
|
+
expect(watir_browser).to receive(:links).with({}).and_return([watir_browser])
|
145
|
+
watir_page_object.link_elements
|
146
|
+
end
|
147
|
+
|
148
|
+
it "should find a check box" do
|
149
|
+
expect(watir_browser).to receive(:checkbox).with(:id => 'blah').and_return(watir_browser)
|
150
|
+
element = watir_page_object.checkbox_element(:id => 'blah')
|
151
|
+
expect(element).to be_instance_of PageObject::Elements::CheckBox
|
152
|
+
end
|
153
|
+
|
154
|
+
it "should find a check box using a default identifier" do
|
155
|
+
expect(watir_browser).to receive(:checkbox).with(:index => 0).and_return(watir_browser)
|
156
|
+
watir_page_object.checkbox_element
|
157
|
+
end
|
158
|
+
|
159
|
+
it "should find all check box elements" do
|
160
|
+
expect(watir_browser).to receive(:checkboxes).with(:id => 'blah').and_return([watir_browser])
|
161
|
+
elements = watir_page_object.checkbox_elements(:id => 'blah')
|
162
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::CheckBox
|
163
|
+
end
|
164
|
+
|
165
|
+
it "should find all check box elements using no identifier" do
|
166
|
+
expect(watir_browser).to receive(:checkboxes).with({}).and_return([watir_browser])
|
167
|
+
watir_page_object.checkbox_elements
|
168
|
+
end
|
169
|
+
|
170
|
+
it "should find a radio button" do
|
171
|
+
expect(watir_browser).to receive(:radio).with(:id => 'blah').and_return(watir_browser)
|
172
|
+
element = watir_page_object.radio_button_element(:id => 'blah')
|
173
|
+
expect(element).to be_instance_of PageObject::Elements::RadioButton
|
174
|
+
end
|
175
|
+
|
176
|
+
it "should find a radio button using a default identifier" do
|
177
|
+
expect(watir_browser).to receive(:radio).with(:index => 0).and_return(watir_browser)
|
178
|
+
watir_page_object.radio_button_element
|
179
|
+
end
|
180
|
+
|
181
|
+
it "should find all radio buttons" do
|
182
|
+
expect(watir_browser).to receive(:radios).with(:id => 'blah').and_return([watir_browser])
|
183
|
+
elements = watir_page_object.radio_button_elements(:id => 'blah')
|
184
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::RadioButton
|
185
|
+
end
|
186
|
+
|
187
|
+
it "should find all radio buttons using no identifier" do
|
188
|
+
expect(watir_browser).to receive(:radios).with({}).and_return([watir_browser])
|
189
|
+
watir_page_object.radio_button_elements
|
190
|
+
end
|
191
|
+
|
192
|
+
it "should find a div" do
|
193
|
+
expect(watir_browser).to receive(:div).with(:id => 'blah').and_return(watir_browser)
|
194
|
+
element = watir_page_object.div_element(:id => 'blah')
|
195
|
+
expect(element).to be_instance_of PageObject::Elements::Div
|
196
|
+
end
|
197
|
+
|
198
|
+
it "should find a div using a default identifier" do
|
199
|
+
expect(watir_browser).to receive(:div).with(:index => 0).and_return(watir_browser)
|
200
|
+
watir_page_object.div_element
|
201
|
+
end
|
202
|
+
|
203
|
+
it "should find all div elements" do
|
204
|
+
expect(watir_browser).to receive(:divs).with(:id => 'blah').and_return([watir_browser])
|
205
|
+
elements = watir_page_object.div_elements(:id => 'blah')
|
206
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Div
|
207
|
+
end
|
208
|
+
|
209
|
+
it "should find all div elements using no identifier" do
|
210
|
+
expect(watir_browser).to receive(:divs).with({}).and_return([watir_browser])
|
211
|
+
watir_page_object.div_elements
|
212
|
+
end
|
213
|
+
|
214
|
+
it "should find a span" do
|
215
|
+
expect(watir_browser).to receive(:span).with(:id => 'blah').and_return(watir_browser)
|
216
|
+
element = watir_page_object.span_element(:id => 'blah')
|
217
|
+
expect(element).to be_instance_of PageObject::Elements::Span
|
218
|
+
end
|
219
|
+
|
220
|
+
it "should find a span using a default identifier" do
|
221
|
+
expect(watir_browser).to receive(:span).with(:index => 0).and_return(watir_browser)
|
222
|
+
watir_page_object.span_element
|
223
|
+
end
|
224
|
+
|
225
|
+
it "should find all span elements" do
|
226
|
+
expect(watir_browser).to receive(:spans).with(:id => 'blah').and_return([watir_browser])
|
227
|
+
elements = watir_page_object.span_elements(:id => 'blah')
|
228
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Span
|
229
|
+
end
|
230
|
+
|
231
|
+
it "should find all span elements using no identifier" do
|
232
|
+
expect(watir_browser).to receive(:spans).with({}).and_return([watir_browser])
|
233
|
+
watir_page_object.span_elements
|
234
|
+
end
|
235
|
+
|
236
|
+
it "should find a table" do
|
237
|
+
expect(watir_browser).to receive(:table).with(:id => 'blah').and_return(watir_browser)
|
238
|
+
element = watir_page_object.table_element(:id => 'blah')
|
239
|
+
expect(element).to be_instance_of PageObject::Elements::Table
|
240
|
+
end
|
241
|
+
|
242
|
+
it "should find a table using a default identifier" do
|
243
|
+
expect(watir_browser).to receive(:table).with(:index => 0).and_return(watir_browser)
|
244
|
+
watir_page_object.table_element
|
245
|
+
end
|
246
|
+
|
247
|
+
it "should find all table elements" do
|
248
|
+
expect(watir_browser).to receive(:tables).with(:id => 'blah').and_return([watir_browser])
|
249
|
+
elements = watir_page_object.table_elements(:id => 'blah')
|
250
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Table
|
251
|
+
end
|
252
|
+
|
253
|
+
it "should find all table elements using no identifier" do
|
254
|
+
expect(watir_browser).to receive(:tables).with({}).and_return([watir_browser])
|
255
|
+
watir_page_object.table_elements
|
256
|
+
end
|
257
|
+
|
258
|
+
it "should find a table cell" do
|
259
|
+
expect(watir_browser).to receive(:td).with(:id => 'blah').and_return(watir_browser)
|
260
|
+
element = watir_page_object.cell_element(:id => 'blah')
|
261
|
+
expect(element).to be_instance_of PageObject::Elements::TableCell
|
262
|
+
end
|
263
|
+
|
264
|
+
it "should find a table cell using a default identifier" do
|
265
|
+
expect(watir_browser).to receive(:td).with(:index => 0).and_return(watir_browser)
|
266
|
+
watir_page_object.cell_element
|
267
|
+
end
|
268
|
+
|
269
|
+
it "should find all table cells" do
|
270
|
+
expect(watir_browser).to receive(:tds).with(:id => 'blah').and_return([watir_browser])
|
271
|
+
elements = watir_page_object.cell_elements(:id => 'blah')
|
272
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::TableCell
|
273
|
+
end
|
274
|
+
|
275
|
+
it "should find all table cells using no identifier" do
|
276
|
+
expect(watir_browser).to receive(:tds).with({}).and_return([watir_browser])
|
277
|
+
watir_page_object.cell_elements
|
278
|
+
end
|
279
|
+
|
280
|
+
it "should find an image" do
|
281
|
+
expect(watir_browser).to receive(:image).with(:id => 'blah').and_return(watir_browser)
|
282
|
+
element = watir_page_object.image_element(:id => 'blah')
|
283
|
+
expect(element).to be_instance_of PageObject::Elements::Image
|
284
|
+
end
|
285
|
+
|
286
|
+
it "should find an image using a default identifier" do
|
287
|
+
expect(watir_browser).to receive(:image).with(:index => 0).and_return(watir_browser)
|
288
|
+
watir_page_object.image_element
|
289
|
+
end
|
290
|
+
|
291
|
+
it "should find all images" do
|
292
|
+
expect(watir_browser).to receive(:images).with(:id => 'blah').and_return([watir_browser])
|
293
|
+
elements = watir_page_object.image_elements(:id => 'blah')
|
294
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Image
|
295
|
+
end
|
296
|
+
|
297
|
+
it "should find all images using no identifier" do
|
298
|
+
expect(watir_browser).to receive(:images).with({}).and_return([watir_browser])
|
299
|
+
watir_page_object.image_elements
|
300
|
+
end
|
301
|
+
|
302
|
+
it "should find a form" do
|
303
|
+
expect(watir_browser).to receive(:form).with(:id => 'blah').and_return(watir_browser)
|
304
|
+
element = watir_page_object.form_element(:id => 'blah')
|
305
|
+
expect(element).to be_instance_of PageObject::Elements::Form
|
306
|
+
end
|
307
|
+
|
308
|
+
it "should find a form using a default identifier" do
|
309
|
+
expect(watir_browser).to receive(:form).with(:index => 0).and_return(watir_browser)
|
310
|
+
watir_page_object.form_element
|
311
|
+
end
|
312
|
+
|
313
|
+
it "should find all forms" do
|
314
|
+
expect(watir_browser).to receive(:forms).with(:id => 'blah').and_return([watir_browser])
|
315
|
+
elements = watir_page_object.form_elements(:id => 'blah')
|
316
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Form
|
317
|
+
end
|
318
|
+
|
319
|
+
it "should find all forms using no identifier" do
|
320
|
+
expect(watir_browser).to receive(:forms).with({}).and_return([watir_browser])
|
321
|
+
watir_page_object.form_elements
|
322
|
+
end
|
323
|
+
|
324
|
+
it "should find a list item" do
|
325
|
+
expect(watir_browser).to receive(:li).with(:id => 'blah').and_return(watir_browser)
|
326
|
+
element = watir_page_object.list_item_element(:id => 'blah')
|
327
|
+
expect(element).to be_instance_of PageObject::Elements::ListItem
|
328
|
+
end
|
329
|
+
|
330
|
+
it "should find a list item using a default identifier" do
|
331
|
+
expect(watir_browser).to receive(:li).with(:index => 0).and_return(watir_browser)
|
332
|
+
watir_page_object.list_item_element
|
333
|
+
end
|
334
|
+
|
335
|
+
it "should find all list items" do
|
336
|
+
expect(watir_browser).to receive(:lis).with(:id => 'blah').and_return([watir_browser])
|
337
|
+
elements = watir_page_object.list_item_elements(:id => 'blah')
|
338
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::ListItem
|
339
|
+
end
|
340
|
+
|
341
|
+
it "should find all list items using no parameter" do
|
342
|
+
expect(watir_browser).to receive(:lis).with({}).and_return([watir_browser])
|
343
|
+
watir_page_object.list_item_elements
|
344
|
+
end
|
345
|
+
|
346
|
+
it "should find an unordered list" do
|
347
|
+
expect(watir_browser).to receive(:ul).with(:id => 'blah').and_return(watir_browser)
|
348
|
+
element = watir_page_object.unordered_list_element(:id => 'blah')
|
349
|
+
expect(element).to be_instance_of PageObject::Elements::UnorderedList
|
350
|
+
end
|
351
|
+
|
352
|
+
it "should find an unordered list using a default identifier" do
|
353
|
+
expect(watir_browser).to receive(:ul).with(:index => 0).and_return(watir_browser)
|
354
|
+
watir_page_object.unordered_list_element
|
355
|
+
end
|
356
|
+
|
357
|
+
it "should find all unordered lists" do
|
358
|
+
expect(watir_browser).to receive(:uls).with(:id => 'blah').and_return([watir_browser])
|
359
|
+
elements = watir_page_object.unordered_list_elements(:id => 'blah')
|
360
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::UnorderedList
|
361
|
+
end
|
362
|
+
|
363
|
+
it "should find all unordered lists using no parameters" do
|
364
|
+
expect(watir_browser).to receive(:uls).with({}).and_return([watir_browser])
|
365
|
+
watir_page_object.unordered_list_elements
|
366
|
+
end
|
367
|
+
|
368
|
+
it "should find an ordered list" do
|
369
|
+
expect(watir_browser).to receive(:ol).with(:id => 'blah').and_return(watir_browser)
|
370
|
+
element = watir_page_object.ordered_list_element(:id => 'blah')
|
371
|
+
expect(element).to be_instance_of PageObject::Elements::OrderedList
|
372
|
+
end
|
373
|
+
|
374
|
+
it "should find an orderd list using a default identifier" do
|
375
|
+
expect(watir_browser).to receive(:ol).with(:index => 0).and_return(watir_browser)
|
376
|
+
watir_page_object.ordered_list_element
|
377
|
+
end
|
378
|
+
|
379
|
+
it "should find all ordered lists" do
|
380
|
+
expect(watir_browser).to receive(:ols).with(:id => 'blah').and_return([watir_browser])
|
381
|
+
elements = watir_page_object.ordered_list_elements(:id => 'blah')
|
382
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::OrderedList
|
383
|
+
end
|
384
|
+
|
385
|
+
it "should find all orderd lists using no parameters" do
|
386
|
+
expect(watir_browser).to receive(:ols).with({}).and_return([watir_browser])
|
387
|
+
watir_page_object.ordered_list_elements
|
388
|
+
end
|
389
|
+
|
390
|
+
it "should find a h1 element" do
|
391
|
+
expect(watir_browser).to receive(:h1).with(:id => 'blah').and_return(watir_browser)
|
392
|
+
element = watir_page_object.h1_element(:id => 'blah')
|
393
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
394
|
+
end
|
395
|
+
|
396
|
+
it "should find a h1 element using a default identifier" do
|
397
|
+
expect(watir_browser).to receive(:h1).with(:index => 0).and_return(watir_browser)
|
398
|
+
watir_page_object.h1_element
|
399
|
+
end
|
400
|
+
|
401
|
+
it "should find all h1 elements" do
|
402
|
+
expect(watir_browser).to receive(:h1s).with(:id => 'blah').and_return([watir_browser])
|
403
|
+
elements = watir_page_object.h1_elements(:id => 'blah')
|
404
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
405
|
+
end
|
406
|
+
|
407
|
+
it "should find all h1 elements using no parameters" do
|
408
|
+
expect(watir_browser).to receive(:h1s).with({}).and_return([watir_browser])
|
409
|
+
watir_page_object.h1_elements
|
410
|
+
end
|
411
|
+
|
412
|
+
it "should find a h2 element" do
|
413
|
+
expect(watir_browser).to receive(:h2).with(:id => 'blah').and_return(watir_browser)
|
414
|
+
element = watir_page_object.h2_element(:id => 'blah')
|
415
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
416
|
+
end
|
417
|
+
|
418
|
+
it "should find a h2 element using default identifier" do
|
419
|
+
expect(watir_browser).to receive(:h2).with(:index => 0).and_return(watir_browser)
|
420
|
+
watir_page_object.h2_element
|
421
|
+
end
|
422
|
+
|
423
|
+
it "should find all h2 elements" do
|
424
|
+
expect(watir_browser).to receive(:h2s).with(:id => 'blah').and_return([watir_browser])
|
425
|
+
elements = watir_page_object.h2_elements(:id => 'blah')
|
426
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
427
|
+
end
|
428
|
+
|
429
|
+
it "should find all h2 elements using no identifier" do
|
430
|
+
expect(watir_browser).to receive(:h2s).with({}).and_return([watir_browser])
|
431
|
+
watir_page_object.h2_elements
|
432
|
+
end
|
433
|
+
|
434
|
+
it "should find a h3 element" do
|
435
|
+
expect(watir_browser).to receive(:h3).with(:id => 'blah').and_return(watir_browser)
|
436
|
+
element = watir_page_object.h3_element(:id => 'blah')
|
437
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
438
|
+
end
|
439
|
+
|
440
|
+
it "should find a h3 element using a default identifier" do
|
441
|
+
expect(watir_browser).to receive(:h3).with(:index => 0).and_return(watir_browser)
|
442
|
+
watir_page_object.h3_element
|
443
|
+
end
|
444
|
+
|
445
|
+
it "should find all h3 elements" do
|
446
|
+
expect(watir_browser).to receive(:h3s).with(:id => 'blah').and_return([watir_browser])
|
447
|
+
elements = watir_page_object.h3_elements(:id => 'blah')
|
448
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
449
|
+
end
|
450
|
+
|
451
|
+
it "should find all h3 elements using no identifiers" do
|
452
|
+
expect(watir_browser).to receive(:h3s).with({}).and_return([watir_browser])
|
453
|
+
watir_page_object.h3_elements
|
454
|
+
end
|
455
|
+
|
456
|
+
it "should find a h4 element" do
|
457
|
+
expect(watir_browser).to receive(:h4).with(:id => 'blah').and_return(watir_browser)
|
458
|
+
element = watir_page_object.h4_element(:id => 'blah')
|
459
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
460
|
+
end
|
461
|
+
|
462
|
+
it "should find a h4 element using a default identifier" do
|
463
|
+
expect(watir_browser).to receive(:h4).with(:index => 0).and_return(watir_browser)
|
464
|
+
watir_page_object.h4_element
|
465
|
+
end
|
466
|
+
|
467
|
+
it "should find all h4 elements" do
|
468
|
+
expect(watir_browser).to receive(:h4s).with(:id => 'blah').and_return([watir_browser])
|
469
|
+
elements = watir_page_object.h4_elements(:id => 'blah')
|
470
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
471
|
+
end
|
472
|
+
|
473
|
+
it "should find all h4 elements using no identifier" do
|
474
|
+
expect(watir_browser).to receive(:h4s).with({}).and_return([watir_browser])
|
475
|
+
watir_page_object.h4_elements
|
476
|
+
end
|
477
|
+
|
478
|
+
it "should find a h5 element" do
|
479
|
+
expect(watir_browser).to receive(:h5).with(:id => 'blah').and_return(watir_browser)
|
480
|
+
element = watir_page_object.h5_element(:id => 'blah')
|
481
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
482
|
+
end
|
483
|
+
|
484
|
+
it "should find a h5 element using a default identifier" do
|
485
|
+
expect(watir_browser).to receive(:h5).with(:index => 0).and_return(watir_browser)
|
486
|
+
watir_page_object.h5_element
|
487
|
+
end
|
488
|
+
|
489
|
+
it "should find all h5 elements" do
|
490
|
+
expect(watir_browser).to receive(:h5s).with(:id => 'blah').and_return([watir_browser])
|
491
|
+
elements = watir_page_object.h5_elements(:id => 'blah')
|
492
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
493
|
+
end
|
494
|
+
|
495
|
+
it "should find all h5 elements using no identifier" do
|
496
|
+
expect(watir_browser).to receive(:h5s).with({}).and_return([watir_browser])
|
497
|
+
watir_page_object.h5_elements
|
498
|
+
end
|
499
|
+
|
500
|
+
it "should find a h6 element" do
|
501
|
+
expect(watir_browser).to receive(:h6).with(:id => 'blah').and_return(watir_browser)
|
502
|
+
element = watir_page_object.h6_element(:id => 'blah')
|
503
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
504
|
+
end
|
505
|
+
|
506
|
+
it "should find a h6 element using a default identifier" do
|
507
|
+
expect(watir_browser).to receive(:h6).with(:index => 0).and_return(watir_browser)
|
508
|
+
watir_page_object.h6_element
|
509
|
+
end
|
510
|
+
|
511
|
+
it "should find all h6 elements" do
|
512
|
+
expect(watir_browser).to receive(:h6s).with(:id => 'blah').and_return([watir_browser])
|
513
|
+
elements = watir_page_object.h6_elements(:id => 'blah')
|
514
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
515
|
+
end
|
516
|
+
|
517
|
+
it "should find all h6 elements using no identifier" do
|
518
|
+
expect(watir_browser).to receive(:h6s).with({}).and_return([watir_browser])
|
519
|
+
watir_page_object.h6_elements
|
520
|
+
end
|
521
|
+
|
522
|
+
it "should find a paragraph element" do
|
523
|
+
expect(watir_browser).to receive(:p).with(:id => 'blah').and_return(watir_browser)
|
524
|
+
element = watir_page_object.paragraph_element(:id => 'blah')
|
525
|
+
expect(element).to be_instance_of PageObject::Elements::Paragraph
|
526
|
+
end
|
527
|
+
|
528
|
+
it "should find a paragraph element using a default identifier" do
|
529
|
+
expect(watir_browser).to receive(:p).with(:index => 0).and_return(watir_browser)
|
530
|
+
watir_page_object.paragraph_element
|
531
|
+
end
|
532
|
+
|
533
|
+
it "should find all paragraph elements" do
|
534
|
+
expect(watir_browser).to receive(:ps).with(:id => 'blah').and_return([watir_browser])
|
535
|
+
elements = watir_page_object.paragraph_elements(:id => 'blah')
|
536
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Paragraph
|
537
|
+
end
|
538
|
+
|
539
|
+
it "should find all paragraph elements using no identifier" do
|
540
|
+
expect(watir_browser).to receive(:ps).with({}).and_return([watir_browser])
|
541
|
+
watir_page_object.paragraph_elements
|
542
|
+
end
|
543
|
+
|
544
|
+
it "should find a label" do
|
545
|
+
expect(watir_browser).to receive(:label).with(:id => 'blah').and_return(watir_browser)
|
546
|
+
element = watir_page_object.label_element(:id => 'blah')
|
547
|
+
expect(element).to be_instance_of PageObject::Elements::Label
|
548
|
+
end
|
549
|
+
|
550
|
+
it "should find a label element using default parameters" do
|
551
|
+
expect(watir_browser).to receive(:label).with(:index => 0).and_return(watir_browser)
|
552
|
+
watir_page_object.label_element
|
553
|
+
end
|
554
|
+
|
555
|
+
it "should find all label elements" do
|
556
|
+
expect(watir_browser).to receive(:labels).with(:id => 'blah').and_return([watir_browser])
|
557
|
+
elements = watir_page_object.label_elements(:id => 'blah')
|
558
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Label
|
559
|
+
end
|
560
|
+
|
561
|
+
it "should find all label elements using no parameters" do
|
562
|
+
expect(watir_browser).to receive(:labels).with({}).and_return([watir_browser])
|
563
|
+
watir_page_object.label_elements
|
564
|
+
end
|
565
|
+
|
566
|
+
it "should find a file field element" do
|
567
|
+
expect(watir_browser).to receive(:file_field).with(:id => 'blah').and_return(watir_browser)
|
568
|
+
element = watir_page_object.file_field_element(:id => 'blah')
|
569
|
+
expect(element).to be_instance_of PageObject::Elements::FileField
|
570
|
+
end
|
571
|
+
|
572
|
+
it "should find a file field element using a default identifier" do
|
573
|
+
expect(watir_browser).to receive(:file_field).with(:index => 0).and_return(watir_browser)
|
574
|
+
watir_page_object.file_field_element
|
575
|
+
end
|
576
|
+
|
577
|
+
it "should find all file field elements" do
|
578
|
+
expect(watir_browser).to receive(:file_fields).with(:id => 'blah').and_return([watir_browser])
|
579
|
+
element = watir_page_object.file_field_elements(:id => 'blah')
|
580
|
+
expect(element[0]).to be_instance_of PageObject::Elements::FileField
|
581
|
+
end
|
582
|
+
|
583
|
+
it "should find all file fields using no identifier" do
|
584
|
+
expect(watir_browser).to receive(:file_fields).with({}).and_return([watir_browser])
|
585
|
+
watir_page_object.file_field_elements
|
586
|
+
end
|
587
|
+
|
588
|
+
it "should find an area element" do
|
589
|
+
expect(watir_browser).to receive(:area).with(:id => 'blah').and_return(watir_browser)
|
590
|
+
element = watir_page_object.area_element(:id => 'blah')
|
591
|
+
expect(element).to be_instance_of PageObject::Elements::Area
|
592
|
+
end
|
593
|
+
|
594
|
+
it "should find an area element using a default identifier" do
|
595
|
+
expect(watir_browser).to receive(:area).with(:index => 0).and_return(watir_browser)
|
596
|
+
watir_page_object.area_element
|
597
|
+
end
|
598
|
+
|
599
|
+
it "should find all area elements" do
|
600
|
+
expect(watir_browser).to receive(:areas).with(:id => 'blah').and_return([watir_browser])
|
601
|
+
elements = watir_page_object.area_elements(:id => 'blah')
|
602
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Area
|
603
|
+
end
|
604
|
+
|
605
|
+
it "should find all areas with no identifier" do
|
606
|
+
expect(watir_browser).to receive(:areas).with({}).and_return([watir_browser])
|
607
|
+
watir_page_object.area_elements
|
608
|
+
end
|
609
|
+
|
610
|
+
it "should find a canvas element" do
|
611
|
+
expect(watir_browser).to receive(:canvas).with(:id => 'blah').and_return(watir_browser)
|
612
|
+
element = watir_page_object.canvas_element(:id => 'blah')
|
613
|
+
expect(element).to be_instance_of PageObject::Elements::Canvas
|
614
|
+
end
|
615
|
+
|
616
|
+
it "should find a canvas element using a default identifier" do
|
617
|
+
expect(watir_browser).to receive(:canvas).with(:index => 0).and_return(watir_browser)
|
618
|
+
watir_page_object.canvas_element
|
619
|
+
end
|
620
|
+
|
621
|
+
it "should find all canvas elements" do
|
622
|
+
expect(watir_browser).to receive(:canvases).with(:id => 'blah').and_return([watir_browser])
|
623
|
+
elements = watir_page_object.canvas_elements(:id => 'blah')
|
624
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Canvas
|
625
|
+
end
|
626
|
+
|
627
|
+
it "should find all canvases with no identifier" do
|
628
|
+
expect(watir_browser).to receive(:canvases).with({}).and_return([watir_browser])
|
629
|
+
watir_page_object.canvas_elements
|
630
|
+
end
|
631
|
+
|
632
|
+
it "should find an audio element" do
|
633
|
+
expect(watir_browser).to receive(:audio).with(:id => 'blah').and_return(watir_browser)
|
634
|
+
element = watir_page_object.audio_element(:id => 'blah')
|
635
|
+
expect(element).to be_instance_of PageObject::Elements::Audio
|
636
|
+
end
|
637
|
+
|
638
|
+
it "should find an audio element using a default identifier" do
|
639
|
+
expect(watir_browser).to receive(:audio).with(:index => 0).and_return(watir_browser)
|
640
|
+
watir_page_object.audio_element
|
641
|
+
end
|
642
|
+
|
643
|
+
it "should find all audio elements" do
|
644
|
+
expect(watir_browser).to receive(:audios).with(:id => 'blah').and_return([watir_browser])
|
645
|
+
elements = watir_page_object.audio_elements(:id => 'blah')
|
646
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Audio
|
647
|
+
end
|
648
|
+
|
649
|
+
it "should find all audio elements with no identifier" do
|
650
|
+
expect(watir_browser).to receive(:audios).with({}).and_return([watir_browser])
|
651
|
+
watir_page_object.audio_elements
|
652
|
+
end
|
653
|
+
|
654
|
+
it "should find a video element" do
|
655
|
+
expect(watir_browser).to receive(:video).with(:id => 'blah').and_return(watir_browser)
|
656
|
+
element = watir_page_object.video_element(:id => 'blah')
|
657
|
+
expect(element).to be_instance_of PageObject::Elements::Video
|
658
|
+
end
|
659
|
+
|
660
|
+
it "should find a video element using a default identifier" do
|
661
|
+
expect(watir_browser).to receive(:video).with(:index => 0).and_return(watir_browser)
|
662
|
+
watir_page_object.video_element
|
663
|
+
end
|
664
|
+
|
665
|
+
it "should find all video elements" do
|
666
|
+
expect(watir_browser).to receive(:videos).with(:id => 'blah').and_return([watir_browser])
|
667
|
+
elements = watir_page_object.video_elements(:id => 'blah')
|
668
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Video
|
669
|
+
end
|
670
|
+
|
671
|
+
it "should find all video elements with no identifier" do
|
672
|
+
expect(watir_browser).to receive(:videos).with({}).and_return([watir_browser])
|
673
|
+
watir_page_object.video_elements
|
674
|
+
end
|
675
|
+
|
676
|
+
it "should find an element" do
|
677
|
+
expect(watir_browser).to receive(:audio).with(:id => 'blah').and_return(watir_browser)
|
678
|
+
element = watir_page_object.element(:audio, :id => 'blah')
|
679
|
+
expect(element).to be_instance_of PageObject::Elements::Element
|
680
|
+
end
|
681
|
+
|
682
|
+
it "should find an element using a default identifier" do
|
683
|
+
expect(watir_browser).to receive(:audio).with(:index => 0).and_return(watir_browser)
|
684
|
+
watir_page_object.element(:audio)
|
685
|
+
end
|
686
|
+
|
687
|
+
it "should find a b element" do
|
688
|
+
expect(watir_browser).to receive(:b).with(:id => 'blah').and_return(watir_browser)
|
689
|
+
element = watir_page_object.b_element(:id => 'blah')
|
690
|
+
expect(element).to be_instance_of PageObject::Elements::Bold
|
691
|
+
end
|
692
|
+
|
693
|
+
it "should find a b element using a default identifier" do
|
694
|
+
expect(watir_browser).to receive(:b).with(:index => 0).and_return(watir_browser)
|
695
|
+
watir_page_object.b_element
|
696
|
+
end
|
697
|
+
|
698
|
+
it "should find all b elements" do
|
699
|
+
expect(watir_browser).to receive(:bs).with(:id => 'blah').and_return([watir_browser])
|
700
|
+
elements = watir_page_object.b_elements(:id => 'blah')
|
701
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Bold
|
702
|
+
end
|
703
|
+
|
704
|
+
it "should find all b elements using no parameters" do
|
705
|
+
expect(watir_browser).to receive(:bs).with({}).and_return([watir_browser])
|
706
|
+
watir_page_object.b_elements
|
707
|
+
end
|
708
|
+
end
|
709
|
+
|
710
|
+
context "when using Selenium" do
|
711
|
+
let(:selenium_browser) { mock_selenium_browser }
|
712
|
+
let(:selenium_page_object) { ElementLocatorsTestPageObject.new(selenium_browser) }
|
713
|
+
|
714
|
+
it "should find a button element" do
|
715
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
716
|
+
element = selenium_page_object.button_element(:id => 'blah')
|
717
|
+
expect(element).to be_instance_of PageObject::Elements::Button
|
718
|
+
end
|
719
|
+
|
720
|
+
it "should find all button elements" do
|
721
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
722
|
+
elements = selenium_page_object.button_elements(:id => 'blah')
|
723
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Button
|
724
|
+
end
|
725
|
+
|
726
|
+
it "should find a text field element" do
|
727
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
728
|
+
element = selenium_page_object.text_field_element(:id => 'blah')
|
729
|
+
expect(element).to be_instance_of PageObject::Elements::TextField
|
730
|
+
end
|
731
|
+
|
732
|
+
it "should find all text field elements" do
|
733
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
734
|
+
elements = selenium_page_object.text_field_elements(:id => 'blah')
|
735
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::TextField
|
736
|
+
end
|
737
|
+
|
738
|
+
it "should find a hidden field element" do
|
739
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
740
|
+
element = selenium_page_object.hidden_field_element(:id => 'blah')
|
741
|
+
expect(element).to be_instance_of PageObject::Elements::HiddenField
|
742
|
+
end
|
743
|
+
|
744
|
+
it "should find all hidden field elements" do
|
745
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, "blah").and_return([selenium_browser])
|
746
|
+
elements = selenium_page_object.hidden_field_elements(:id => 'blah')
|
747
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::HiddenField
|
748
|
+
|
749
|
+
end
|
750
|
+
|
751
|
+
it "should find a text area element" do
|
752
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
753
|
+
element = selenium_page_object.text_area_element(:id => 'blah')
|
754
|
+
expect(element).to be_instance_of PageObject::Elements::TextArea
|
755
|
+
end
|
756
|
+
|
757
|
+
it "should find all text area elements" do
|
758
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
759
|
+
elements = selenium_page_object.text_area_elements(:id => 'blah')
|
760
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::TextArea
|
761
|
+
end
|
762
|
+
|
763
|
+
it "should find a select list element" do
|
764
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
765
|
+
element = selenium_page_object.select_list_element(:id => 'blah')
|
766
|
+
expect(element).to be_instance_of PageObject::Elements::SelectList
|
767
|
+
end
|
768
|
+
|
769
|
+
it "should find all select list elements" do
|
770
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
771
|
+
elements = selenium_page_object.select_list_elements(:id => 'blah')
|
772
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::SelectList
|
773
|
+
end
|
774
|
+
|
775
|
+
it "should find a link element" do
|
776
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
777
|
+
element = selenium_page_object.link_element(:id => 'blah')
|
778
|
+
expect(element).to be_instance_of PageObject::Elements::Link
|
779
|
+
end
|
780
|
+
|
781
|
+
it "should find all link elements" do
|
782
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
783
|
+
elements = selenium_page_object.link_elements(:id => 'blah')
|
784
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Link
|
785
|
+
end
|
786
|
+
|
787
|
+
it "should find a check box" do
|
788
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
789
|
+
element = selenium_page_object.checkbox_element(:id => 'blah')
|
790
|
+
expect(element).to be_instance_of PageObject::Elements::CheckBox
|
791
|
+
end
|
792
|
+
|
793
|
+
it "should find all checkbox elements" do
|
794
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
795
|
+
elements = selenium_page_object.checkbox_elements(:id => 'blah')
|
796
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::CheckBox
|
797
|
+
end
|
798
|
+
|
799
|
+
it "should find a radio button" do
|
800
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
801
|
+
element = selenium_page_object.radio_button_element(:id => 'blah')
|
802
|
+
expect(element).to be_instance_of PageObject::Elements::RadioButton
|
803
|
+
end
|
804
|
+
|
805
|
+
it "should find all radio button elements" do
|
806
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
807
|
+
elements = selenium_page_object.radio_button_elements(:id => 'blah')
|
808
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::RadioButton
|
809
|
+
end
|
810
|
+
|
811
|
+
it "should find a div" do
|
812
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
813
|
+
element = selenium_page_object.div_element(:id => 'blah')
|
814
|
+
expect(element).to be_instance_of PageObject::Elements::Div
|
815
|
+
end
|
816
|
+
|
817
|
+
it "should find all div elements" do
|
818
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
819
|
+
elements = selenium_page_object.div_elements(:id => 'blah')
|
820
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Div
|
821
|
+
end
|
822
|
+
|
823
|
+
it "should find a span" do
|
824
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
825
|
+
element = selenium_page_object.span_element(:id => 'blah')
|
826
|
+
expect(element).to be_instance_of PageObject::Elements::Span
|
827
|
+
end
|
828
|
+
|
829
|
+
it "should find all span elements" do
|
830
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
831
|
+
elements = selenium_page_object.span_elements(:id => 'blah')
|
832
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Span
|
833
|
+
end
|
834
|
+
|
835
|
+
it "should find a table" do
|
836
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
837
|
+
element = selenium_page_object.table_element(:id => 'blah')
|
838
|
+
expect(element).to be_instance_of PageObject::Elements::Table
|
839
|
+
end
|
840
|
+
|
841
|
+
it "should find all table elements" do
|
842
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
843
|
+
elements = selenium_page_object.table_elements(:id => 'blah')
|
844
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Table
|
845
|
+
end
|
846
|
+
|
847
|
+
it "should find a table cell" do
|
848
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
849
|
+
element = selenium_page_object.cell_element(:id => 'blah')
|
850
|
+
expect(element).to be_instance_of PageObject::Elements::TableCell
|
851
|
+
end
|
852
|
+
|
853
|
+
it "should find all table cell elements" do
|
854
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
855
|
+
elements = selenium_page_object.cell_elements(:id => 'blah')
|
856
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::TableCell
|
857
|
+
end
|
858
|
+
|
859
|
+
it "should find an image" do
|
860
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
861
|
+
element = selenium_page_object.image_element(:id => 'blah')
|
862
|
+
expect(element).to be_instance_of PageObject::Elements::Image
|
863
|
+
end
|
864
|
+
|
865
|
+
it "should find all image elements" do
|
866
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
867
|
+
elements = selenium_page_object.image_elements(:id => 'blah')
|
868
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Image
|
869
|
+
end
|
870
|
+
|
871
|
+
it "should find a form" do
|
872
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
873
|
+
element = selenium_page_object.form_element(:id => 'blah')
|
874
|
+
expect(element).to be_instance_of PageObject::Elements::Form
|
875
|
+
end
|
876
|
+
|
877
|
+
it "should find all forms" do
|
878
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
879
|
+
elements = selenium_page_object.form_elements(:id => 'blah')
|
880
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Form
|
881
|
+
end
|
882
|
+
|
883
|
+
it "should find a list item" do
|
884
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
885
|
+
element = selenium_page_object.list_item_element(:id => 'blah')
|
886
|
+
expect(element).to be_instance_of PageObject::Elements::ListItem
|
887
|
+
end
|
888
|
+
|
889
|
+
it "should find all list items" do
|
890
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
891
|
+
element = selenium_page_object.list_item_elements(:id => 'blah')
|
892
|
+
expect(element[0]).to be_instance_of PageObject::Elements::ListItem
|
893
|
+
end
|
894
|
+
|
895
|
+
it "should find an unordered list" do
|
896
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
897
|
+
element = selenium_page_object.unordered_list_element(:id => 'blah')
|
898
|
+
expect(element).to be_instance_of PageObject::Elements::UnorderedList
|
899
|
+
end
|
900
|
+
|
901
|
+
it "should find all unordered lists" do
|
902
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
903
|
+
elements = selenium_page_object.unordered_list_elements(:id => 'blah')
|
904
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::UnorderedList
|
905
|
+
end
|
906
|
+
|
907
|
+
it "should find an ordered list" do
|
908
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
909
|
+
element = selenium_page_object.ordered_list_element(:id => 'blah')
|
910
|
+
expect(element).to be_instance_of PageObject::Elements::OrderedList
|
911
|
+
end
|
912
|
+
|
913
|
+
it "should find all orderd list elements" do
|
914
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
915
|
+
elements = selenium_page_object.ordered_list_elements(:id => 'blah')
|
916
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::OrderedList
|
917
|
+
end
|
918
|
+
|
919
|
+
it "should find a h1 element" do
|
920
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
921
|
+
element = selenium_page_object.h1_element(:id => 'blah')
|
922
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
923
|
+
end
|
924
|
+
|
925
|
+
it "should find all h1 elements" do
|
926
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, "blah").and_return([selenium_browser])
|
927
|
+
elements = selenium_page_object.h1_elements(:id => 'blah')
|
928
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
929
|
+
end
|
930
|
+
|
931
|
+
it "should find a h2 element" do
|
932
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
933
|
+
element = selenium_page_object.h2_element(:id => 'blah')
|
934
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
935
|
+
end
|
936
|
+
|
937
|
+
it "should find all h2 elements" do
|
938
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
939
|
+
elements = selenium_page_object.h2_elements(:id => 'blah')
|
940
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
941
|
+
end
|
942
|
+
|
943
|
+
it "should find a h3 element" do
|
944
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
945
|
+
element = selenium_page_object.h3_element(:id => 'blah')
|
946
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
947
|
+
end
|
948
|
+
|
949
|
+
it "should find all h3 elements" do
|
950
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
951
|
+
elements = selenium_page_object.h3_elements(:id => 'blah')
|
952
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
953
|
+
end
|
954
|
+
|
955
|
+
it "should find a h4 element" do
|
956
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
957
|
+
element = selenium_page_object.h4_element(:id => 'blah')
|
958
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
959
|
+
end
|
960
|
+
|
961
|
+
it "should find all h4 elements" do
|
962
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
963
|
+
elements = selenium_page_object.h4_elements(:id => 'blah')
|
964
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
965
|
+
end
|
966
|
+
|
967
|
+
it "should find a h5 element" do
|
968
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
969
|
+
element = selenium_page_object.h5_element(:id => 'blah')
|
970
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
971
|
+
end
|
972
|
+
|
973
|
+
it "should find all h5 elements" do
|
974
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
975
|
+
elements = selenium_page_object.h5_elements(:id => 'blah')
|
976
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
977
|
+
end
|
978
|
+
|
979
|
+
it "should find a h6 element" do
|
980
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
981
|
+
element = selenium_page_object.h6_element(:id => 'blah')
|
982
|
+
expect(element).to be_instance_of PageObject::Elements::Heading
|
983
|
+
end
|
984
|
+
|
985
|
+
it "should find all h6 elements" do
|
986
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
987
|
+
elements = selenium_page_object.h6_elements(:id => 'blah')
|
988
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Heading
|
989
|
+
end
|
990
|
+
|
991
|
+
it "should find a paragraph element" do
|
992
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
993
|
+
element = selenium_page_object.paragraph_element(:id => 'blah')
|
994
|
+
expect(element).to be_instance_of PageObject::Elements::Paragraph
|
995
|
+
end
|
996
|
+
|
997
|
+
it "should find all paragraph elements" do
|
998
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
999
|
+
elements = selenium_page_object.paragraph_elements(:id => 'blah')
|
1000
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Paragraph
|
1001
|
+
end
|
1002
|
+
|
1003
|
+
it "should find a label" do
|
1004
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
1005
|
+
element = selenium_page_object.label_element(:id => 'blah')
|
1006
|
+
expect(element).to be_instance_of PageObject::Elements::Label
|
1007
|
+
end
|
1008
|
+
|
1009
|
+
it "should find all label elements" do
|
1010
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
1011
|
+
elements = selenium_page_object.label_elements(:id => 'blah')
|
1012
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Label
|
1013
|
+
end
|
1014
|
+
|
1015
|
+
it "should find a file field element" do
|
1016
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
1017
|
+
element = selenium_page_object.file_field_element(:id => 'blah')
|
1018
|
+
expect(element).to be_instance_of PageObject::Elements::FileField
|
1019
|
+
end
|
1020
|
+
|
1021
|
+
it "should find an area element" do
|
1022
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
1023
|
+
element = selenium_page_object.area_element(:id => 'blah')
|
1024
|
+
expect(element).to be_instance_of PageObject::Elements::Area
|
1025
|
+
end
|
1026
|
+
|
1027
|
+
it "should find an area element using a default identifier" do
|
1028
|
+
expect(selenium_browser).to receive(:find_element).with(:xpath, '(.//area)[1]').and_return(selenium_browser)
|
1029
|
+
selenium_page_object.area_element
|
1030
|
+
end
|
1031
|
+
|
1032
|
+
it "should find all area elements" do
|
1033
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
1034
|
+
elements = selenium_page_object.area_elements(:id => 'blah')
|
1035
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Area
|
1036
|
+
end
|
1037
|
+
|
1038
|
+
it "should find all areas with no identifier" do
|
1039
|
+
expect(selenium_browser).to receive(:find_elements).with(:tag_name, 'area').and_return([selenium_browser])
|
1040
|
+
selenium_page_object.area_elements
|
1041
|
+
end
|
1042
|
+
|
1043
|
+
it "should find a canvas element" do
|
1044
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
1045
|
+
element = selenium_page_object.canvas_element(:id => 'blah')
|
1046
|
+
expect(element).to be_instance_of PageObject::Elements::Canvas
|
1047
|
+
end
|
1048
|
+
|
1049
|
+
it "should find a canvas element using a default identifier" do
|
1050
|
+
expect(selenium_browser).to receive(:find_element).with(:xpath, '(.//canvas)[1]').and_return(selenium_browser)
|
1051
|
+
selenium_page_object.canvas_element
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
it "should find all canvas elements" do
|
1055
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
1056
|
+
elements = selenium_page_object.canvas_elements(:id => 'blah')
|
1057
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Canvas
|
1058
|
+
end
|
1059
|
+
|
1060
|
+
it "should find all canvases with no identifier" do
|
1061
|
+
expect(selenium_browser).to receive(:find_elements).with(:tag_name, 'canvas').and_return([selenium_browser])
|
1062
|
+
selenium_page_object.canvas_elements
|
1063
|
+
end
|
1064
|
+
|
1065
|
+
it "should find an audio element" do
|
1066
|
+
expect(selenium_browser).to receive(:find_element).with(:id, 'blah').and_return(selenium_browser)
|
1067
|
+
element = selenium_page_object.audio_element(:id => 'blah')
|
1068
|
+
expect(element).to be_instance_of PageObject::Elements::Audio
|
1069
|
+
end
|
1070
|
+
|
1071
|
+
it "should find an audio element using a default identifier" do
|
1072
|
+
expect(selenium_browser).to receive(:find_element).with(:xpath, '(.//audio)[1]').and_return(selenium_browser)
|
1073
|
+
selenium_page_object.audio_element
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
it "should find all audio elements" do
|
1077
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
1078
|
+
elements = selenium_page_object.audio_elements(:id => 'blah')
|
1079
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Audio
|
1080
|
+
end
|
1081
|
+
|
1082
|
+
it "should find all audio elements with no identifier" do
|
1083
|
+
expect(selenium_browser).to receive(:find_elements).with(:tag_name, 'audio').and_return([selenium_browser])
|
1084
|
+
selenium_page_object.audio_elements
|
1085
|
+
end
|
1086
|
+
it "should find a b element" do
|
1087
|
+
expect(selenium_browser).to receive(:find_element).with(:id,'blah').and_return(selenium_browser)
|
1088
|
+
element = selenium_page_object.b_element(:id => 'blah')
|
1089
|
+
expect(element).to be_instance_of PageObject::Elements::Bold
|
1090
|
+
end
|
1091
|
+
|
1092
|
+
|
1093
|
+
it "should find all b elements" do
|
1094
|
+
expect(selenium_browser).to receive(:find_elements).with(:id, 'blah').and_return([selenium_browser])
|
1095
|
+
elements = selenium_page_object.b_elements(:id => 'blah')
|
1096
|
+
expect(elements[0]).to be_instance_of PageObject::Elements::Bold
|
1097
|
+
end
|
1098
|
+
|
1099
|
+
end
|
1100
|
+
end
|