Module: WatirRobot::CheckBox
- Included in:
- KeywordLibrary
- Defined in:
- lib/watir_robot/keywords/checkbox.rb
Overview
Functionality related to checkbox form elements
Instance Method Summary collapse
-
#checkbox_should_be_selected(loc) ⇒ Object
Verify that checkbox is checked.
-
#checkbox_should_not_be_selected(loc) ⇒ Object
Verify that checkbox is not checked.
-
#select_checkbox(loc) ⇒ Object
Check a checkbox.
-
#unselect_checkbox(loc) ⇒ Object
Uncheck a checkbox.
Instance Method Details
#checkbox_should_be_selected(loc) ⇒ Object
Verify that checkbox is checked
36 37 38 39 |
# File 'lib/watir_robot/keywords/checkbox.rb', line 36 def checkbox_should_be_selected(loc) raise(Exception::CheckboxSelectionError, "The checkbox located at #{loc} is not checked off.") unless @browser.checkbox(parse_location(loc)).set? end |
#checkbox_should_not_be_selected(loc) ⇒ Object
Verify that checkbox is not checked
46 47 48 49 |
# File 'lib/watir_robot/keywords/checkbox.rb', line 46 def checkbox_should_not_be_selected(loc) raise(Exception::CheckboxSelectionError, "The checkbox located at #{loc} is checked off erroneously.") if @browser.checkbox(parse_location(loc)).set? end |
#select_checkbox(loc) ⇒ Object
Check a checkbox
15 16 17 |
# File 'lib/watir_robot/keywords/checkbox.rb', line 15 def select_checkbox(loc) @browser.checkbox(parse_location(loc)).set end |
#unselect_checkbox(loc) ⇒ Object
Uncheck a checkbox
24 25 26 |
# File 'lib/watir_robot/keywords/checkbox.rb', line 24 def unselect_checkbox(loc) @browser.checkbox(parse_location(loc)).set(false) end |