Module: WatirRobot::Form
- Included in:
- KeywordLibrary
- Defined in:
- lib/watir_robot/keywords/form.rb
Overview
Functionality related to HTML forms as a whole
Instance Method Summary collapse
-
#form_should_contain_button(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific button.
-
#form_should_contain_checkbox(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific checkbox.
-
#form_should_contain_element(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific element.
-
#form_should_contain_filefield(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific file-field.
-
#form_should_contain_radio_button(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific radio button.
-
#form_should_contain_select_list(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific select list.
-
#form_should_contain_textfield(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific text field.
-
#form_should_not_contain_button(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific button.
-
#form_should_not_contain_checkbox(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific checkbox.
-
#form_should_not_contain_element(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific element.
-
#form_should_not_contain_filefield(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific file-field.
-
#form_should_not_contain_radio_button(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific radio button.
-
#form_should_not_contain_select_list(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific select list.
-
#form_should_not_contain_textfield(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific text field.
Instance Method Details
#form_should_contain_button(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific button
14 15 16 17 |
# File 'lib/watir_robot/keywords/form.rb', line 14 def (form_loc, field_loc) raise(Exception::ElementMatchError, "The button described by #{field_loc} was not located in the form described by #{form_loc}.") unless @browser.form(parse_location(form_loc)).(parse_location(field_loc)).exists? end |
#form_should_contain_checkbox(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific checkbox
36 37 38 39 |
# File 'lib/watir_robot/keywords/form.rb', line 36 def form_should_contain_checkbox(form_loc, field_loc) raise(Exception::ElementMatchError, "The checkbox described by #{field_loc} was not located in the form described by #{form_loc}.") unless @browser.form(parse_location(form_loc)).checkbox(parse_location(field_loc)).exists? end |
#form_should_contain_element(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific element
58 59 60 61 |
# File 'lib/watir_robot/keywords/form.rb', line 58 def form_should_contain_element(form_loc, field_loc) raise(Exception::ElementMatchError, "The element described by #{field_loc} was not located in the form described by #{form_loc}.") unless @browser.form(parse_location(form_loc)).checkbox(parse_location(field_loc)).exists? end |
#form_should_contain_filefield(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific file-field
80 81 82 83 |
# File 'lib/watir_robot/keywords/form.rb', line 80 def form_should_contain_filefield(form_loc, field_loc) raise(Exception::ElementMatchError, "The file-field described by #{field_loc} was not located in the form described by #{form_loc}.") unless @browser.form(parse_location(form_loc)).file_field(parse_location(field_loc)).exists? end |
#form_should_contain_radio_button(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific radio button
102 103 104 105 |
# File 'lib/watir_robot/keywords/form.rb', line 102 def (form_loc, field_loc) raise(Exception::ElementMatchError, "The radio button described by #{field_loc} was not located in the form described by #{form_loc}.") unless @browser.form(parse_location(form_loc)).radio(parse_location(field_loc)).exists? end |
#form_should_contain_select_list(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific select list
124 125 126 127 |
# File 'lib/watir_robot/keywords/form.rb', line 124 def form_should_contain_select_list(form_loc, field_loc) raise(Exception::ElementMatchError, "The select list described by #{field_loc} was not located in the form described by #{form_loc}.") unless @browser.form(parse_location(form_loc)).select(parse_location(field_loc)).exists? end |
#form_should_contain_textfield(form_loc, field_loc) ⇒ Object
Verify that a form contains a specific text field
146 147 148 149 |
# File 'lib/watir_robot/keywords/form.rb', line 146 def form_should_contain_textfield(form_loc, field_loc) raise(Exception::ElementMatchError, "The textfield described by #{field_loc} was not located in the form described by #{form_loc}.") unless @browser.form(parse_location(form_loc)).text_field(parse_location(field_loc)).exists? end |
#form_should_not_contain_button(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific button
25 26 27 28 |
# File 'lib/watir_robot/keywords/form.rb', line 25 def (form_loc, field_loc) raise(Exception::ElementMatchError, "The button described by #{field_loc} was erroneously located in the form described by #{form_loc}.") if @browser.form(parse_location(form_loc)).(parse_location(field_loc)).exists? end |
#form_should_not_contain_checkbox(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific checkbox
47 48 49 50 |
# File 'lib/watir_robot/keywords/form.rb', line 47 def form_should_not_contain_checkbox(form_loc, field_loc) raise(Exception::ElementMatchError, "The checkbox described by #{field_loc} was erroneously located in the form described by #{form_loc}.") if @browser.form(parse_location(form_loc)).checkbox(parse_location(field_loc)).exists? end |
#form_should_not_contain_element(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific element
69 70 71 72 |
# File 'lib/watir_robot/keywords/form.rb', line 69 def form_should_not_contain_element(form_loc, field_loc) raise(Exception::ElementMatchError, "The element described by #{field_loc} was erroneously located in the form described by #{form_loc}.") if @browser.form(parse_location(form_loc)).checkbox(parse_location(field_loc)).exists? end |
#form_should_not_contain_filefield(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific file-field
91 92 93 94 |
# File 'lib/watir_robot/keywords/form.rb', line 91 def form_should_not_contain_filefield(form_loc, field_loc) raise(Exception::ElementMatchError, "The file-field described by #{field_loc} was erroneously located in the form described by #{form_loc}.") if @browser.form(parse_location(form_loc)).file_field(parse_location(field_loc)).exists? end |
#form_should_not_contain_radio_button(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific radio button
113 114 115 116 |
# File 'lib/watir_robot/keywords/form.rb', line 113 def (form_loc, field_loc) raise(Exception::ElementMatchError, "The radio button described by #{field_loc} was erroneously located in the form described by #{form_loc}.") if @browser.form(parse_location(form_loc)).radio(parse_location(field_loc)).exists? end |
#form_should_not_contain_select_list(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific select list
135 136 137 138 |
# File 'lib/watir_robot/keywords/form.rb', line 135 def form_should_not_contain_select_list(form_loc, field_loc) raise(Exception::ElementMatchError, "The select list described by #{field_loc} was erroneously located in the form described by #{form_loc}.") if @browser.form(parse_location(form_loc)).select(parse_location(field_loc)).exists? end |
#form_should_not_contain_textfield(form_loc, field_loc) ⇒ Object
Verify that a form does not contain a specific text field
157 158 159 160 |
# File 'lib/watir_robot/keywords/form.rb', line 157 def form_should_not_contain_textfield(form_loc, field_loc) raise(Exception::ElementMatchError, "The textfield described by #{field_loc} was erroneously located in the form described by #{form_loc}.") if @browser.form(parse_location(form_loc)).text_field(parse_location(field_loc)).exists? end |