page_object 1.1.1
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.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/ChangeLog +809 -0
- data/Gemfile +14 -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 +98 -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 +55 -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 +207 -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 +117 -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/section.feature +132 -0
- data/features/select_list.feature +86 -0
- data/features/span.feature +37 -0
- data/features/step_definitions/accessor_steps.rb +64 -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 +48 -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 +163 -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/section_steps.rb +268 -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_row_steps.rb +23 -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 +382 -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/table_row.feature +43 -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.rb +421 -0
- data/lib/page-object/accessors.rb +1412 -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.rb +60 -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 +37 -0
- data/lib/page-object/elements/div.rb +19 -0
- data/lib/page-object/elements/element.rb +226 -0
- data/lib/page-object/elements/file_field.rb +38 -0
- data/lib/page-object/elements/form.rb +36 -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 +36 -0
- data/lib/page-object/elements/label.rb +19 -0
- data/lib/page-object/elements/link.rb +46 -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 +50 -0
- data/lib/page-object/elements/paragraph.rb +9 -0
- data/lib/page-object/elements/radio_button.rb +37 -0
- data/lib/page-object/elements/select_list.rb +42 -0
- data/lib/page-object/elements/span.rb +19 -0
- data/lib/page-object/elements/table.rb +79 -0
- data/lib/page-object/elements/table_cell.rb +28 -0
- data/lib/page-object/elements/table_row.rb +50 -0
- data/lib/page-object/elements/text_area.rb +38 -0
- data/lib/page-object/elements/text_field.rb +42 -0
- data/lib/page-object/elements/unordered_list.rb +51 -0
- data/lib/page-object/elements/video.rb +18 -0
- data/lib/page-object/indexed_properties.rb +40 -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 +45 -0
- data/lib/page-object/locator_generator.rb +131 -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 +18 -0
- data/lib/page-object/platforms/selenium_webdriver.rb +30 -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 +1237 -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 +30 -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 +1082 -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/sections.rb +29 -0
- data/lib/page-object/version.rb +4 -0
- data/lib/page-object/widgets.rb +133 -0
- data/page_object.gemspec +31 -0
- data/pageobject.gems +1 -0
- data/spec/page-object/accessors_spec.rb +40 -0
- data/spec/page-object/element_locators_spec.rb +1122 -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 +64 -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 +177 -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 +145 -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 +407 -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/page_section_spec.rb +73 -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 +47 -0
- metadata +601 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
class Container
|
|
2
|
+
include PageObject
|
|
3
|
+
|
|
4
|
+
link(:section_link)
|
|
5
|
+
button(:section_button)
|
|
6
|
+
text_field(:section_text_field)
|
|
7
|
+
hidden_field(:section_hidden_field)
|
|
8
|
+
text_area(:section_text_area)
|
|
9
|
+
select_list(:section_select_list)
|
|
10
|
+
checkbox(:section_checkbox)
|
|
11
|
+
radio_button(:section_radio_button)
|
|
12
|
+
div(:section_div)
|
|
13
|
+
span(:section_span)
|
|
14
|
+
table(:section_table)
|
|
15
|
+
cell(:section_cell) { |page| page.section_table_element.cell_element(:index => 1) }
|
|
16
|
+
image(:section_image)
|
|
17
|
+
form(:section_form)
|
|
18
|
+
ordered_list(:section_ordered_list)
|
|
19
|
+
unordered_list(:section_unordered_list)
|
|
20
|
+
list_item(:section_list_item) { |page| page.section_ordered_list_element.list_item_element }
|
|
21
|
+
h1(:section_h1)
|
|
22
|
+
h2(:section_h2)
|
|
23
|
+
h3(:section_h3)
|
|
24
|
+
h4(:section_h4)
|
|
25
|
+
h5(:section_h5)
|
|
26
|
+
h6(:section_h6)
|
|
27
|
+
paragraph(:section_paragraph)
|
|
28
|
+
file_field(:section_file_field)
|
|
29
|
+
|
|
30
|
+
indexed_property(:indexed_list,[[:link,:indexed_link,href: '%s.html']])
|
|
31
|
+
|
|
32
|
+
unordered_list(:outside_section, :id => 'outer')
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
class InputSection
|
|
36
|
+
include PageObject
|
|
37
|
+
|
|
38
|
+
def value
|
|
39
|
+
root.value
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
class SectionElementsPage
|
|
44
|
+
include PageObject
|
|
45
|
+
|
|
46
|
+
page_section(:container, Container, :id => 'div_id')
|
|
47
|
+
page_sections(:page_inputs, InputSection, :tag_name => 'input')
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
When(/^I get the text from the section$/) do
|
|
51
|
+
@text = @page.container.text
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
Given /^I am on the section elements page$/ do
|
|
55
|
+
@page = SectionElementsPage.new(@browser)
|
|
56
|
+
@page.navigate_to(UrlHelper.nested_elements)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
When /^I search for a link located in a section$/ do
|
|
60
|
+
@link = @page.container.section_link_element
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
Then /^I should be able to click the section link$/ do
|
|
64
|
+
@link.click
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
When /^I search for a button located in a section$/ do
|
|
68
|
+
@button = @page.container.section_button_element
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
Then /^I should be able to click the section button$/ do
|
|
72
|
+
@button.click
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
When /^I search for a text field located in a section$/ do
|
|
76
|
+
@text_field = @page.container.section_text_field_element
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
Then /^I should be able to type "([^\"]*)" in the section text field$/ do |value|
|
|
80
|
+
@text_field.value = value
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
When /^I search for a hidden field located in a section$/ do
|
|
84
|
+
@hidden_field = @page.container.section_hidden_field_element
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
Then /^I should be able to see that the section hidden field contains "([^\"]*)"$/ do |value|
|
|
88
|
+
@hidden_field.value.should == value
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
When /^I search for a text area located in a section$/ do
|
|
92
|
+
@text_area = @page.container.section_text_area_element
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
Then /^I should be able to type "([^\"]*)" in the section text area$/ do |value|
|
|
96
|
+
@text_area.value = value
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
When /^I search for a select list located in a section$/ do
|
|
100
|
+
@select_list = @page.container.section_select_list_element
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
Then /^I should be able to select "([^\"]*)" in the section select list$/ do |value|
|
|
104
|
+
@select_list.select value
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
When /^I search for a checkbox located in a section$/ do
|
|
108
|
+
@checkbox = @page.container.section_checkbox_element
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
Then /^I should be able to check the section checkbox$/ do
|
|
112
|
+
@checkbox.check
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
When /^I search for a radio button located in a section$/ do
|
|
116
|
+
@radio = @page.container.section_radio_button_element
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
Then /^I should be able to select the section radio button$/ do
|
|
120
|
+
@radio.select
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
When /^I search for a div located in a section$/ do
|
|
124
|
+
@div = @page.container.section_div_element
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
Then /^I should see the text "([^\"]*)" in the section div$/ do |value|
|
|
128
|
+
@div.text.should == value
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
Then /^I should see the text "([^\"]*)" in the section indexed link$/ do |value|
|
|
132
|
+
@link.text.should == value
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
When /^I search for a span located in a section$/ do
|
|
136
|
+
@span = @page.container.section_span_element
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
Then /^I should see the text "([^\"]*)" in the section span$/ do |value|
|
|
140
|
+
@span.text.should == value
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
When /^I search for a table located in a section$/ do
|
|
144
|
+
@table = @page.container.section_table_element
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
Then /^the data for row "([^\"]*)" of the section table should be "([^\"]*)" and "([^\"]*)"$/ do |row, col1, col2|
|
|
148
|
+
table_row = @table[row.to_i - 1]
|
|
149
|
+
table_row[0].text.should == col1
|
|
150
|
+
table_row[1].text.should == col2
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
When /^I search the second table cell located in a table in a section$/ do
|
|
154
|
+
@cell = @page.container.section_cell_element
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
Then /^the section table cell should contain "([^\"]*)"$/ do |value|
|
|
158
|
+
@cell.text.should == value
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
When /^I search for an image located in a section$/ do
|
|
162
|
+
@image = @page.container.section_image_element
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
Then /^the section image should be "([^\"]*)" pixels wide$/ do |width|
|
|
166
|
+
@image.width.should == width.to_i
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
Then /^the section image should be "([^\"]*)" pixels tall$/ do |height|
|
|
170
|
+
@image.height.should == height.to_i
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
When /^I search for a form located in a section$/ do
|
|
174
|
+
@form = @page.container.section_form_element
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
Then /^I should be able to submit the section form$/ do
|
|
178
|
+
@form.submit
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
When /^I search for an ordered list located in a section$/ do
|
|
182
|
+
@list = @page.container.section_ordered_list_element
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
Then /^the first section list items text should be "([^\"]*)"$/ do |value|
|
|
186
|
+
@list[0].text.should == value
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
When /^I search for an unordered list located in a section$/ do
|
|
190
|
+
@list = @page.container.section_unordered_list_element
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
When /^I search for a list item section in an ordered list in a section$/ do
|
|
194
|
+
@li = @page.container.section_list_item_element
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
Then /^I should see the section list items text should be "([^\"]*)"$/ do |value|
|
|
198
|
+
@li.text.should == value
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
When /^I search for a h(\d+) located in a section$/ do |num|
|
|
202
|
+
@header = @page.container.send "section_h#{num}_element"
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
Then /^I should see the section h(\d+)s text should be "([^\"]*)"$/ do |num, value|
|
|
206
|
+
@header.text.should == value
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
When /^I search for a paragraph located in a section$/ do
|
|
210
|
+
@para = @page.container.section_paragraph_element
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
Then /^I should see the section paragraphs text should be "([^\"]*)"$/ do |value|
|
|
214
|
+
@para.text.should == value
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
When /^I search for a file field located in a section$/ do
|
|
218
|
+
@ff = @page.container.section_file_field_element
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
Then /^I should be able to set the section file field$/ do
|
|
222
|
+
@ff.value = __FILE__
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
When(/^I access an element that is outside of the section$/) do
|
|
226
|
+
@element = @page.container.outside_section_element
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
Then(/^I should see that it doesn't exist in the section$/) do
|
|
230
|
+
expect(@element).not_to exist
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
When(/^I select multiple sections$/) do
|
|
234
|
+
@sections = @page.page_inputs
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
Then(/^I should have a section collection containing the sections$/) do
|
|
238
|
+
expect(@sections).to be_an_instance_of(PageObject::SectionCollection)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
When(/^I search by a specific value of the section$/) do
|
|
242
|
+
@element = @sections.find_by(:value => 'LeanDog')
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
Then(/^I will find the first section with that value$/) do
|
|
246
|
+
expect(@element).to be_a(PageObject)
|
|
247
|
+
expect(@element.value).to eq 'LeanDog'
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
When(/^I filter by a specific value of the sections$/) do
|
|
251
|
+
@elements = @sections.select_by(:value => /\w+/)
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
Then(/^I will find all sections with that value$/) do
|
|
255
|
+
expect(@elements).to be_a PageObject::SectionCollection
|
|
256
|
+
@elements.map(&:value).each do |element|
|
|
257
|
+
expect(element).to match(/\w+/)
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
And(/^I can access any index of that collection of sections$/) do
|
|
262
|
+
expect(@sections[0]).to be_a(PageObject)
|
|
263
|
+
expect(@sections[-1]).to be_a(PageObject)
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
Given(/^I search for a link in an indexed property located in a section$/) do
|
|
267
|
+
@link = @page.container.indexed_list['success'].indexed_link_element
|
|
268
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
When /^I select "([^\"]*)" from the select list$/ do |text|
|
|
2
|
+
@page.sel_list_id = text
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
When /^I search for the select list by "([^\"]*)"$/ do |how|
|
|
6
|
+
@how = how
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
When /^I search for the select list by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
|
|
10
|
+
@how = "#{param1}_#{param2}"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
Then /^I should be able to select "([^\"]*)"$/ do |value|
|
|
14
|
+
@page.send "sel_list_#{@how}=".to_sym, value
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Then /^the value for the selected item should be "([^\"]*)"$/ do |value|
|
|
18
|
+
result = @page.send "sel_list_#{@how}".to_sym
|
|
19
|
+
result.should == value
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
When /^I find a select list while the script is executing$/ do
|
|
23
|
+
@select_list = @page.select_list_element(:id => 'sel_list_id')
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
Then /^I should be able to select "([^\"]*)" from the list$/ do |value|
|
|
27
|
+
@select_list.select(value)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
Then /^I should see that the select list exists$/ do
|
|
31
|
+
@page.sel_list_id?.should == true
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
Then /^the selected option should be "([^\"]*)"$/ do |text|
|
|
35
|
+
@page.select_list_element(:id => 'sel_list_id').selected_options[0].should == text
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
Then /^the select list should include "([^\"]*)"$/ do |text|
|
|
39
|
+
@page.sel_list_id_element.should include text
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
Then /^the select list should know that "([^\"]*)" is selected$/ do |text|
|
|
43
|
+
@page.sel_list_id_element.selected?(text).should be true
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
Then /^the value for the option should be "([^\"]*)"$/ do |value|
|
|
47
|
+
element = @page.send "sel_list_#{@how}_element".to_sym
|
|
48
|
+
element.value.should == value
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
When /^I clear multiple select list$/ do
|
|
52
|
+
@page.sel_list_multiple_element.clear
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
Then /^multiple select list should have no selected options$/ do
|
|
56
|
+
@page.sel_list_multiple_element.selected_options.should be_empty
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
When /^I select an option using the value "([^\"]*)"$/ do |value|
|
|
60
|
+
@page.sel_list_id_element.select_value(value)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
Then /^the selected option should have a value of "([^\"]*)"$/ do |value|
|
|
64
|
+
@page.sel_list_id_element.selected_values[0].should == value
|
|
65
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
When /^I get the text from the span$/ do
|
|
2
|
+
@text = @page.span_id
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
When /^I search for the span by "([^\"]*)"$/ do |how|
|
|
6
|
+
@text = @page.send "span_#{how}".to_sym
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
When /^I search for the span by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
|
|
10
|
+
@text = @page.send "span_#{param1}_#{param2}".to_sym
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
When /^I get the text from a span while the script is executing$/ do
|
|
14
|
+
@text = @page.span_element(:id => 'span_id').text
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Then /^I should see that the span exists$/ do
|
|
18
|
+
@page.span_id?.should == true
|
|
19
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
When /^I search for the table cell by "([^\"]*)"$/ do |how|
|
|
2
|
+
@cell_data = @page.send "cell_#{how}"
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
When /^I retrieve a table cell element by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
|
|
6
|
+
@cell_data = @page.send "cell_#{param1}_#{param2}"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
When /^I retrieve a table cell element while the script is executing$/ do
|
|
10
|
+
@cell_data = @page.cell_element(:id => 'cell_id').text
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
Then /^I should see that the cell exists$/ do
|
|
14
|
+
@page.cell_id?.should == true
|
|
15
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
When /^I search for the table row by "([^\"]*)"$/ do |how|
|
|
2
|
+
@row_data = @page.send "tr_#{how}"
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
When /^I retrieve a table row element by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
|
|
6
|
+
@row_data = @page.send "tr_#{param1}_#{param2}"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
When /^I retrieve a table row element while the script is executing$/ do
|
|
10
|
+
@row_data = @page.row_element(:id => 'tr_id').text
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
Then /^I should see that the row exists$/ do
|
|
14
|
+
@page.tr_id?.should == true
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
When /^I retrieve the data from the table row/ do
|
|
18
|
+
@row_data = @page.tr_id
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
Then /^the row data should be '([^"]*)'$/ do |expected|
|
|
22
|
+
@row_data.should == expected
|
|
23
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Then /^the data for row "([^\"]*)" should be "([^\"]*)" and "([^\"]*)"$/ do |row, col1, col2|
|
|
2
|
+
row = (row.to_i - 1) if row.to_i > 0
|
|
3
|
+
table_row = @element[row]
|
|
4
|
+
table_row[0].text.should == col1
|
|
5
|
+
table_row[1].text.should == col2
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
When /^I retrieve the data from the table cell$/ do
|
|
10
|
+
@cell_data = @page.cell_id
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
Then /^the cell data should be '([^"]*)'$/ do |expected|
|
|
14
|
+
@cell_data.should == expected
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
When /^I retrieve a table element by "([^\"]*)"$/ do |how|
|
|
18
|
+
@element = @page.send "table_#{how}_element"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
When /^I retrieve a table element by "([^\"]*)" and "([^\"]*)"$/ do |param1, param2|
|
|
22
|
+
@element = @page.send "table_#{param1}_#{param2}_element"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
When /^I retrieve a table element while the script is executing$/ do
|
|
26
|
+
@element = @page.table_element(:id => 'table_id')
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
Then /^the data for the first row should be "([^\"]*)" and "([^\"]*)"$/ do |col1, col2|
|
|
30
|
+
@element.first_row[0].text.should == col1
|
|
31
|
+
@element.first_row[1].text.should == col2
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
Then /^the data for the second row should be "([^\"]*)" and "([^\"]*)"$/ do |col1, col2|
|
|
35
|
+
@element[1][0].text.should == col1
|
|
36
|
+
@element[1][1].text.should == col2
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
Then /^the data for the last row should be "([^\"]*)" and "([^\"]*)"$/ do |col1, col2|
|
|
40
|
+
@element.last_row[0].text.should == col1
|
|
41
|
+
@element.last_row[1].text.should == col2
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
Then /^I should see that the table exists$/ do
|
|
45
|
+
@page.table_id?.should == true
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
Then /^the data for column "([^\"]*)" and row "([^\"]*)" should be "([^\"]*)"$/ do |column, row, value|
|
|
49
|
+
@element[row.to_i - 1][column].text.should == value
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
Then /^the data for row "([^\"]*)" and column "([^\"]*)" should be "([^\"]*)"$/ do |row, column, value|
|
|
53
|
+
@element[row][column].text.should == value
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
Then /^the data for row "([^\"]*)" should be nil$/ do |row|
|
|
57
|
+
@element[row].should be_nil
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
Then /^the data for row "([^\"]*)" and column "([^\"]*)" should be nil$/ do |row, column|
|
|
61
|
+
@element[row][column].should be_nil
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
Then /^I should see the text includes "([^"]*)" when I retrieve it by "([^"]*)"$/ do |text, how|
|
|
65
|
+
@page.send("table_#{how}").should include text
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
Then /^the table should be like the expected one$/ do |expected_table|
|
|
69
|
+
(expected_table.diff!@element.hashes).should be_nil
|
|
70
|
+
end
|