meeane-page-object 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -7
- data/.rspec +2 -2
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/.travis.yml +10 -10
- data/ChangeLog +790 -790
- data/Gemfile +13 -13
- data/Guardfile +20 -20
- data/LICENSE +20 -20
- data/README.md +1 -1
- data/Rakefile +35 -35
- data/cucumber.yml +10 -10
- data/features/area.feature +35 -35
- data/features/async.feature +30 -30
- data/features/audio.feature +68 -68
- data/features/button.feature +88 -87
- data/features/canvas.feature +37 -37
- data/features/check_box.feature +55 -55
- data/features/div.feature +45 -45
- data/features/element.feature +322 -322
- data/features/file_field.feature +40 -40
- data/features/form.feature +43 -43
- data/features/frames.feature +75 -75
- data/features/generic_elements.feature +29 -29
- data/features/gxt_table_extension.feature +24 -24
- data/features/headings.feature +97 -97
- data/features/hidden_field.feature +45 -45
- data/features/html/async.html +36 -36
- data/features/html/double_click.html +12 -12
- data/features/html/failure.html +7 -7
- data/features/html/frame_1.html +17 -17
- data/features/html/frame_2.html +15 -15
- data/features/html/frame_3.html +14 -14
- data/features/html/frames.html +12 -12
- data/features/html/hover.html +11 -11
- data/features/html/iframes.html +12 -12
- data/features/html/indexed_property.html +51 -51
- data/features/html/modal.html +17 -17
- data/features/html/modal_1.html +37 -37
- data/features/html/modal_2.html +26 -26
- data/features/html/multi_elements.html +144 -144
- data/features/html/nested_elements.html +77 -77
- data/features/html/nested_frame_2.html +11 -11
- data/features/html/nested_frame_3.html +14 -14
- data/features/html/nested_frames.html +10 -10
- data/features/html/static_elements.html +233 -226
- data/features/html/success.html +7 -7
- data/features/html/sun.html +7 -7
- data/features/image.feature +50 -50
- data/features/indexed_property.feature +97 -97
- data/features/javascript.feature +27 -27
- data/features/label.feature +46 -46
- data/features/link.feature +52 -52
- data/features/list_item.feature +36 -36
- data/features/modal_dialog.feature +15 -15
- data/features/multi_elements.feature +486 -486
- data/features/nested_elements.feature +117 -117
- data/features/ordered_list.feature +56 -56
- data/features/page_level_actions.feature +90 -90
- data/features/paragraph.feature +35 -35
- data/features/radio_button.feature +58 -58
- data/features/radio_button_collinson.feature +12 -58
- data/features/radio_button_group.feature +29 -29
- data/features/sample-app/public/jquery-1.3.2.js +4376 -4376
- data/features/sample-app/public/jquery.html +30 -30
- data/features/sample-app/public/prototype-1.6.0.3.js +4319 -4319
- data/features/sample-app/public/prototype.html +35 -35
- data/features/sample-app/sample_app.rb +35 -35
- data/features/select_list.feature +86 -86
- data/features/span.feature +37 -37
- data/features/step_definitions/accessor_steps.rb +60 -60
- data/features/step_definitions/area_steps.rb +19 -19
- data/features/step_definitions/async_steps.rb +83 -83
- data/features/step_definitions/audio_steps.rb +27 -27
- data/features/step_definitions/button_steps.rb +43 -43
- data/features/step_definitions/canvas_steps.rb +15 -15
- data/features/step_definitions/check_box_steps.rb +35 -35
- data/features/step_definitions/div_steps.rb +19 -19
- data/features/step_definitions/element_steps.rb +266 -266
- data/features/step_definitions/file_field_steps.rb +19 -19
- data/features/step_definitions/form_steps.rb +18 -18
- data/features/step_definitions/frames_steps.rb +159 -159
- data/features/step_definitions/generic_element_steps.rb +31 -31
- data/features/step_definitions/gxt_table_steps.rb +58 -58
- data/features/step_definitions/headings_steps.rb +12 -12
- data/features/step_definitions/hidden_field_steps.rb +26 -26
- data/features/step_definitions/image_steps.rb +27 -27
- data/features/step_definitions/indexed_property_steps.rb +128 -128
- data/features/step_definitions/javascript_steps.rb +52 -52
- data/features/step_definitions/label_steps.rb +19 -19
- data/features/step_definitions/link_steps.rb +40 -40
- data/features/step_definitions/list_item_steps.rb +19 -19
- data/features/step_definitions/modal_dialog_steps.rb +62 -62
- data/features/step_definitions/multi_elements_steps.rb +528 -528
- data/features/step_definitions/nested_elements_steps.rb +212 -212
- data/features/step_definitions/ordered_list_steps.rb +23 -23
- data/features/step_definitions/page_level_actions_steps.rb +135 -135
- data/features/step_definitions/page_traversal_steps.rb +4 -4
- data/features/step_definitions/paragraph_steps.rb +28 -28
- data/features/step_definitions/radio_button_collinson_steps.rb +2 -46
- data/features/step_definitions/radio_button_group_steps.rb +35 -35
- data/features/step_definitions/radio_button_steps.rb +26 -46
- data/features/step_definitions/select_list_steps.rb +65 -65
- data/features/step_definitions/span_steps.rb +19 -19
- data/features/step_definitions/table_cell_steps.rb +14 -14
- data/features/step_definitions/table_steps.rb +66 -66
- data/features/step_definitions/text_area_steps.rb +34 -34
- data/features/step_definitions/text_field_steps.rb +35 -35
- data/features/step_definitions/unordered_list_steps.rb +23 -23
- data/features/step_definitions/video_steps.rb +45 -45
- data/features/support/ajax_text_environment.rb +26 -26
- data/features/support/env.rb +8 -8
- data/features/support/hooks.rb +8 -8
- data/features/support/page.rb +370 -364
- data/features/support/persistent_browser.rb +70 -70
- data/features/support/targets/firefox14_osx.rb +6 -6
- data/features/support/targets/firefox14_windows7.rb +6 -6
- data/features/support/url_helper.rb +57 -57
- data/features/table.feature +114 -114
- data/features/table_cell.feature +45 -45
- data/features/text_area.feature +51 -51
- data/features/text_field.feature +70 -70
- data/features/unordered_list.feature +56 -56
- data/features/video.feature +73 -73
- data/lib/page-object.rb +408 -408
- data/lib/page-object/accessors.rb +1313 -1313
- data/lib/page-object/core_ext/string.rb +4 -4
- data/lib/page-object/element_locators.rb +21 -21
- data/lib/page-object/elements.rb +59 -59
- data/lib/page-object/elements/area.rb +31 -31
- data/lib/page-object/elements/audio.rb +9 -9
- data/lib/page-object/elements/button.rb +35 -35
- data/lib/page-object/elements/canvas.rb +23 -23
- data/lib/page-object/elements/check_box.rb +37 -37
- data/lib/page-object/elements/div.rb +19 -19
- data/lib/page-object/elements/element.rb +226 -226
- data/lib/page-object/elements/file_field.rb +38 -38
- data/lib/page-object/elements/form.rb +36 -36
- data/lib/page-object/elements/heading.rb +15 -15
- data/lib/page-object/elements/hidden_field.rb +22 -22
- data/lib/page-object/elements/image.rb +36 -36
- data/lib/page-object/elements/label.rb +36 -36
- data/lib/page-object/elements/link.rb +46 -46
- data/lib/page-object/elements/list_item.rb +19 -19
- data/lib/page-object/elements/media.rb +45 -45
- data/lib/page-object/elements/option.rb +10 -10
- data/lib/page-object/elements/ordered_list.rb +50 -50
- data/lib/page-object/elements/paragraph.rb +9 -9
- data/lib/page-object/elements/radio_button.rb +37 -37
- data/lib/page-object/elements/select_list.rb +42 -42
- data/lib/page-object/elements/span.rb +19 -19
- data/lib/page-object/elements/table.rb +68 -68
- data/lib/page-object/elements/table_cell.rb +28 -28
- data/lib/page-object/elements/table_row.rb +50 -50
- data/lib/page-object/elements/text_area.rb +38 -38
- data/lib/page-object/elements/text_field.rb +42 -42
- data/lib/page-object/elements/unordered_list.rb +51 -51
- data/lib/page-object/elements/video.rb +18 -18
- data/lib/page-object/indexed_properties.rb +36 -36
- data/lib/page-object/javascript/jquery.rb +14 -14
- data/lib/page-object/javascript/prototype.rb +14 -14
- data/lib/page-object/javascript/yui.rb +18 -18
- data/lib/page-object/javascript_framework_facade.rb +78 -78
- data/lib/page-object/loads_platform.rb +26 -26
- data/lib/page-object/locator_generator.rb +129 -129
- data/lib/page-object/nested_elements.rb +17 -17
- data/lib/page-object/page_factory.rb +108 -108
- data/lib/page-object/page_populator.rb +92 -92
- data/lib/page-object/platforms.rb +18 -18
- data/lib/page-object/platforms/selenium_webdriver.rb +17 -17
- data/lib/page-object/platforms/selenium_webdriver/button.rb +14 -14
- data/lib/page-object/platforms/selenium_webdriver/check_box.rb +29 -29
- data/lib/page-object/platforms/selenium_webdriver/element.rb +291 -291
- data/lib/page-object/platforms/selenium_webdriver/file_field.rb +16 -16
- data/lib/page-object/platforms/selenium_webdriver/form.rb +16 -16
- data/lib/page-object/platforms/selenium_webdriver/image.rb +28 -28
- data/lib/page-object/platforms/selenium_webdriver/label.rb +17 -18
- data/lib/page-object/platforms/selenium_webdriver/link.rb +23 -23
- data/lib/page-object/platforms/selenium_webdriver/ordered_list.rb +39 -39
- data/lib/page-object/platforms/selenium_webdriver/page_object.rb +1136 -1136
- data/lib/page-object/platforms/selenium_webdriver/radio_button.rb +22 -22
- data/lib/page-object/platforms/selenium_webdriver/select_list.rb +93 -93
- data/lib/page-object/platforms/selenium_webdriver/surrogate_selenium_element.rb +42 -42
- data/lib/page-object/platforms/selenium_webdriver/table.rb +42 -42
- data/lib/page-object/platforms/selenium_webdriver/table_row.rb +43 -43
- data/lib/page-object/platforms/selenium_webdriver/text_area.rb +17 -17
- data/lib/page-object/platforms/selenium_webdriver/text_field.rb +17 -17
- data/lib/page-object/platforms/selenium_webdriver/unordered_list.rb +39 -39
- data/lib/page-object/platforms/watir_webdriver.rb +18 -18
- data/lib/page-object/platforms/watir_webdriver/check_box.rb +29 -29
- data/lib/page-object/platforms/watir_webdriver/element.rb +249 -249
- data/lib/page-object/platforms/watir_webdriver/file_field.rb +16 -16
- data/lib/page-object/platforms/watir_webdriver/form.rb +16 -16
- data/lib/page-object/platforms/watir_webdriver/image.rb +22 -22
- data/lib/page-object/platforms/watir_webdriver/label.rb +17 -18
- data/lib/page-object/platforms/watir_webdriver/link.rb +15 -15
- data/lib/page-object/platforms/watir_webdriver/ordered_list.rb +35 -35
- data/lib/page-object/platforms/watir_webdriver/page_object.rb +1029 -1029
- data/lib/page-object/platforms/watir_webdriver/radio_button.rb +22 -22
- data/lib/page-object/platforms/watir_webdriver/select_list.rb +74 -74
- data/lib/page-object/platforms/watir_webdriver/table.rb +38 -38
- data/lib/page-object/platforms/watir_webdriver/table_row.rb +37 -37
- data/lib/page-object/platforms/watir_webdriver/text_area.rb +23 -23
- data/lib/page-object/platforms/watir_webdriver/text_field.rb +16 -16
- data/lib/page-object/platforms/watir_webdriver/unordered_list.rb +36 -36
- data/lib/page-object/version.rb +4 -4
- data/lib/page-object/widgets.rb +133 -133
- data/meeane-page-object.gemspec +32 -32
- data/spec/page-object/element_locators_spec.rb +1065 -1065
- data/spec/page-object/elements/area_spec.rb +45 -45
- data/spec/page-object/elements/button_spec.rb +50 -50
- data/spec/page-object/elements/canvas_spec.rb +40 -40
- data/spec/page-object/elements/check_box_spec.rb +49 -49
- data/spec/page-object/elements/div_spec.rb +28 -28
- data/spec/page-object/elements/element_spec.rb +114 -114
- data/spec/page-object/elements/file_field_spec.rb +39 -39
- data/spec/page-object/elements/form_spec.rb +28 -28
- data/spec/page-object/elements/heading_spec.rb +48 -48
- data/spec/page-object/elements/hidden_field_spec.rb +28 -28
- data/spec/page-object/elements/image_spec.rb +66 -66
- data/spec/page-object/elements/label_spec.rb +29 -29
- data/spec/page-object/elements/link_spec.rb +49 -49
- data/spec/page-object/elements/list_item_spec.rb +28 -28
- data/spec/page-object/elements/nested_element_spec.rb +254 -254
- data/spec/page-object/elements/option_spec.rb +11 -11
- data/spec/page-object/elements/ordered_list_spec.rb +94 -94
- data/spec/page-object/elements/paragraph_spec.rb +28 -28
- data/spec/page-object/elements/select_list_spec.rb +142 -142
- data/spec/page-object/elements/selenium/radio_button_spec.rb +44 -44
- data/spec/page-object/elements/selenium/text_field_spec.rb +49 -49
- data/spec/page-object/elements/selenium_element_spec.rb +172 -172
- data/spec/page-object/elements/span_spec.rb +26 -26
- data/spec/page-object/elements/table_cell_spec.rb +21 -21
- data/spec/page-object/elements/table_row_spec.rb +70 -70
- data/spec/page-object/elements/table_spec.rb +98 -98
- data/spec/page-object/elements/text_area_spec.rb +39 -39
- data/spec/page-object/elements/unordered_list_spec.rb +95 -95
- data/spec/page-object/elements/watir_element_spec.rb +142 -142
- data/spec/page-object/javascript_framework_facade_spec.rb +61 -61
- data/spec/page-object/loads_platform_spec.rb +53 -53
- data/spec/page-object/page-object_spec.rb +405 -405
- data/spec/page-object/page_factory_spec.rb +256 -256
- data/spec/page-object/page_populator_spec.rb +122 -122
- data/spec/page-object/platforms/selenium_webdriver/selenium_page_object_spec.rb +68 -68
- data/spec/page-object/platforms/selenium_webdriver_spec.rb +28 -28
- data/spec/page-object/platforms/watir_webdriver/watir_page_object_spec.rb +29 -29
- data/spec/page-object/platforms/watir_webdriver_spec.rb +9 -9
- data/spec/page-object/selenium_accessors_spec.rb +589 -589
- data/spec/page-object/watir_accessors_spec.rb +1107 -1107
- data/spec/page-object/widget_spec.rb +226 -226
- data/spec/spec_helper.rb +44 -44
- metadata +193 -43
@@ -1,53 +1,53 @@
|
|
1
|
-
class JavascriptPage
|
2
|
-
include PageObject
|
3
|
-
|
4
|
-
text_field(:expression, :id => 'calculator-expression')
|
5
|
-
text_field(:results, :id => 'calculator-result')
|
6
|
-
button(:compute, :value => 'Compute')
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
def build_url(page)
|
11
|
-
target = ENV['BROWSER']
|
12
|
-
return "http://localhost:4567/#{page}" if target.nil? or target.include? 'local'
|
13
|
-
"http://ec2-107-22-131-88.compute-1.amazonaws.com:4567/#{page}"
|
14
|
-
end
|
15
|
-
|
16
|
-
Given /^I am on jQuery example page$/ do
|
17
|
-
PageObject.javascript_framework = :jquery
|
18
|
-
@page = JavascriptPage.new(@browser)
|
19
|
-
@page.navigate_to build_url("jquery.html")
|
20
|
-
end
|
21
|
-
|
22
|
-
Given /^I am on the Prototype example page$/ do
|
23
|
-
PageObject.javascript_framework = :prototype
|
24
|
-
@page = JavascriptPage.new(@browser)
|
25
|
-
@page.navigate_to build_url('prototype.html')
|
26
|
-
end
|
27
|
-
|
28
|
-
When /^I ask to compute "([^\"]*)"$/ do |expression|
|
29
|
-
@page.expression = expression
|
30
|
-
@page.compute
|
31
|
-
end
|
32
|
-
|
33
|
-
Then /^I should be able to wait for the answer "([^\"]*)"$/ do |answer|
|
34
|
-
@page.wait_for_ajax
|
35
|
-
@page.results.should == answer
|
36
|
-
end
|
37
|
-
|
38
|
-
Given /^I execute the javascript "([^\"]*)"$/ do |script|
|
39
|
-
@answer = @page.execute_script script
|
40
|
-
end
|
41
|
-
|
42
|
-
Given /^I execute the javascript "([^\"]*)" with an argument of "([^\"]*)"$/ do |script, arg|
|
43
|
-
@answer = @page.execute_script script, arg
|
44
|
-
end
|
45
|
-
|
46
|
-
Given /^I execute the javascript "([^\"]*)" with a text field argument$/ do |script|
|
47
|
-
text_field = @page.text_field_element(:id => 'text_field_id')
|
48
|
-
@page.execute_script(script, text_field)
|
49
|
-
end
|
50
|
-
|
51
|
-
Then /^I should get the answer "([^\"]*)"$/ do |answer|
|
52
|
-
@answer.should == answer.to_i
|
1
|
+
class JavascriptPage
|
2
|
+
include PageObject
|
3
|
+
|
4
|
+
text_field(:expression, :id => 'calculator-expression')
|
5
|
+
text_field(:results, :id => 'calculator-result')
|
6
|
+
button(:compute, :value => 'Compute')
|
7
|
+
|
8
|
+
end
|
9
|
+
|
10
|
+
def build_url(page)
|
11
|
+
target = ENV['BROWSER']
|
12
|
+
return "http://localhost:4567/#{page}" if target.nil? or target.include? 'local'
|
13
|
+
"http://ec2-107-22-131-88.compute-1.amazonaws.com:4567/#{page}"
|
14
|
+
end
|
15
|
+
|
16
|
+
Given /^I am on jQuery example page$/ do
|
17
|
+
PageObject.javascript_framework = :jquery
|
18
|
+
@page = JavascriptPage.new(@browser)
|
19
|
+
@page.navigate_to build_url("jquery.html")
|
20
|
+
end
|
21
|
+
|
22
|
+
Given /^I am on the Prototype example page$/ do
|
23
|
+
PageObject.javascript_framework = :prototype
|
24
|
+
@page = JavascriptPage.new(@browser)
|
25
|
+
@page.navigate_to build_url('prototype.html')
|
26
|
+
end
|
27
|
+
|
28
|
+
When /^I ask to compute "([^\"]*)"$/ do |expression|
|
29
|
+
@page.expression = expression
|
30
|
+
@page.compute
|
31
|
+
end
|
32
|
+
|
33
|
+
Then /^I should be able to wait for the answer "([^\"]*)"$/ do |answer|
|
34
|
+
@page.wait_for_ajax
|
35
|
+
@page.results.should == answer
|
36
|
+
end
|
37
|
+
|
38
|
+
Given /^I execute the javascript "([^\"]*)"$/ do |script|
|
39
|
+
@answer = @page.execute_script script
|
40
|
+
end
|
41
|
+
|
42
|
+
Given /^I execute the javascript "([^\"]*)" with an argument of "([^\"]*)"$/ do |script, arg|
|
43
|
+
@answer = @page.execute_script script, arg
|
44
|
+
end
|
45
|
+
|
46
|
+
Given /^I execute the javascript "([^\"]*)" with a text field argument$/ do |script|
|
47
|
+
text_field = @page.text_field_element(:id => 'text_field_id')
|
48
|
+
@page.execute_script(script, text_field)
|
49
|
+
end
|
50
|
+
|
51
|
+
Then /^I should get the answer "([^\"]*)"$/ do |answer|
|
52
|
+
@answer.should == answer.to_i
|
53
53
|
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
When /^I get the text from the label$/ do
|
2
|
-
@text = @page.label_id
|
3
|
-
end
|
4
|
-
|
5
|
-
When /^I search for the label by "([^\"]*)"$/ do |how|
|
6
|
-
@text = @page.send "label_#{how}".to_sym
|
7
|
-
end
|
8
|
-
|
9
|
-
When /^I search for the label by "(.*)" and "(.*)"$/ do |param1, param2|
|
10
|
-
@text = @page.send "label_#{param1}_#{param2}".to_sym
|
11
|
-
end
|
12
|
-
|
13
|
-
When /^I get the text from a label while the script is executing$/ do
|
14
|
-
@text = @page.label_element(:id => 'label_id').text
|
15
|
-
end
|
16
|
-
|
17
|
-
Then /^I should see that the label exists$/ do
|
18
|
-
@page.label_id?.should be_true
|
19
|
-
end
|
1
|
+
When /^I get the text from the label$/ do
|
2
|
+
@text = @page.label_id
|
3
|
+
end
|
4
|
+
|
5
|
+
When /^I search for the label by "([^\"]*)"$/ do |how|
|
6
|
+
@text = @page.send "label_#{how}".to_sym
|
7
|
+
end
|
8
|
+
|
9
|
+
When /^I search for the label by "(.*)" and "(.*)"$/ do |param1, param2|
|
10
|
+
@text = @page.send "label_#{param1}_#{param2}".to_sym
|
11
|
+
end
|
12
|
+
|
13
|
+
When /^I get the text from a label while the script is executing$/ do
|
14
|
+
@text = @page.label_element(:id => 'label_id').text
|
15
|
+
end
|
16
|
+
|
17
|
+
Then /^I should see that the label exists$/ do
|
18
|
+
@page.label_id?.should be_true
|
19
|
+
end
|
@@ -1,40 +1,40 @@
|
|
1
|
-
When /^I select the link labeled "([^\"]*)"$/ do |text|
|
2
|
-
@page.google_search_id
|
3
|
-
end
|
4
|
-
|
5
|
-
When /^I search for the link by "([^\"]*)"$/ do |how|
|
6
|
-
@how = how
|
7
|
-
end
|
8
|
-
|
9
|
-
Then /^I should be able to select the link$/ do
|
10
|
-
@page.send "google_search_#{@how}".to_sym
|
11
|
-
end
|
12
|
-
|
13
|
-
When /^I select a link labeled "([^"]*)" and index "([^"]*)"$/ do |label, index|
|
14
|
-
@page.send "#{label.downcase}#{index}".to_sym
|
15
|
-
end
|
16
|
-
|
17
|
-
When /^I select a link while the script is executing$/ do
|
18
|
-
link = @page.link_element(:id => 'link_id')
|
19
|
-
link.click
|
20
|
-
end
|
21
|
-
|
22
|
-
Then(/^I should see that the link exists$/) do
|
23
|
-
@page.link_id?.should == true
|
24
|
-
end
|
25
|
-
|
26
|
-
When(/^I get the href for the link$/) do
|
27
|
-
@href = @page.google_search_id_element.href
|
28
|
-
end
|
29
|
-
|
30
|
-
Then(/^I should know it was "(.*?)"$/) do |href|
|
31
|
-
@href.should include href
|
32
|
-
end
|
33
|
-
|
34
|
-
When(/^I get the link using the href success$/) do
|
35
|
-
@link = @page.link_element(:href => /succ.*html/)
|
36
|
-
end
|
37
|
-
|
38
|
-
Then(/^I should be able to click the link$/) do
|
39
|
-
@link.click
|
40
|
-
end
|
1
|
+
When /^I select the link labeled "([^\"]*)"$/ do |text|
|
2
|
+
@page.google_search_id
|
3
|
+
end
|
4
|
+
|
5
|
+
When /^I search for the link by "([^\"]*)"$/ do |how|
|
6
|
+
@how = how
|
7
|
+
end
|
8
|
+
|
9
|
+
Then /^I should be able to select the link$/ do
|
10
|
+
@page.send "google_search_#{@how}".to_sym
|
11
|
+
end
|
12
|
+
|
13
|
+
When /^I select a link labeled "([^"]*)" and index "([^"]*)"$/ do |label, index|
|
14
|
+
@page.send "#{label.downcase}#{index}".to_sym
|
15
|
+
end
|
16
|
+
|
17
|
+
When /^I select a link while the script is executing$/ do
|
18
|
+
link = @page.link_element(:id => 'link_id')
|
19
|
+
link.click
|
20
|
+
end
|
21
|
+
|
22
|
+
Then(/^I should see that the link exists$/) do
|
23
|
+
@page.link_id?.should == true
|
24
|
+
end
|
25
|
+
|
26
|
+
When(/^I get the href for the link$/) do
|
27
|
+
@href = @page.google_search_id_element.href
|
28
|
+
end
|
29
|
+
|
30
|
+
Then(/^I should know it was "(.*?)"$/) do |href|
|
31
|
+
@href.should include href
|
32
|
+
end
|
33
|
+
|
34
|
+
When(/^I get the link using the href success$/) do
|
35
|
+
@link = @page.link_element(:href => /succ.*html/)
|
36
|
+
end
|
37
|
+
|
38
|
+
Then(/^I should be able to click the link$/) do
|
39
|
+
@link.click
|
40
|
+
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
When /^I get the text from the list item$/ do
|
2
|
-
@text = @page.li_id
|
3
|
-
end
|
4
|
-
|
5
|
-
When /^I search for the list item by "([^\"]*)"$/ do |how|
|
6
|
-
@text = @page.send "li_#{how}"
|
7
|
-
end
|
8
|
-
|
9
|
-
When /^I search for the list item by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
|
10
|
-
@text = @page.send "li_#{param1}_#{param2}"
|
11
|
-
end
|
12
|
-
|
13
|
-
When /^I search for the list item while the script is executing$/ do
|
14
|
-
@text = @page.list_item_element(:id => 'li_id').text
|
15
|
-
end
|
16
|
-
|
17
|
-
Then /^I should see that the list item exists$/ do
|
18
|
-
@page.li_id?.should == true
|
19
|
-
end
|
1
|
+
When /^I get the text from the list item$/ do
|
2
|
+
@text = @page.li_id
|
3
|
+
end
|
4
|
+
|
5
|
+
When /^I search for the list item by "([^\"]*)"$/ do |how|
|
6
|
+
@text = @page.send "li_#{how}"
|
7
|
+
end
|
8
|
+
|
9
|
+
When /^I search for the list item by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
|
10
|
+
@text = @page.send "li_#{param1}_#{param2}"
|
11
|
+
end
|
12
|
+
|
13
|
+
When /^I search for the list item while the script is executing$/ do
|
14
|
+
@text = @page.list_item_element(:id => 'li_id').text
|
15
|
+
end
|
16
|
+
|
17
|
+
Then /^I should see that the list item exists$/ do
|
18
|
+
@page.li_id?.should == true
|
19
|
+
end
|
@@ -1,62 +1,62 @@
|
|
1
|
-
class ModalPage
|
2
|
-
include PageObject
|
3
|
-
|
4
|
-
button(:launch_modal, :id => 'launch_modal_button')
|
5
|
-
end
|
6
|
-
|
7
|
-
class ModalDialog
|
8
|
-
include PageObject
|
9
|
-
|
10
|
-
button(:close_window, :id => 'close_window')
|
11
|
-
button(:close_window_with_delay, :id => 'delayed_close')
|
12
|
-
button(:launch_another_modal, :id => 'launch_modal_button')
|
13
|
-
end
|
14
|
-
|
15
|
-
class AnotherModalDialog
|
16
|
-
include PageObject
|
17
|
-
|
18
|
-
button(:close_window, :id => 'close_window2')
|
19
|
-
button(:close_window_with_delay, :id => 'delayed_close2')
|
20
|
-
end
|
21
|
-
|
22
|
-
|
23
|
-
Given /^I am on the modal page$/ do
|
24
|
-
ModalPage.new(@browser).navigate_to(UrlHelper.modal)
|
25
|
-
end
|
26
|
-
|
27
|
-
When /^I open a modal dialog$/ do
|
28
|
-
page = ModalPage.new(@browser)
|
29
|
-
page.modal_dialog do
|
30
|
-
page.launch_modal
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
Then /^I should be able to close the modal$/ do
|
35
|
-
dialog = ModalDialog.new(@browser)
|
36
|
-
dialog.attach_to_window(:title => 'Modal 1') do
|
37
|
-
dialog.close_window
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
When /^I open another modal dialog from that one$/ do
|
42
|
-
dialog = ModalDialog.new(@browser)
|
43
|
-
dialog.attach_to_window(:title => 'Modal 1') #do
|
44
|
-
dialog.modal_dialog #do
|
45
|
-
# dialog.launch_another_modal
|
46
|
-
# end
|
47
|
-
dialog.launch_another_modal
|
48
|
-
# end
|
49
|
-
end
|
50
|
-
|
51
|
-
Then /^I should be able to close both modals$/ do
|
52
|
-
pending
|
53
|
-
# another = AnotherModalDialog.new(@browser)
|
54
|
-
# another.attach_to_window(:title => 'Modal 2') do
|
55
|
-
# another.close_window
|
56
|
-
# end
|
57
|
-
|
58
|
-
# dialog = ModalDialog.new(@browser)
|
59
|
-
# dialog.attach_to_window(:title => 'Modal 1') do
|
60
|
-
# dialog.close_window
|
61
|
-
# end
|
62
|
-
end
|
1
|
+
class ModalPage
|
2
|
+
include PageObject
|
3
|
+
|
4
|
+
button(:launch_modal, :id => 'launch_modal_button')
|
5
|
+
end
|
6
|
+
|
7
|
+
class ModalDialog
|
8
|
+
include PageObject
|
9
|
+
|
10
|
+
button(:close_window, :id => 'close_window')
|
11
|
+
button(:close_window_with_delay, :id => 'delayed_close')
|
12
|
+
button(:launch_another_modal, :id => 'launch_modal_button')
|
13
|
+
end
|
14
|
+
|
15
|
+
class AnotherModalDialog
|
16
|
+
include PageObject
|
17
|
+
|
18
|
+
button(:close_window, :id => 'close_window2')
|
19
|
+
button(:close_window_with_delay, :id => 'delayed_close2')
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
Given /^I am on the modal page$/ do
|
24
|
+
ModalPage.new(@browser).navigate_to(UrlHelper.modal)
|
25
|
+
end
|
26
|
+
|
27
|
+
When /^I open a modal dialog$/ do
|
28
|
+
page = ModalPage.new(@browser)
|
29
|
+
page.modal_dialog do
|
30
|
+
page.launch_modal
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
Then /^I should be able to close the modal$/ do
|
35
|
+
dialog = ModalDialog.new(@browser)
|
36
|
+
dialog.attach_to_window(:title => 'Modal 1') do
|
37
|
+
dialog.close_window
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
When /^I open another modal dialog from that one$/ do
|
42
|
+
dialog = ModalDialog.new(@browser)
|
43
|
+
dialog.attach_to_window(:title => 'Modal 1') #do
|
44
|
+
dialog.modal_dialog #do
|
45
|
+
# dialog.launch_another_modal
|
46
|
+
# end
|
47
|
+
dialog.launch_another_modal
|
48
|
+
# end
|
49
|
+
end
|
50
|
+
|
51
|
+
Then /^I should be able to close both modals$/ do
|
52
|
+
pending
|
53
|
+
# another = AnotherModalDialog.new(@browser)
|
54
|
+
# another.attach_to_window(:title => 'Modal 2') do
|
55
|
+
# another.close_window
|
56
|
+
# end
|
57
|
+
|
58
|
+
# dialog = ModalDialog.new(@browser)
|
59
|
+
# dialog.attach_to_window(:title => 'Modal 1') do
|
60
|
+
# dialog.close_window
|
61
|
+
# end
|
62
|
+
end
|
@@ -1,528 +1,528 @@
|
|
1
|
-
class MultiElementsPage
|
2
|
-
include PageObject
|
3
|
-
|
4
|
-
divs(:the_divs, :class => 'div')
|
5
|
-
divs(:block_divs) do |page|
|
6
|
-
page.div_elements(:class => 'div')
|
7
|
-
end
|
8
|
-
buttons(:the_buttons, :class => 'button')
|
9
|
-
text_fields(:the_text_fields, :class => 'textfield')
|
10
|
-
hidden_fields(:the_hidden_fields, :class => 'hiddenfield')
|
11
|
-
text_areas(:the_text_areas, :class => 'textarea')
|
12
|
-
select_lists(:the_select_lists, :class => 'selectlist')
|
13
|
-
links(:the_links, :class => 'link')
|
14
|
-
checkboxes(:the_checkboxes, :class => 'checkbox')
|
15
|
-
radio_buttons(:the_radio_buttons, :class => 'radio')
|
16
|
-
spans(:the_spans, :class => 'span')
|
17
|
-
tables(:the_tables, :class => 'table')
|
18
|
-
cells(:the_cells, :class => 'td')
|
19
|
-
images(:the_images, :class => 'image')
|
20
|
-
forms(:the_forms, :class => 'form')
|
21
|
-
list_items(:the_list_items, :class => 'li')
|
22
|
-
unordered_lists(:the_unordered_lists, :class => 'ul')
|
23
|
-
ordered_lists(:the_ordered_lists, :class => 'ol')
|
24
|
-
h1s(:the_h1s, :class => 'h1')
|
25
|
-
h2s(:the_h2s, :class => 'h2')
|
26
|
-
h3s(:the_h3s, :class => 'h3')
|
27
|
-
h4s(:the_h4s, :class => 'h4')
|
28
|
-
h5s(:the_h5s, :class => 'h5')
|
29
|
-
h6s(:the_h6s, :class => 'h6')
|
30
|
-
paragraphs(:the_paragraphs, :class => 'p')
|
31
|
-
labels(:the_labels, :class => 'label')
|
32
|
-
file_fields(:the_file_fields, :class => 'file_field_class')
|
33
|
-
elements(:generic_label, :label, :class => 'label')
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
Given /^I am on the multi elements page$/ do
|
38
|
-
@page = MultiElementsPage.new(@browser)
|
39
|
-
@page.navigate_to(UrlHelper.multi)
|
40
|
-
end
|
41
|
-
|
42
|
-
When /^I select the buttons with class "([^\"]*)"$/ do |class_name|
|
43
|
-
@elements = @page.button_elements(:class => class_name)
|
44
|
-
end
|
45
|
-
|
46
|
-
Then /^I should have (\d+) buttons$/ do |num_buttons|
|
47
|
-
@elements.size.should == num_buttons.to_i
|
48
|
-
end
|
49
|
-
|
50
|
-
Then /^the value of button (\d+) should be "([^\"]*)"$/ do |button_num, value|
|
51
|
-
@elements[button_num.to_i - 1].value.should == value
|
52
|
-
end
|
53
|
-
|
54
|
-
When /^I select the text fields with class "([^\"]*)"$/ do |class_name|
|
55
|
-
@elements = @page.text_field_elements(:class => class_name)
|
56
|
-
end
|
57
|
-
|
58
|
-
Then /^I should have (\d+) text fields$/ do |num_text_fields|
|
59
|
-
@elements.size.should == num_text_fields.to_i
|
60
|
-
end
|
61
|
-
|
62
|
-
Then /^the value of text field (\d+) should be "([^\"]*)"$/ do |text_field_num, value|
|
63
|
-
@elements[text_field_num.to_i - 1].value.should == value
|
64
|
-
end
|
65
|
-
|
66
|
-
When /^I select the hidden fields with class "([^\"]*)"$/ do |class_name|
|
67
|
-
@elements = @page.hidden_field_elements(:class => class_name)
|
68
|
-
end
|
69
|
-
|
70
|
-
Then /^I should have (\d+) hidden fields$/ do |num_hidden_fields|
|
71
|
-
@elements.size.should == num_hidden_fields.to_i
|
72
|
-
end
|
73
|
-
|
74
|
-
Then /^the value of hidden field (\d+) should be "([^\"]*)"$/ do |hidden_field_num, value|
|
75
|
-
@elements[hidden_field_num.to_i - 1].value.should == value
|
76
|
-
end
|
77
|
-
|
78
|
-
When /^I select the text areas with class "([^\"]*)"$/ do |class_name|
|
79
|
-
@elements = @page.text_area_elements(:class => class_name)
|
80
|
-
end
|
81
|
-
|
82
|
-
Then /^I should have (\d+) text areas$/ do |num_text_areas|
|
83
|
-
@elements.size.should == num_text_areas.to_i
|
84
|
-
end
|
85
|
-
|
86
|
-
Then /^the value of text area (\d+) should be "([^\"]*)"$/ do |text_area_num, value|
|
87
|
-
@elements[text_area_num.to_i - 1].value.should == value
|
88
|
-
end
|
89
|
-
|
90
|
-
When /^I select the select lists with class "([^\"]*)"$/ do |class_name|
|
91
|
-
@elements = @page.select_list_elements(:class => class_name)
|
92
|
-
end
|
93
|
-
|
94
|
-
Then /^I should have (\d+) select lists$/ do |num_select_lists|
|
95
|
-
@elements.size.should == num_select_lists.to_i
|
96
|
-
end
|
97
|
-
|
98
|
-
Then /^the value of select list (\d+) should be "([^\"]*)"$/ do |select_list_num, value|
|
99
|
-
@elements[select_list_num.to_i - 1].value.should == value
|
100
|
-
end
|
101
|
-
|
102
|
-
When /^I select the link with class "([^\"]*)"$/ do |link_class|
|
103
|
-
@elements = @page.link_elements(:class => link_class)
|
104
|
-
end
|
105
|
-
|
106
|
-
Then /^I should have (\d+) links$/ do |num_links|
|
107
|
-
@elements.size.should == num_links.to_i
|
108
|
-
end
|
109
|
-
|
110
|
-
Then /^the text of link (\d+) should be "([^\"]*)"$/ do |link_num, text|
|
111
|
-
@elements[link_num.to_i - 1].text.should == text
|
112
|
-
end
|
113
|
-
|
114
|
-
When /^I select the check boxes with class "([^\"]*)"$/ do |class_name|
|
115
|
-
@elements = @page.checkbox_elements(:class => class_name)
|
116
|
-
end
|
117
|
-
|
118
|
-
Then /^I should have (\d+) checkboxes$/ do |num_checkboxes|
|
119
|
-
@elements.size.should == num_checkboxes.to_i
|
120
|
-
end
|
121
|
-
|
122
|
-
Then /^the value of checkbox (\d+) should be "([^\"]*)"$/ do |checkbox_num, value|
|
123
|
-
@elements[checkbox_num.to_i - 1].value.should == value
|
124
|
-
end
|
125
|
-
|
126
|
-
When /^I select the radio button with class "([^\"]*)"$/ do |class_name|
|
127
|
-
@elements = @page.radio_button_elements(:class => class_name)
|
128
|
-
end
|
129
|
-
|
130
|
-
Then /^I should have (\d+) radio buttons$/ do |num_radio_buttons|
|
131
|
-
@elements.size.should == num_radio_buttons.to_i
|
132
|
-
end
|
133
|
-
|
134
|
-
Then /^the value of radio button (\d+) should be "([^\"]*)"$/ do |radio_button_num, value|
|
135
|
-
@elements[radio_button_num.to_i - 1].value.should == value
|
136
|
-
end
|
137
|
-
|
138
|
-
When /^I select the div with class "([^\"]*)"$/ do |class_name|
|
139
|
-
@elements = @page.div_elements(:class => class_name)
|
140
|
-
end
|
141
|
-
|
142
|
-
Then /^I should have (\d+) divs$/ do |num_divs|
|
143
|
-
@elements.size.should == num_divs.to_i
|
144
|
-
end
|
145
|
-
|
146
|
-
Then /^the text of div (\d+) should be "([^\"]*)"$/ do |div_num, text|
|
147
|
-
@elements[div_num.to_i - 1].text.should == text
|
148
|
-
end
|
149
|
-
|
150
|
-
When /^I select the spans with class "([^\"]*)"$/ do |class_name|
|
151
|
-
@elements = @page.span_elements(:class => class_name)
|
152
|
-
end
|
153
|
-
|
154
|
-
Then /^I should have (\d+) spans$/ do |num_spans|
|
155
|
-
@elements.size.should == num_spans.to_i
|
156
|
-
end
|
157
|
-
|
158
|
-
Then /^the text of span (\d+) should be "([^\"]*)"$/ do |span_num, text|
|
159
|
-
@elements[span_num.to_i - 1].text.should == text
|
160
|
-
end
|
161
|
-
|
162
|
-
When /^I select the tables with class "([^\"]*)"$/ do |class_name|
|
163
|
-
@elements = @page.table_elements(:class => class_name)
|
164
|
-
end
|
165
|
-
|
166
|
-
Then /^I should have (\d+) tables$/ do |num_tables|
|
167
|
-
@elements.size.should == num_tables.to_i
|
168
|
-
end
|
169
|
-
|
170
|
-
Then /^the first row first column for table (\d+) should have "([^\"]*)"$/ do |table_num, text|
|
171
|
-
@elements[table_num.to_i - 1][0][0].text.should == text
|
172
|
-
end
|
173
|
-
|
174
|
-
When /^I select the cells with class "([^\"]*)"$/ do |cell_class|
|
175
|
-
@elements = @page.cell_elements(:class => cell_class)
|
176
|
-
end
|
177
|
-
|
178
|
-
Then /^I should have (\d+) cells$/ do |num_cells|
|
179
|
-
@elements.size.should == num_cells.to_i
|
180
|
-
end
|
181
|
-
|
182
|
-
Then /^the text for cell (\d+) should be "([^\"]*)"$/ do |cell_num, text|
|
183
|
-
@elements[cell_num.to_i - 1].text.should == text
|
184
|
-
end
|
185
|
-
|
186
|
-
When /^I select the images with class "([^\"]*)"$/ do |class_name|
|
187
|
-
@elements = @page.image_elements(:class => class_name)
|
188
|
-
end
|
189
|
-
|
190
|
-
Then /^I should have (\d+) images$/ do |num_images|
|
191
|
-
@elements.size.should == num_images.to_i
|
192
|
-
end
|
193
|
-
|
194
|
-
Then /^the alt for image (\d+) should be "([^\"]*)"$/ do |image_num, alt|
|
195
|
-
@elements[image_num.to_i - 1].attribute(:alt).should == alt
|
196
|
-
end
|
197
|
-
|
198
|
-
When /^I select the forms with class "([^\"]*)"$/ do |class_name|
|
199
|
-
@elements = @page.form_elements(:class => class_name)
|
200
|
-
end
|
201
|
-
|
202
|
-
Then /^I should have (\d+) forms$/ do |number|
|
203
|
-
@elements.size.should == number.to_i
|
204
|
-
end
|
205
|
-
|
206
|
-
Then /^the action for form (\d+) should be "([^\"]*)"$/ do |form_number, action|
|
207
|
-
@elements[form_number.to_i-1].attribute(:action).should match action
|
208
|
-
end
|
209
|
-
|
210
|
-
When /^I select the list items with class "([^\"]*)"$/ do |class_name|
|
211
|
-
@elements = @page.list_item_elements(:class => class_name)
|
212
|
-
end
|
213
|
-
|
214
|
-
Then /^I should have (\d+) list items$/ do |num_list_items|
|
215
|
-
@elements.size.should == num_list_items.to_i
|
216
|
-
end
|
217
|
-
|
218
|
-
Then /^the text for list item (\d+) should be "([^\"]*)"$/ do |list_item_num, text|
|
219
|
-
@elements[list_item_num.to_i - 1].text.should == text
|
220
|
-
end
|
221
|
-
|
222
|
-
When /^I select the unordered list with class "([^\"]*)"$/ do |class_name|
|
223
|
-
@elements = @page.unordered_list_elements(:class => class_name)
|
224
|
-
end
|
225
|
-
|
226
|
-
Then /^I should have (\d+) unordered lists$/ do |num_unordered_lists|
|
227
|
-
@elements.size.should == num_unordered_lists.to_i
|
228
|
-
end
|
229
|
-
|
230
|
-
Then /^the text for the first item in unordered list (\d+) should be "([^\"]*)"$/ do |ul_num, text|
|
231
|
-
@elements[ul_num.to_i - 1][0].text.should == text
|
232
|
-
end
|
233
|
-
|
234
|
-
When /^I select the ordered lists with class "([^\"]*)"$/ do |class_name|
|
235
|
-
@elements = @page.ordered_list_elements(:class => class_name)
|
236
|
-
end
|
237
|
-
|
238
|
-
Then /^I should have (\d+) ordered lists$/ do |num_ol|
|
239
|
-
@elements.size.should == num_ol.to_i
|
240
|
-
end
|
241
|
-
|
242
|
-
Then /^the text for the first item in ordered list (\d+) should be "([^\"]*)"$/ do |ol_num, text|
|
243
|
-
@elements[ol_num.to_i - 1][0].text.should == text
|
244
|
-
end
|
245
|
-
|
246
|
-
When /^I select the h1s with class "([^\"]*)"$/ do |class_name|
|
247
|
-
@elements = @page.h1_elements(:class => class_name)
|
248
|
-
end
|
249
|
-
|
250
|
-
Then /^I should have (\d+) h1s$/ do |num_h1s|
|
251
|
-
@elements.size.should == num_h1s.to_i
|
252
|
-
end
|
253
|
-
|
254
|
-
Then /^the text for h1 (\d+) should be "([^\"]*)"$/ do |h1_num, text|
|
255
|
-
@elements[h1_num.to_i - 1].text.should == text
|
256
|
-
end
|
257
|
-
|
258
|
-
When /^I select the h2s with the class "([^\"]*)"$/ do |class_name|
|
259
|
-
@elements = @page.h2_elements(:class => class_name)
|
260
|
-
end
|
261
|
-
|
262
|
-
Then /^I should have (\d+) h2s$/ do |num_h2s|
|
263
|
-
@elements.size.should == num_h2s.to_i
|
264
|
-
end
|
265
|
-
|
266
|
-
Then /^the text for h2 (\d+) should be "([^\"]*)"$/ do |h2_num, text|
|
267
|
-
@elements[h2_num.to_i - 1].text.should == text
|
268
|
-
end
|
269
|
-
|
270
|
-
When /^I select the h3s with the class "([^\"]*)"$/ do |class_name|
|
271
|
-
@elements = @page.h3_elements(:class => class_name)
|
272
|
-
end
|
273
|
-
|
274
|
-
Then /^I should have (\d+) h3s$/ do |num_h3s|
|
275
|
-
@elements.size.should == num_h3s.to_i
|
276
|
-
end
|
277
|
-
|
278
|
-
Then /^the text for h3 (\d+) should be "([^\"]*)"$/ do |h3_num, text|
|
279
|
-
@elements[h3_num.to_i - 1].text.should == text
|
280
|
-
end
|
281
|
-
|
282
|
-
When /^I select the h4s with the class "([^\"]*)"$/ do |class_name|
|
283
|
-
@elements = @page.h4_elements(:class => class_name)
|
284
|
-
end
|
285
|
-
|
286
|
-
Then /^I should have (\d+) h4s$/ do |num_h4s|
|
287
|
-
@elements.size.should == num_h4s.to_i
|
288
|
-
end
|
289
|
-
|
290
|
-
Then /^the text for H4 (\d+) should be "([^\"]*)"$/ do |h4_num, text|
|
291
|
-
@elements[h4_num.to_i - 1].text.should == text
|
292
|
-
end
|
293
|
-
|
294
|
-
When /^I select the h5s with the class "([^\"]*)"$/ do |class_name|
|
295
|
-
@elements = @page.h5_elements(:class => class_name)
|
296
|
-
end
|
297
|
-
|
298
|
-
Then /^I should have (\d+) h5s$/ do |num_h5s|
|
299
|
-
@elements.size.should == num_h5s.to_i
|
300
|
-
end
|
301
|
-
|
302
|
-
Then /^the text for H5 (\d+) should be "([^\"]*)"$/ do |h5_num, text|
|
303
|
-
@elements[h5_num.to_i - 1].text.should == text
|
304
|
-
end
|
305
|
-
|
306
|
-
When /^I select the h6s with the class "([^\"]*)"$/ do |class_name|
|
307
|
-
@elements = @page.h6_elements(:class => class_name)
|
308
|
-
end
|
309
|
-
|
310
|
-
Then /^I should have (\d+) h6s$/ do |num_h6s|
|
311
|
-
@elements.size.should == num_h6s.to_i
|
312
|
-
end
|
313
|
-
|
314
|
-
Then /^the text for H6 (\d+) should be "([^\"]*)"$/ do |h6_num, text|
|
315
|
-
@elements[h6_num.to_i - 1].text.should == text
|
316
|
-
end
|
317
|
-
|
318
|
-
When /^I select the paragraph with class "([^\"]*)"$/ do |class_name|
|
319
|
-
@elements = @page.paragraph_elements(:class => class_name)
|
320
|
-
end
|
321
|
-
|
322
|
-
Then /^I should have (\d+) paragraphs$/ do |num_paragraphs|
|
323
|
-
@elements.size.should == num_paragraphs.to_i
|
324
|
-
end
|
325
|
-
|
326
|
-
Then /^the text for paragraph (\d+) should be "([^\"]*)"$/ do |para_num, text|
|
327
|
-
@elements[para_num.to_i - 1].text.should == text
|
328
|
-
end
|
329
|
-
|
330
|
-
When /^I select all buttons using no identifier$/ do
|
331
|
-
@elements = @page.button_elements
|
332
|
-
end
|
333
|
-
|
334
|
-
When /^I select all text fields using no identifier$/ do
|
335
|
-
@elements = @page.text_field_elements
|
336
|
-
end
|
337
|
-
|
338
|
-
When /^I select all hidden fields using no identifier$/ do
|
339
|
-
@elements = @page.hidden_field_elements
|
340
|
-
end
|
341
|
-
|
342
|
-
When /^I select text areas using no identifier$/ do
|
343
|
-
@elements = @page.text_area_elements
|
344
|
-
end
|
345
|
-
|
346
|
-
When /^I select select lists using no identifier$/ do
|
347
|
-
@elements = @page.select_list_elements
|
348
|
-
end
|
349
|
-
|
350
|
-
When /^I select links using no identifier$/ do
|
351
|
-
@elements = @page.link_elements
|
352
|
-
end
|
353
|
-
|
354
|
-
When /^I select checboxes using no identifier$/ do
|
355
|
-
@elements = @page.checkbox_elements
|
356
|
-
end
|
357
|
-
|
358
|
-
When /^I select radio buttons using no identifier$/ do
|
359
|
-
@elements = @page.radio_button_elements
|
360
|
-
end
|
361
|
-
|
362
|
-
When /^I select divs using no identifier$/ do
|
363
|
-
@elements = @page.div_elements
|
364
|
-
end
|
365
|
-
|
366
|
-
When /^I select spans using no identifier$/ do
|
367
|
-
@elements = @page.span_elements
|
368
|
-
end
|
369
|
-
|
370
|
-
When /^I select tables using no identifier$/ do
|
371
|
-
@elements = @page.table_elements
|
372
|
-
end
|
373
|
-
|
374
|
-
When /^I select the cells using no identifier$/ do
|
375
|
-
@elements = @page.cell_elements
|
376
|
-
end
|
377
|
-
|
378
|
-
When /^I select the images using no identifier$/ do
|
379
|
-
@elements = @page.image_elements
|
380
|
-
end
|
381
|
-
|
382
|
-
When /^I select the forms using no identifier$/ do
|
383
|
-
@elements = @page.form_elements
|
384
|
-
end
|
385
|
-
|
386
|
-
When /^I select the list items using no identifier$/ do
|
387
|
-
@elements = @page.list_item_elements
|
388
|
-
end
|
389
|
-
|
390
|
-
When /^I select the unordered list using no parameter$/ do
|
391
|
-
@elements = @page.unordered_list_elements
|
392
|
-
end
|
393
|
-
|
394
|
-
When /^I select the ordered lists using no identifier$/ do
|
395
|
-
@elements = @page.ordered_list_elements
|
396
|
-
end
|
397
|
-
|
398
|
-
When /^I select h(\d+)s using no identifier$/ do |num|
|
399
|
-
@elements = @page.send "h#{num}_elements"
|
400
|
-
end
|
401
|
-
|
402
|
-
When /^I select paragraphs using no identifier$/ do
|
403
|
-
@elements = @page.paragraph_elements
|
404
|
-
end
|
405
|
-
|
406
|
-
When /^I select the labels with class "([^\"]*)"$/ do |class_name|
|
407
|
-
@elements = @page.label_elements(:class => class_name)
|
408
|
-
end
|
409
|
-
|
410
|
-
Then /^I should have (\d+) labels$/ do |num_labels|
|
411
|
-
@elements.size.should == num_labels.to_i
|
412
|
-
end
|
413
|
-
|
414
|
-
Then /^the text for label (\d+) should be "([^\"]*)"$/ do |label_num, text|
|
415
|
-
@elements[label_num.to_i - 1].text.should == text
|
416
|
-
end
|
417
|
-
|
418
|
-
When /^I select labels using no identifier$/ do
|
419
|
-
@elements = @page.label_elements
|
420
|
-
end
|
421
|
-
|
422
|
-
When /^I select the file fields with class "([^\"]*)"$/ do |class_name|
|
423
|
-
@elements = @page.file_field_elements(:class => class_name)
|
424
|
-
end
|
425
|
-
|
426
|
-
Then /^I should have (\d+) file fields$/ do |num_file_fields|
|
427
|
-
@elements.size.should == num_file_fields.to_i
|
428
|
-
end
|
429
|
-
|
430
|
-
Then /^the title for file field (\d+) should be "([^\"]*)"$/ do |file_field_num, title|
|
431
|
-
@elements[file_field_num.to_i - 1].attribute('title').should == title
|
432
|
-
end
|
433
|
-
|
434
|
-
When /^I select the file fields using no identifier$/ do
|
435
|
-
@elements = @page.file_field_elements
|
436
|
-
end
|
437
|
-
|
438
|
-
When /^I select the divs using the generated method$/ do
|
439
|
-
@elements = @page.the_divs_elements
|
440
|
-
end
|
441
|
-
|
442
|
-
When /^I select the buttons using the generated method$/ do
|
443
|
-
@elements = @page.the_buttons_elements
|
444
|
-
end
|
445
|
-
|
446
|
-
When /^I select the text fields using the generated method$/ do
|
447
|
-
@elements = @page.the_text_fields_elements
|
448
|
-
end
|
449
|
-
|
450
|
-
When /^I select the hidden fields using the generated method$/ do
|
451
|
-
@elements = @page.the_hidden_fields_elements
|
452
|
-
end
|
453
|
-
|
454
|
-
When /^I select the text areas using the generated method$/ do
|
455
|
-
@elements = @page.the_text_areas_elements
|
456
|
-
end
|
457
|
-
|
458
|
-
When /^I select the select lists using the generated method$/ do
|
459
|
-
@elements = @page.the_select_lists_elements
|
460
|
-
end
|
461
|
-
|
462
|
-
When /^I select the link using the generated method$/ do
|
463
|
-
@elements = @page.the_links_elements
|
464
|
-
end
|
465
|
-
|
466
|
-
When /^I select the check boxes using the generated method$/ do
|
467
|
-
@elements = @page.the_checkboxes_elements
|
468
|
-
end
|
469
|
-
|
470
|
-
When /^I select the radio button using the generated method$/ do
|
471
|
-
@elements = @page.the_radio_buttons_elements
|
472
|
-
end
|
473
|
-
|
474
|
-
When /^I select the spans using the generated method$/ do
|
475
|
-
@elements = @page.the_spans_elements
|
476
|
-
end
|
477
|
-
|
478
|
-
When /^I select the tables using the generated method$/ do
|
479
|
-
@elements = @page.the_tables_elements
|
480
|
-
end
|
481
|
-
|
482
|
-
When /^I select the cells using the generated method$/ do
|
483
|
-
@elements = @page.the_cells_elements
|
484
|
-
end
|
485
|
-
|
486
|
-
When /^I select the images using the generated method$/ do
|
487
|
-
@elements = @page.the_images_elements
|
488
|
-
end
|
489
|
-
|
490
|
-
When /^I select the forms using the generated method$/ do
|
491
|
-
@elements = @page.the_forms_elements
|
492
|
-
end
|
493
|
-
|
494
|
-
When /^I select the list items using the generated method$/ do
|
495
|
-
@elements = @page.the_list_items_elements
|
496
|
-
end
|
497
|
-
|
498
|
-
When /^I select the unordered list using the generated method$/ do
|
499
|
-
@elements = @page.the_unordered_lists_elements
|
500
|
-
end
|
501
|
-
|
502
|
-
When /^I select the ordered lists using the generated method$/ do
|
503
|
-
@elements = @page.the_ordered_lists_elements
|
504
|
-
end
|
505
|
-
|
506
|
-
When /^I select the h(\d+)s using the generated method$/ do |num|
|
507
|
-
@elements = @page.send "the_h#{num.to_i}s_elements"
|
508
|
-
end
|
509
|
-
|
510
|
-
When /^I select the paragraph using the generated method$/ do
|
511
|
-
@elements = @page.the_paragraphs_elements
|
512
|
-
end
|
513
|
-
|
514
|
-
When /^I select the labels using the generated method$/ do
|
515
|
-
@elements = @page.the_labels_elements
|
516
|
-
end
|
517
|
-
|
518
|
-
When /^I select the file fields using the generated method$/ do
|
519
|
-
@elements = @page.the_file_fields_elements
|
520
|
-
end
|
521
|
-
|
522
|
-
When /^I select the divs using a block$/ do
|
523
|
-
@elements = @page.block_divs_elements
|
524
|
-
end
|
525
|
-
|
526
|
-
When(/^I select the multiple elements with a tag label$/) do
|
527
|
-
@elements = @page.generic_label_elements
|
528
|
-
end
|
1
|
+
class MultiElementsPage
|
2
|
+
include PageObject
|
3
|
+
|
4
|
+
divs(:the_divs, :class => 'div')
|
5
|
+
divs(:block_divs) do |page|
|
6
|
+
page.div_elements(:class => 'div')
|
7
|
+
end
|
8
|
+
buttons(:the_buttons, :class => 'button')
|
9
|
+
text_fields(:the_text_fields, :class => 'textfield')
|
10
|
+
hidden_fields(:the_hidden_fields, :class => 'hiddenfield')
|
11
|
+
text_areas(:the_text_areas, :class => 'textarea')
|
12
|
+
select_lists(:the_select_lists, :class => 'selectlist')
|
13
|
+
links(:the_links, :class => 'link')
|
14
|
+
checkboxes(:the_checkboxes, :class => 'checkbox')
|
15
|
+
radio_buttons(:the_radio_buttons, :class => 'radio')
|
16
|
+
spans(:the_spans, :class => 'span')
|
17
|
+
tables(:the_tables, :class => 'table')
|
18
|
+
cells(:the_cells, :class => 'td')
|
19
|
+
images(:the_images, :class => 'image')
|
20
|
+
forms(:the_forms, :class => 'form')
|
21
|
+
list_items(:the_list_items, :class => 'li')
|
22
|
+
unordered_lists(:the_unordered_lists, :class => 'ul')
|
23
|
+
ordered_lists(:the_ordered_lists, :class => 'ol')
|
24
|
+
h1s(:the_h1s, :class => 'h1')
|
25
|
+
h2s(:the_h2s, :class => 'h2')
|
26
|
+
h3s(:the_h3s, :class => 'h3')
|
27
|
+
h4s(:the_h4s, :class => 'h4')
|
28
|
+
h5s(:the_h5s, :class => 'h5')
|
29
|
+
h6s(:the_h6s, :class => 'h6')
|
30
|
+
paragraphs(:the_paragraphs, :class => 'p')
|
31
|
+
labels(:the_labels, :class => 'label')
|
32
|
+
file_fields(:the_file_fields, :class => 'file_field_class')
|
33
|
+
elements(:generic_label, :label, :class => 'label')
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
Given /^I am on the multi elements page$/ do
|
38
|
+
@page = MultiElementsPage.new(@browser)
|
39
|
+
@page.navigate_to(UrlHelper.multi)
|
40
|
+
end
|
41
|
+
|
42
|
+
When /^I select the buttons with class "([^\"]*)"$/ do |class_name|
|
43
|
+
@elements = @page.button_elements(:class => class_name)
|
44
|
+
end
|
45
|
+
|
46
|
+
Then /^I should have (\d+) buttons$/ do |num_buttons|
|
47
|
+
@elements.size.should == num_buttons.to_i
|
48
|
+
end
|
49
|
+
|
50
|
+
Then /^the value of button (\d+) should be "([^\"]*)"$/ do |button_num, value|
|
51
|
+
@elements[button_num.to_i - 1].value.should == value
|
52
|
+
end
|
53
|
+
|
54
|
+
When /^I select the text fields with class "([^\"]*)"$/ do |class_name|
|
55
|
+
@elements = @page.text_field_elements(:class => class_name)
|
56
|
+
end
|
57
|
+
|
58
|
+
Then /^I should have (\d+) text fields$/ do |num_text_fields|
|
59
|
+
@elements.size.should == num_text_fields.to_i
|
60
|
+
end
|
61
|
+
|
62
|
+
Then /^the value of text field (\d+) should be "([^\"]*)"$/ do |text_field_num, value|
|
63
|
+
@elements[text_field_num.to_i - 1].value.should == value
|
64
|
+
end
|
65
|
+
|
66
|
+
When /^I select the hidden fields with class "([^\"]*)"$/ do |class_name|
|
67
|
+
@elements = @page.hidden_field_elements(:class => class_name)
|
68
|
+
end
|
69
|
+
|
70
|
+
Then /^I should have (\d+) hidden fields$/ do |num_hidden_fields|
|
71
|
+
@elements.size.should == num_hidden_fields.to_i
|
72
|
+
end
|
73
|
+
|
74
|
+
Then /^the value of hidden field (\d+) should be "([^\"]*)"$/ do |hidden_field_num, value|
|
75
|
+
@elements[hidden_field_num.to_i - 1].value.should == value
|
76
|
+
end
|
77
|
+
|
78
|
+
When /^I select the text areas with class "([^\"]*)"$/ do |class_name|
|
79
|
+
@elements = @page.text_area_elements(:class => class_name)
|
80
|
+
end
|
81
|
+
|
82
|
+
Then /^I should have (\d+) text areas$/ do |num_text_areas|
|
83
|
+
@elements.size.should == num_text_areas.to_i
|
84
|
+
end
|
85
|
+
|
86
|
+
Then /^the value of text area (\d+) should be "([^\"]*)"$/ do |text_area_num, value|
|
87
|
+
@elements[text_area_num.to_i - 1].value.should == value
|
88
|
+
end
|
89
|
+
|
90
|
+
When /^I select the select lists with class "([^\"]*)"$/ do |class_name|
|
91
|
+
@elements = @page.select_list_elements(:class => class_name)
|
92
|
+
end
|
93
|
+
|
94
|
+
Then /^I should have (\d+) select lists$/ do |num_select_lists|
|
95
|
+
@elements.size.should == num_select_lists.to_i
|
96
|
+
end
|
97
|
+
|
98
|
+
Then /^the value of select list (\d+) should be "([^\"]*)"$/ do |select_list_num, value|
|
99
|
+
@elements[select_list_num.to_i - 1].value.should == value
|
100
|
+
end
|
101
|
+
|
102
|
+
When /^I select the link with class "([^\"]*)"$/ do |link_class|
|
103
|
+
@elements = @page.link_elements(:class => link_class)
|
104
|
+
end
|
105
|
+
|
106
|
+
Then /^I should have (\d+) links$/ do |num_links|
|
107
|
+
@elements.size.should == num_links.to_i
|
108
|
+
end
|
109
|
+
|
110
|
+
Then /^the text of link (\d+) should be "([^\"]*)"$/ do |link_num, text|
|
111
|
+
@elements[link_num.to_i - 1].text.should == text
|
112
|
+
end
|
113
|
+
|
114
|
+
When /^I select the check boxes with class "([^\"]*)"$/ do |class_name|
|
115
|
+
@elements = @page.checkbox_elements(:class => class_name)
|
116
|
+
end
|
117
|
+
|
118
|
+
Then /^I should have (\d+) checkboxes$/ do |num_checkboxes|
|
119
|
+
@elements.size.should == num_checkboxes.to_i
|
120
|
+
end
|
121
|
+
|
122
|
+
Then /^the value of checkbox (\d+) should be "([^\"]*)"$/ do |checkbox_num, value|
|
123
|
+
@elements[checkbox_num.to_i - 1].value.should == value
|
124
|
+
end
|
125
|
+
|
126
|
+
When /^I select the radio button with class "([^\"]*)"$/ do |class_name|
|
127
|
+
@elements = @page.radio_button_elements(:class => class_name)
|
128
|
+
end
|
129
|
+
|
130
|
+
Then /^I should have (\d+) radio buttons$/ do |num_radio_buttons|
|
131
|
+
@elements.size.should == num_radio_buttons.to_i
|
132
|
+
end
|
133
|
+
|
134
|
+
Then /^the value of radio button (\d+) should be "([^\"]*)"$/ do |radio_button_num, value|
|
135
|
+
@elements[radio_button_num.to_i - 1].value.should == value
|
136
|
+
end
|
137
|
+
|
138
|
+
When /^I select the div with class "([^\"]*)"$/ do |class_name|
|
139
|
+
@elements = @page.div_elements(:class => class_name)
|
140
|
+
end
|
141
|
+
|
142
|
+
Then /^I should have (\d+) divs$/ do |num_divs|
|
143
|
+
@elements.size.should == num_divs.to_i
|
144
|
+
end
|
145
|
+
|
146
|
+
Then /^the text of div (\d+) should be "([^\"]*)"$/ do |div_num, text|
|
147
|
+
@elements[div_num.to_i - 1].text.should == text
|
148
|
+
end
|
149
|
+
|
150
|
+
When /^I select the spans with class "([^\"]*)"$/ do |class_name|
|
151
|
+
@elements = @page.span_elements(:class => class_name)
|
152
|
+
end
|
153
|
+
|
154
|
+
Then /^I should have (\d+) spans$/ do |num_spans|
|
155
|
+
@elements.size.should == num_spans.to_i
|
156
|
+
end
|
157
|
+
|
158
|
+
Then /^the text of span (\d+) should be "([^\"]*)"$/ do |span_num, text|
|
159
|
+
@elements[span_num.to_i - 1].text.should == text
|
160
|
+
end
|
161
|
+
|
162
|
+
When /^I select the tables with class "([^\"]*)"$/ do |class_name|
|
163
|
+
@elements = @page.table_elements(:class => class_name)
|
164
|
+
end
|
165
|
+
|
166
|
+
Then /^I should have (\d+) tables$/ do |num_tables|
|
167
|
+
@elements.size.should == num_tables.to_i
|
168
|
+
end
|
169
|
+
|
170
|
+
Then /^the first row first column for table (\d+) should have "([^\"]*)"$/ do |table_num, text|
|
171
|
+
@elements[table_num.to_i - 1][0][0].text.should == text
|
172
|
+
end
|
173
|
+
|
174
|
+
When /^I select the cells with class "([^\"]*)"$/ do |cell_class|
|
175
|
+
@elements = @page.cell_elements(:class => cell_class)
|
176
|
+
end
|
177
|
+
|
178
|
+
Then /^I should have (\d+) cells$/ do |num_cells|
|
179
|
+
@elements.size.should == num_cells.to_i
|
180
|
+
end
|
181
|
+
|
182
|
+
Then /^the text for cell (\d+) should be "([^\"]*)"$/ do |cell_num, text|
|
183
|
+
@elements[cell_num.to_i - 1].text.should == text
|
184
|
+
end
|
185
|
+
|
186
|
+
When /^I select the images with class "([^\"]*)"$/ do |class_name|
|
187
|
+
@elements = @page.image_elements(:class => class_name)
|
188
|
+
end
|
189
|
+
|
190
|
+
Then /^I should have (\d+) images$/ do |num_images|
|
191
|
+
@elements.size.should == num_images.to_i
|
192
|
+
end
|
193
|
+
|
194
|
+
Then /^the alt for image (\d+) should be "([^\"]*)"$/ do |image_num, alt|
|
195
|
+
@elements[image_num.to_i - 1].attribute(:alt).should == alt
|
196
|
+
end
|
197
|
+
|
198
|
+
When /^I select the forms with class "([^\"]*)"$/ do |class_name|
|
199
|
+
@elements = @page.form_elements(:class => class_name)
|
200
|
+
end
|
201
|
+
|
202
|
+
Then /^I should have (\d+) forms$/ do |number|
|
203
|
+
@elements.size.should == number.to_i
|
204
|
+
end
|
205
|
+
|
206
|
+
Then /^the action for form (\d+) should be "([^\"]*)"$/ do |form_number, action|
|
207
|
+
@elements[form_number.to_i-1].attribute(:action).should match action
|
208
|
+
end
|
209
|
+
|
210
|
+
When /^I select the list items with class "([^\"]*)"$/ do |class_name|
|
211
|
+
@elements = @page.list_item_elements(:class => class_name)
|
212
|
+
end
|
213
|
+
|
214
|
+
Then /^I should have (\d+) list items$/ do |num_list_items|
|
215
|
+
@elements.size.should == num_list_items.to_i
|
216
|
+
end
|
217
|
+
|
218
|
+
Then /^the text for list item (\d+) should be "([^\"]*)"$/ do |list_item_num, text|
|
219
|
+
@elements[list_item_num.to_i - 1].text.should == text
|
220
|
+
end
|
221
|
+
|
222
|
+
When /^I select the unordered list with class "([^\"]*)"$/ do |class_name|
|
223
|
+
@elements = @page.unordered_list_elements(:class => class_name)
|
224
|
+
end
|
225
|
+
|
226
|
+
Then /^I should have (\d+) unordered lists$/ do |num_unordered_lists|
|
227
|
+
@elements.size.should == num_unordered_lists.to_i
|
228
|
+
end
|
229
|
+
|
230
|
+
Then /^the text for the first item in unordered list (\d+) should be "([^\"]*)"$/ do |ul_num, text|
|
231
|
+
@elements[ul_num.to_i - 1][0].text.should == text
|
232
|
+
end
|
233
|
+
|
234
|
+
When /^I select the ordered lists with class "([^\"]*)"$/ do |class_name|
|
235
|
+
@elements = @page.ordered_list_elements(:class => class_name)
|
236
|
+
end
|
237
|
+
|
238
|
+
Then /^I should have (\d+) ordered lists$/ do |num_ol|
|
239
|
+
@elements.size.should == num_ol.to_i
|
240
|
+
end
|
241
|
+
|
242
|
+
Then /^the text for the first item in ordered list (\d+) should be "([^\"]*)"$/ do |ol_num, text|
|
243
|
+
@elements[ol_num.to_i - 1][0].text.should == text
|
244
|
+
end
|
245
|
+
|
246
|
+
When /^I select the h1s with class "([^\"]*)"$/ do |class_name|
|
247
|
+
@elements = @page.h1_elements(:class => class_name)
|
248
|
+
end
|
249
|
+
|
250
|
+
Then /^I should have (\d+) h1s$/ do |num_h1s|
|
251
|
+
@elements.size.should == num_h1s.to_i
|
252
|
+
end
|
253
|
+
|
254
|
+
Then /^the text for h1 (\d+) should be "([^\"]*)"$/ do |h1_num, text|
|
255
|
+
@elements[h1_num.to_i - 1].text.should == text
|
256
|
+
end
|
257
|
+
|
258
|
+
When /^I select the h2s with the class "([^\"]*)"$/ do |class_name|
|
259
|
+
@elements = @page.h2_elements(:class => class_name)
|
260
|
+
end
|
261
|
+
|
262
|
+
Then /^I should have (\d+) h2s$/ do |num_h2s|
|
263
|
+
@elements.size.should == num_h2s.to_i
|
264
|
+
end
|
265
|
+
|
266
|
+
Then /^the text for h2 (\d+) should be "([^\"]*)"$/ do |h2_num, text|
|
267
|
+
@elements[h2_num.to_i - 1].text.should == text
|
268
|
+
end
|
269
|
+
|
270
|
+
When /^I select the h3s with the class "([^\"]*)"$/ do |class_name|
|
271
|
+
@elements = @page.h3_elements(:class => class_name)
|
272
|
+
end
|
273
|
+
|
274
|
+
Then /^I should have (\d+) h3s$/ do |num_h3s|
|
275
|
+
@elements.size.should == num_h3s.to_i
|
276
|
+
end
|
277
|
+
|
278
|
+
Then /^the text for h3 (\d+) should be "([^\"]*)"$/ do |h3_num, text|
|
279
|
+
@elements[h3_num.to_i - 1].text.should == text
|
280
|
+
end
|
281
|
+
|
282
|
+
When /^I select the h4s with the class "([^\"]*)"$/ do |class_name|
|
283
|
+
@elements = @page.h4_elements(:class => class_name)
|
284
|
+
end
|
285
|
+
|
286
|
+
Then /^I should have (\d+) h4s$/ do |num_h4s|
|
287
|
+
@elements.size.should == num_h4s.to_i
|
288
|
+
end
|
289
|
+
|
290
|
+
Then /^the text for H4 (\d+) should be "([^\"]*)"$/ do |h4_num, text|
|
291
|
+
@elements[h4_num.to_i - 1].text.should == text
|
292
|
+
end
|
293
|
+
|
294
|
+
When /^I select the h5s with the class "([^\"]*)"$/ do |class_name|
|
295
|
+
@elements = @page.h5_elements(:class => class_name)
|
296
|
+
end
|
297
|
+
|
298
|
+
Then /^I should have (\d+) h5s$/ do |num_h5s|
|
299
|
+
@elements.size.should == num_h5s.to_i
|
300
|
+
end
|
301
|
+
|
302
|
+
Then /^the text for H5 (\d+) should be "([^\"]*)"$/ do |h5_num, text|
|
303
|
+
@elements[h5_num.to_i - 1].text.should == text
|
304
|
+
end
|
305
|
+
|
306
|
+
When /^I select the h6s with the class "([^\"]*)"$/ do |class_name|
|
307
|
+
@elements = @page.h6_elements(:class => class_name)
|
308
|
+
end
|
309
|
+
|
310
|
+
Then /^I should have (\d+) h6s$/ do |num_h6s|
|
311
|
+
@elements.size.should == num_h6s.to_i
|
312
|
+
end
|
313
|
+
|
314
|
+
Then /^the text for H6 (\d+) should be "([^\"]*)"$/ do |h6_num, text|
|
315
|
+
@elements[h6_num.to_i - 1].text.should == text
|
316
|
+
end
|
317
|
+
|
318
|
+
When /^I select the paragraph with class "([^\"]*)"$/ do |class_name|
|
319
|
+
@elements = @page.paragraph_elements(:class => class_name)
|
320
|
+
end
|
321
|
+
|
322
|
+
Then /^I should have (\d+) paragraphs$/ do |num_paragraphs|
|
323
|
+
@elements.size.should == num_paragraphs.to_i
|
324
|
+
end
|
325
|
+
|
326
|
+
Then /^the text for paragraph (\d+) should be "([^\"]*)"$/ do |para_num, text|
|
327
|
+
@elements[para_num.to_i - 1].text.should == text
|
328
|
+
end
|
329
|
+
|
330
|
+
When /^I select all buttons using no identifier$/ do
|
331
|
+
@elements = @page.button_elements
|
332
|
+
end
|
333
|
+
|
334
|
+
When /^I select all text fields using no identifier$/ do
|
335
|
+
@elements = @page.text_field_elements
|
336
|
+
end
|
337
|
+
|
338
|
+
When /^I select all hidden fields using no identifier$/ do
|
339
|
+
@elements = @page.hidden_field_elements
|
340
|
+
end
|
341
|
+
|
342
|
+
When /^I select text areas using no identifier$/ do
|
343
|
+
@elements = @page.text_area_elements
|
344
|
+
end
|
345
|
+
|
346
|
+
When /^I select select lists using no identifier$/ do
|
347
|
+
@elements = @page.select_list_elements
|
348
|
+
end
|
349
|
+
|
350
|
+
When /^I select links using no identifier$/ do
|
351
|
+
@elements = @page.link_elements
|
352
|
+
end
|
353
|
+
|
354
|
+
When /^I select checboxes using no identifier$/ do
|
355
|
+
@elements = @page.checkbox_elements
|
356
|
+
end
|
357
|
+
|
358
|
+
When /^I select radio buttons using no identifier$/ do
|
359
|
+
@elements = @page.radio_button_elements
|
360
|
+
end
|
361
|
+
|
362
|
+
When /^I select divs using no identifier$/ do
|
363
|
+
@elements = @page.div_elements
|
364
|
+
end
|
365
|
+
|
366
|
+
When /^I select spans using no identifier$/ do
|
367
|
+
@elements = @page.span_elements
|
368
|
+
end
|
369
|
+
|
370
|
+
When /^I select tables using no identifier$/ do
|
371
|
+
@elements = @page.table_elements
|
372
|
+
end
|
373
|
+
|
374
|
+
When /^I select the cells using no identifier$/ do
|
375
|
+
@elements = @page.cell_elements
|
376
|
+
end
|
377
|
+
|
378
|
+
When /^I select the images using no identifier$/ do
|
379
|
+
@elements = @page.image_elements
|
380
|
+
end
|
381
|
+
|
382
|
+
When /^I select the forms using no identifier$/ do
|
383
|
+
@elements = @page.form_elements
|
384
|
+
end
|
385
|
+
|
386
|
+
When /^I select the list items using no identifier$/ do
|
387
|
+
@elements = @page.list_item_elements
|
388
|
+
end
|
389
|
+
|
390
|
+
When /^I select the unordered list using no parameter$/ do
|
391
|
+
@elements = @page.unordered_list_elements
|
392
|
+
end
|
393
|
+
|
394
|
+
When /^I select the ordered lists using no identifier$/ do
|
395
|
+
@elements = @page.ordered_list_elements
|
396
|
+
end
|
397
|
+
|
398
|
+
When /^I select h(\d+)s using no identifier$/ do |num|
|
399
|
+
@elements = @page.send "h#{num}_elements"
|
400
|
+
end
|
401
|
+
|
402
|
+
When /^I select paragraphs using no identifier$/ do
|
403
|
+
@elements = @page.paragraph_elements
|
404
|
+
end
|
405
|
+
|
406
|
+
When /^I select the labels with class "([^\"]*)"$/ do |class_name|
|
407
|
+
@elements = @page.label_elements(:class => class_name)
|
408
|
+
end
|
409
|
+
|
410
|
+
Then /^I should have (\d+) labels$/ do |num_labels|
|
411
|
+
@elements.size.should == num_labels.to_i
|
412
|
+
end
|
413
|
+
|
414
|
+
Then /^the text for label (\d+) should be "([^\"]*)"$/ do |label_num, text|
|
415
|
+
@elements[label_num.to_i - 1].text.should == text
|
416
|
+
end
|
417
|
+
|
418
|
+
When /^I select labels using no identifier$/ do
|
419
|
+
@elements = @page.label_elements
|
420
|
+
end
|
421
|
+
|
422
|
+
When /^I select the file fields with class "([^\"]*)"$/ do |class_name|
|
423
|
+
@elements = @page.file_field_elements(:class => class_name)
|
424
|
+
end
|
425
|
+
|
426
|
+
Then /^I should have (\d+) file fields$/ do |num_file_fields|
|
427
|
+
@elements.size.should == num_file_fields.to_i
|
428
|
+
end
|
429
|
+
|
430
|
+
Then /^the title for file field (\d+) should be "([^\"]*)"$/ do |file_field_num, title|
|
431
|
+
@elements[file_field_num.to_i - 1].attribute('title').should == title
|
432
|
+
end
|
433
|
+
|
434
|
+
When /^I select the file fields using no identifier$/ do
|
435
|
+
@elements = @page.file_field_elements
|
436
|
+
end
|
437
|
+
|
438
|
+
When /^I select the divs using the generated method$/ do
|
439
|
+
@elements = @page.the_divs_elements
|
440
|
+
end
|
441
|
+
|
442
|
+
When /^I select the buttons using the generated method$/ do
|
443
|
+
@elements = @page.the_buttons_elements
|
444
|
+
end
|
445
|
+
|
446
|
+
When /^I select the text fields using the generated method$/ do
|
447
|
+
@elements = @page.the_text_fields_elements
|
448
|
+
end
|
449
|
+
|
450
|
+
When /^I select the hidden fields using the generated method$/ do
|
451
|
+
@elements = @page.the_hidden_fields_elements
|
452
|
+
end
|
453
|
+
|
454
|
+
When /^I select the text areas using the generated method$/ do
|
455
|
+
@elements = @page.the_text_areas_elements
|
456
|
+
end
|
457
|
+
|
458
|
+
When /^I select the select lists using the generated method$/ do
|
459
|
+
@elements = @page.the_select_lists_elements
|
460
|
+
end
|
461
|
+
|
462
|
+
When /^I select the link using the generated method$/ do
|
463
|
+
@elements = @page.the_links_elements
|
464
|
+
end
|
465
|
+
|
466
|
+
When /^I select the check boxes using the generated method$/ do
|
467
|
+
@elements = @page.the_checkboxes_elements
|
468
|
+
end
|
469
|
+
|
470
|
+
When /^I select the radio button using the generated method$/ do
|
471
|
+
@elements = @page.the_radio_buttons_elements
|
472
|
+
end
|
473
|
+
|
474
|
+
When /^I select the spans using the generated method$/ do
|
475
|
+
@elements = @page.the_spans_elements
|
476
|
+
end
|
477
|
+
|
478
|
+
When /^I select the tables using the generated method$/ do
|
479
|
+
@elements = @page.the_tables_elements
|
480
|
+
end
|
481
|
+
|
482
|
+
When /^I select the cells using the generated method$/ do
|
483
|
+
@elements = @page.the_cells_elements
|
484
|
+
end
|
485
|
+
|
486
|
+
When /^I select the images using the generated method$/ do
|
487
|
+
@elements = @page.the_images_elements
|
488
|
+
end
|
489
|
+
|
490
|
+
When /^I select the forms using the generated method$/ do
|
491
|
+
@elements = @page.the_forms_elements
|
492
|
+
end
|
493
|
+
|
494
|
+
When /^I select the list items using the generated method$/ do
|
495
|
+
@elements = @page.the_list_items_elements
|
496
|
+
end
|
497
|
+
|
498
|
+
When /^I select the unordered list using the generated method$/ do
|
499
|
+
@elements = @page.the_unordered_lists_elements
|
500
|
+
end
|
501
|
+
|
502
|
+
When /^I select the ordered lists using the generated method$/ do
|
503
|
+
@elements = @page.the_ordered_lists_elements
|
504
|
+
end
|
505
|
+
|
506
|
+
When /^I select the h(\d+)s using the generated method$/ do |num|
|
507
|
+
@elements = @page.send "the_h#{num.to_i}s_elements"
|
508
|
+
end
|
509
|
+
|
510
|
+
When /^I select the paragraph using the generated method$/ do
|
511
|
+
@elements = @page.the_paragraphs_elements
|
512
|
+
end
|
513
|
+
|
514
|
+
When /^I select the labels using the generated method$/ do
|
515
|
+
@elements = @page.the_labels_elements
|
516
|
+
end
|
517
|
+
|
518
|
+
When /^I select the file fields using the generated method$/ do
|
519
|
+
@elements = @page.the_file_fields_elements
|
520
|
+
end
|
521
|
+
|
522
|
+
When /^I select the divs using a block$/ do
|
523
|
+
@elements = @page.block_divs_elements
|
524
|
+
end
|
525
|
+
|
526
|
+
When(/^I select the multiple elements with a tag label$/) do
|
527
|
+
@elements = @page.generic_label_elements
|
528
|
+
end
|