Class: Prickle::Capybara::Popups::Selenium
- Inherits:
-
Object
- Object
- Prickle::Capybara::Popups::Selenium
- Includes:
- Capybara::DSL
- Defined in:
- lib/prickle/capybara/popup/selenium.rb
Instance Method Summary collapse
- #confirm ⇒ Object
- #contains_message?(message) ⇒ Boolean
- #dismiss ⇒ Object
-
#initialize ⇒ Selenium
constructor
A new instance of Selenium.
- #message ⇒ Object
Constructor Details
#initialize ⇒ Selenium
Returns a new instance of Selenium.
8 9 10 |
# File 'lib/prickle/capybara/popup/selenium.rb', line 8 def initialize @popup = page.driver.browser.switch_to.alert end |
Instance Method Details
#confirm ⇒ Object
12 13 14 |
# File 'lib/prickle/capybara/popup/selenium.rb', line 12 def confirm @popup.accept end |
#contains_message?(message) ⇒ Boolean
24 25 26 |
# File 'lib/prickle/capybara/popup/selenium.rb', line 24 def raise Exceptions::MessageNotContainedInPopup.new(self.) unless self..eql? end |
#dismiss ⇒ Object
16 17 18 |
# File 'lib/prickle/capybara/popup/selenium.rb', line 16 def dismiss @popup.dismiss end |
#message ⇒ Object
20 21 22 |
# File 'lib/prickle/capybara/popup/selenium.rb', line 20 def @popup.text end |