Module: Browsery::Utils::AssertionHelper
- Included in:
- TestCase
- Defined in:
- lib/browsery/utils/assertion_helper.rb
Overview
A collection of custom, but frequently-used assertions.
Instance Method Summary collapse
-
#assert_element_absent(how, what) ⇒ Object
Assert that an element, specified by ‘how` and `what`, are absent from the current page’s context.
-
#assert_element_present(how, what) ⇒ Object
Assert that an element, specified by ‘how` and `what`, are present from the current page’s context.
Instance Method Details
#assert_element_absent(how, what) ⇒ Object
Assert that an element, specified by ‘how` and `what`, are absent from the current page’s context.
15 16 17 18 19 |
# File 'lib/browsery/utils/assertion_helper.rb', line 15 def assert_element_absent(how, what) assert_raises Selenium::WebDriver::Error::NoSuchElementError do @driver.find_element(how, what) end end |
#assert_element_present(how, what) ⇒ Object
Assert that an element, specified by ‘how` and `what`, are present from the current page’s context.
27 28 29 |
# File 'lib/browsery/utils/assertion_helper.rb', line 27 def assert_element_present(how, what) @driver.find_element(how, what) end |