Module: Pyrite::Assertions
- Included in:
- PyriteTest
- Defined in:
- lib/pyrite/assertions.rb
Instance Method Summary collapse
-
#assert_element(selector, msg = nil) ⇒ Object
Assert an element appears on the page via jquery selector.
-
#assert_no_element(selector, msg = nil) ⇒ Object
Assert an element does not appear on the page via jquery selector.
-
#assert_no_text(text, msg = nil) ⇒ Object
Assert some text does not appear somewhere on the page.
-
#assert_text(text, msg = nil) ⇒ Object
Assert some text appears somewhere on the page.
Instance Method Details
#assert_element(selector, msg = nil) ⇒ Object
Assert an element appears on the page via jquery selector
15 16 17 18 |
# File 'lib/pyrite/assertions.rb', line 15 def assert_element(selector, msg=nil) assert browser.element?("jquery=#{selector}"), msg || "Element '#{selector}' not found on page" end |
#assert_no_element(selector, msg = nil) ⇒ Object
Assert an element does not appear on the page via jquery selector
21 22 23 24 |
# File 'lib/pyrite/assertions.rb', line 21 def assert_no_element(selector, msg=nil) assert !browser.element?("jquery=#{selector}"), msg || "Element '#{selector}' was found on page but shouldn't be" end |
#assert_no_text(text, msg = nil) ⇒ Object
Assert some text does not appear somewhere on the page
10 11 12 |
# File 'lib/pyrite/assertions.rb', line 10 def assert_no_text(text, msg=nil) assert !browser.text?(text), msg || "Text '#{text}' not found on page" end |
#assert_text(text, msg = nil) ⇒ Object
Assert some text appears somewhere on the page
5 6 7 |
# File 'lib/pyrite/assertions.rb', line 5 def assert_text(text, msg=nil) assert browser.text?(text), msg || "Text '#{text}' not found on page" end |