Module: Capybara::Apparition::Browser::Modal

Included in:
Capybara::Apparition::Browser
Defined in:
lib/capybara/apparition/browser/modal.rb

Instance Method Summary collapse

Instance Method Details

#accept_alertObject



6
7
8
# File 'lib/capybara/apparition/browser/modal.rb', line 6

def accept_alert
  current_page.add_modal(alert: true)
end

#accept_confirmObject



10
11
12
# File 'lib/capybara/apparition/browser/modal.rb', line 10

def accept_confirm
  current_page.add_modal(confirm: true)
end

#accept_prompt(response) ⇒ Object



18
19
20
# File 'lib/capybara/apparition/browser/modal.rb', line 18

def accept_prompt(response)
  current_page.add_modal(prompt: response)
end

#dismiss_confirmObject



14
15
16
# File 'lib/capybara/apparition/browser/modal.rb', line 14

def dismiss_confirm
  current_page.add_modal(confirm: false)
end

#dismiss_promptObject



22
23
24
# File 'lib/capybara/apparition/browser/modal.rb', line 22

def dismiss_prompt
  current_page.add_modal(prompt: false)
end


26
27
28
# File 'lib/capybara/apparition/browser/modal.rb', line 26

def modal_message
  current_page.modal_messages.shift
end