page-object 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +22 -12
- data/ChangeLog +10 -0
- data/Gemfile +4 -2
- data/Guardfile +1 -1
- data/README.md +2 -2
- data/lib/page-object/accessors.rb +57 -35
- data/lib/page-object/elements/element.rb +26 -0
- data/lib/page-object/locator_generator.rb +46 -0
- data/lib/page-object/platforms/selenium_webdriver/element.rb +6 -6
- data/lib/page-object/platforms/selenium_webdriver/page_object.rb +14 -0
- data/lib/page-object/platforms/watir_webdriver/element.rb +0 -7
- data/lib/page-object/platforms/watir_webdriver/page_object.rb +16 -3
- data/lib/page-object/version.rb +1 -1
- data/page-object.gemspec +7 -10
- metadata +34 -375
- data/features/area.feature +0 -35
- data/features/async.feature +0 -21
- data/features/audio.feature +0 -64
- data/features/bold.feature +0 -21
- data/features/button.feature +0 -98
- data/features/canvas.feature +0 -37
- data/features/check_box.feature +0 -55
- data/features/div.feature +0 -45
- data/features/element.feature +0 -343
- data/features/file_field.feature +0 -40
- data/features/form.feature +0 -43
- data/features/frames.feature +0 -75
- data/features/generic_elements.feature +0 -29
- data/features/gxt_table_extension.feature +0 -23
- data/features/headings.feature +0 -97
- data/features/hidden_field.feature +0 -45
- 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 +0 -36
- data/features/html/double_click.html +0 -13
- data/features/html/failure.html +0 -8
- data/features/html/frame_1.html +0 -18
- data/features/html/frame_2.html +0 -16
- data/features/html/frame_3.html +0 -14
- data/features/html/frames.html +0 -12
- data/features/html/hover.html +0 -12
- data/features/html/iframes.html +0 -12
- 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 +0 -55
- data/features/html/modal.html +0 -17
- data/features/html/modal_1.html +0 -38
- data/features/html/modal_2.html +0 -27
- data/features/html/movie.mp4 +0 -0
- data/features/html/movie.ogg +0 -0
- data/features/html/multi_elements.html +0 -145
- data/features/html/nested_elements.html +0 -77
- data/features/html/nested_frame_1.html +0 -1
- data/features/html/nested_frame_2.html +0 -11
- data/features/html/nested_frame_3.html +0 -14
- data/features/html/nested_frames.html +0 -10
- data/features/html/planets.gif +0 -0
- data/features/html/static_elements.html +0 -194
- data/features/html/success.html +0 -8
- data/features/html/sun.gif +0 -0
- data/features/html/sun.html +0 -7
- data/features/html/widgets.html +0 -20
- data/features/image.feature +0 -50
- data/features/indexed_property.feature +0 -117
- data/features/italic.feature +0 -21
- data/features/javascript.feature +0 -28
- data/features/label.feature +0 -46
- data/features/link.feature +0 -52
- data/features/list_item.feature +0 -36
- data/features/modal_dialog.feature +0 -15
- data/features/multi_elements.feature +0 -498
- data/features/nested_elements.feature +0 -117
- data/features/ordered_list.feature +0 -56
- data/features/page_level_actions.feature +0 -90
- data/features/paragraph.feature +0 -35
- data/features/radio_button.feature +0 -58
- data/features/radio_button_group.feature +0 -29
- data/features/sample-app/public/audio_video.html +0 -23
- data/features/sample-app/public/jquery-1.3.2.js +0 -4376
- data/features/sample-app/public/jquery.html +0 -30
- data/features/sample-app/public/prototype-1.6.0.3.js +0 -4320
- data/features/sample-app/public/prototype.html +0 -35
- data/features/sample-app/sample_app.rb +0 -35
- data/features/section.feature +0 -136
- data/features/select_list.feature +0 -86
- data/features/span.feature +0 -37
- data/features/step_definitions/accessor_steps.rb +0 -64
- data/features/step_definitions/area_steps.rb +0 -19
- data/features/step_definitions/async_steps.rb +0 -83
- data/features/step_definitions/audio_steps.rb +0 -27
- data/features/step_definitions/bold_steps.rb +0 -12
- data/features/step_definitions/button_steps.rb +0 -48
- data/features/step_definitions/canvas_steps.rb +0 -15
- data/features/step_definitions/check_box_steps.rb +0 -35
- data/features/step_definitions/div_steps.rb +0 -19
- data/features/step_definitions/element_steps.rb +0 -294
- data/features/step_definitions/file_field_steps.rb +0 -19
- data/features/step_definitions/form_steps.rb +0 -19
- data/features/step_definitions/frames_steps.rb +0 -159
- data/features/step_definitions/generic_element_steps.rb +0 -31
- data/features/step_definitions/gxt_table_steps.rb +0 -53
- data/features/step_definitions/headings_steps.rb +0 -12
- data/features/step_definitions/hidden_field_steps.rb +0 -27
- data/features/step_definitions/image_steps.rb +0 -27
- data/features/step_definitions/indexed_property_steps.rb +0 -163
- data/features/step_definitions/italic_steps.rb +0 -12
- data/features/step_definitions/javascript_steps.rb +0 -53
- data/features/step_definitions/label_steps.rb +0 -19
- data/features/step_definitions/link_steps.rb +0 -40
- data/features/step_definitions/list_item_steps.rb +0 -19
- data/features/step_definitions/modal_dialog_steps.rb +0 -62
- data/features/step_definitions/multi_elements_steps.rb +0 -554
- data/features/step_definitions/nested_elements_steps.rb +0 -212
- data/features/step_definitions/ordered_list_steps.rb +0 -23
- data/features/step_definitions/page_level_actions_steps.rb +0 -135
- data/features/step_definitions/page_traversal_steps.rb +0 -8
- data/features/step_definitions/paragraph_steps.rb +0 -28
- data/features/step_definitions/radio_button_group_steps.rb +0 -36
- data/features/step_definitions/radio_button_steps.rb +0 -27
- data/features/step_definitions/section_steps.rb +0 -277
- data/features/step_definitions/select_list_steps.rb +0 -65
- data/features/step_definitions/span_steps.rb +0 -19
- data/features/step_definitions/table_cell_steps.rb +0 -15
- data/features/step_definitions/table_row_steps.rb +0 -23
- data/features/step_definitions/table_steps.rb +0 -70
- data/features/step_definitions/text_area_steps.rb +0 -35
- data/features/step_definitions/text_field_steps.rb +0 -35
- data/features/step_definitions/unordered_list_steps.rb +0 -23
- data/features/step_definitions/video_steps.rb +0 -45
- data/features/support/ajax_text_environment.rb +0 -26
- data/features/support/audio_video_page.rb +0 -24
- data/features/support/env.rb +0 -8
- data/features/support/hooks.rb +0 -8
- data/features/support/page.rb +0 -373
- data/features/support/persistent_browser.rb +0 -70
- data/features/support/targets/firefox14_osx.rb +0 -6
- data/features/support/targets/firefox14_windows7.rb +0 -6
- data/features/support/url_helper.rb +0 -61
- data/features/table.feature +0 -122
- data/features/table_cell.feature +0 -45
- data/features/table_row.feature +0 -43
- data/features/text_area.feature +0 -51
- data/features/text_field.feature +0 -70
- data/features/unordered_list.feature +0 -56
- data/features/video.feature +0 -69
- data/spec/page-object/accessors_spec.rb +0 -40
- data/spec/page-object/element_locators_spec.rb +0 -1144
- data/spec/page-object/elements/area_spec.rb +0 -45
- data/spec/page-object/elements/bold_spec.rb +0 -29
- data/spec/page-object/elements/button_spec.rb +0 -64
- data/spec/page-object/elements/canvas_spec.rb +0 -41
- data/spec/page-object/elements/check_box_spec.rb +0 -49
- data/spec/page-object/elements/div_spec.rb +0 -28
- data/spec/page-object/elements/element_spec.rb +0 -196
- data/spec/page-object/elements/file_field_spec.rb +0 -39
- data/spec/page-object/elements/form_spec.rb +0 -28
- data/spec/page-object/elements/heading_spec.rb +0 -48
- data/spec/page-object/elements/hidden_field_spec.rb +0 -28
- data/spec/page-object/elements/image_spec.rb +0 -66
- data/spec/page-object/elements/italic_spec.rb +0 -29
- data/spec/page-object/elements/label_spec.rb +0 -29
- data/spec/page-object/elements/link_spec.rb +0 -49
- data/spec/page-object/elements/list_item_spec.rb +0 -29
- data/spec/page-object/elements/media_spec.rb +0 -63
- data/spec/page-object/elements/nested_element_spec.rb +0 -254
- data/spec/page-object/elements/option_spec.rb +0 -11
- data/spec/page-object/elements/ordered_list_spec.rb +0 -78
- data/spec/page-object/elements/paragraph_spec.rb +0 -27
- data/spec/page-object/elements/select_list_spec.rb +0 -142
- data/spec/page-object/elements/selenium/radio_button_spec.rb +0 -44
- data/spec/page-object/elements/selenium/text_field_spec.rb +0 -49
- data/spec/page-object/elements/selenium_element_spec.rb +0 -218
- data/spec/page-object/elements/span_spec.rb +0 -26
- data/spec/page-object/elements/table_cell_spec.rb +0 -21
- data/spec/page-object/elements/table_row_spec.rb +0 -70
- data/spec/page-object/elements/table_spec.rb +0 -98
- data/spec/page-object/elements/text_area_spec.rb +0 -39
- data/spec/page-object/elements/unordered_list_spec.rb +0 -77
- data/spec/page-object/elements/video_spec.rb +0 -33
- data/spec/page-object/elements/watir_element_spec.rb +0 -193
- data/spec/page-object/javascript_framework_facade_spec.rb +0 -61
- data/spec/page-object/loads_platform_spec.rb +0 -53
- data/spec/page-object/page-object_spec.rb +0 -435
- data/spec/page-object/page_factory_spec.rb +0 -238
- data/spec/page-object/page_populator_spec.rb +0 -122
- data/spec/page-object/page_section_spec.rb +0 -80
- data/spec/page-object/platforms/selenium_webdriver/selenium_page_object_spec.rb +0 -68
- data/spec/page-object/platforms/selenium_webdriver_spec.rb +0 -29
- data/spec/page-object/platforms/watir_webdriver/watir_page_object_spec.rb +0 -29
- data/spec/page-object/platforms/watir_webdriver_spec.rb +0 -9
- data/spec/page-object/selenium_accessors_spec.rb +0 -628
- data/spec/page-object/watir_accessors_spec.rb +0 -1191
- data/spec/page-object/widget_spec.rb +0 -226
- data/spec/spec_helper.rb +0 -43
@@ -1,27 +0,0 @@
|
|
1
|
-
When /^I select the "([^\"]*)" radio button$/ do |how|
|
2
|
-
@page.send "select_#{how.downcase}_id".to_sym
|
3
|
-
end
|
4
|
-
|
5
|
-
Then /^the "([^\"]*)" radio button should be selected$/ do |how|
|
6
|
-
@page.send "#{how.downcase}_id_selected?".to_sym
|
7
|
-
end
|
8
|
-
|
9
|
-
When /^I search for the radio button by "([^\"]*)"$/ do |how|
|
10
|
-
@how = how
|
11
|
-
end
|
12
|
-
|
13
|
-
When /^I search for the radio button by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
|
14
|
-
@how = "#{param1}_#{param2}"
|
15
|
-
end
|
16
|
-
|
17
|
-
When /^I select the radio button$/ do
|
18
|
-
@page.send "select_milk_#{@how}".to_sym
|
19
|
-
end
|
20
|
-
|
21
|
-
When /^I select the radio button while the script is executing$/ do
|
22
|
-
@page.radio_button_element(:id => 'milk_id').select
|
23
|
-
end
|
24
|
-
|
25
|
-
Then /^I should see that the radio button exists$/ do
|
26
|
-
@page.milk_id?.should == true
|
27
|
-
end
|
@@ -1,277 +0,0 @@
|
|
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
|
269
|
-
|
270
|
-
When(/^I have a page section$/) do
|
271
|
-
@section = @page.container
|
272
|
-
end
|
273
|
-
|
274
|
-
Then(/^methods called on the section are passed to the root if missing$/) do
|
275
|
-
expect(-> { @section.visible? }).not_to raise_error
|
276
|
-
expect(@section.visible?).to be true
|
277
|
-
end
|
@@ -1,65 +0,0 @@
|
|
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
|
@@ -1,19 +0,0 @@
|
|
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
|
@@ -1,15 +0,0 @@
|
|
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
|
@@ -1,23 +0,0 @@
|
|
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
|
@@ -1,70 +0,0 @@
|
|
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
|