Class: Prickle::Capybara::Popups::Selenium

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL
Defined in:
lib/prickle/capybara/popup/selenium.rb

Instance Method Summary collapse

Constructor Details

#initializeSelenium

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

#confirmObject



12
13
14
# File 'lib/prickle/capybara/popup/selenium.rb', line 12

def confirm
  @popup.accept
end

#contains_message?(message) ⇒ Boolean

Returns:

  • (Boolean)

Raises:



24
25
26
# File 'lib/prickle/capybara/popup/selenium.rb', line 24

def contains_message? message
  raise Exceptions::MessageNotContainedInPopup.new(self.message) unless self.message.eql? message
end

#dismissObject



16
17
18
# File 'lib/prickle/capybara/popup/selenium.rb', line 16

def dismiss
  @popup.dismiss
end

#messageObject



20
21
22
# File 'lib/prickle/capybara/popup/selenium.rb', line 20

def message
  @popup.text
end