Skip to content

Instantly share code, notes, and snippets.

@sam-e-ch
sam-e-ch / gist:139e6165625b2c26649c
Created January 7, 2016 16:16 — forked from bbugh/gist:3882746
Accessing alert box in JavaScript with Capybara/rails/rspec
//Get a reference to the alert using the following:
alert = page.driver.browser.switch_to.alert
// and then hit OK with
page.driver.browser.switch_to.alert.accept
// or dismiss it with