Codeception/Codeception — pull request #192 by sweetbee (2013-02-27 14:06:46+00:00)
Title: [BUG] click causes Selenium 2 Exception if a javascript alert is opened.

In Codeception/Util/Mink.php when click() is called, after the click()
is executed, there is a second call to getCurrentUrl() to determine
whether we should add a debug message indicating that the browser has
moved to a new page.

The second call to getCurrentUrl() triggers a selenium exception as at
this point the alert is open and the only valid actions are
acceptPopup(), cancelPopup(), seeInPopup() or dontSeeInPopup().

There is no method in the JsonWireProtocol for testing whether a popup
is present before attempting getCurrentUrl().

So, until a better solution presents itself, I have overridden the
click() method in the Selenium2 module to exclude the second call to
getCurrentUrl().

Documentation of JsonWireProtocol is available here:
http://code.google.com/p/selenium/wiki/JsonWireProtocol#Response_Status_
Codes