title: How to test confirm/alert messages with capybara + headless chrome
body: <p>Recently I switched my acceptance tests from capybara-webkit to headless chrome. In some cases I need to check alert messages (for example, confirm to discard changes when user leaves the page). With capybara-webkit I did it the following way</p>
  
  <pre><code>confirm_messages = page.driver.browser.confirm_messages
  expect(confirm_messages.first).to include "Do you want to discard your changes?"
  
  # or
  
  expect(page.driver.browser.confirm_messages).to be_empty
  </code></pre>
  
  <p>Now when I try to get confirm messages with chrome/headless chrome I get the following error:</p>
  
  <pre><code>undefined method `confirm_messages' for #&lt;Selenium::WebDriver::Chrome::Driver:0x007fa5478d8a08&gt; (NoMethodError)
  </code></pre>
  
  <p>How can I test alerts with capybara and headless chrome?</p>