title: Behat test fails with Modal dialog present
body: <p>If you think the way I'm doing is wrong or there is another way then let me know so I can change whole code below.</p>
  
  <p><strong>Problem</strong>: I'm getting this error: (I think it is because alert box needs to be clicked)</p>
  
  <pre><code>[WebDriver\Exception\UnexpectedAlertOpen]                                                                                                                                                                                                                                                                                                                       
    Modal dialog present: profile data saved 
  </code></pre>
  
  <p><strong>test_1</strong></p>
  
  <pre><code>When I fill in "firstname" with "a"
      And I fill in "lastname" with "b"
      And I follow "Save"
      Then I should see "profile data saved" in popup
  </code></pre>
  
  <p><strong>test_2</strong></p>
  
  <pre><code>This is second test which comes after test_1 and this is fine.
  </code></pre>
  
  <p><strong>FeatureContext</strong></p>
  
  <pre><code>/**
   * @When /^(?:|I )should see "([^"]*)" in popup$/
   *
   * @param string $message The message.
   *
   * @return bool
   */
  public function assertPopupMessage($message)
  {
      return $message == $this-&gt;getSession()-&gt;getDriver()-&gt;getWebDriverSession()-&gt;getAlert_text();
  }
  </code></pre>