In my tests I use this step to confirm a javascript confirm popup:
/**
* @when /^(?:|I )confirm the popup$/
*/
public function confirmPopup()
{
$this->getSession()->getDriver()->getWebDriverSession()->accept_alert();
}
This step work fine with selenium2 and chrome/firefox, but doesn't work with phantomjs.
How can I handle a confirm popup with phantomjs ?
for informations:
- symfony: 2.0.23
- behat: 2.4.6
- mink: 1.5.0
- Symfony2Extension: 1.0.2
- MinkExtension: 1.1.4
- MinkBrowserKitDriver: 1.1.0
- MinkSelenium2Driver: 1.1.0
- phamtomjs 1.9.1
behat.yml
default:
extensions:
Behat\Symfony2Extension\Extension:
mink_driver: true
Behat\MinkExtension\Extension:
base_url: "http://localhost:8000/app_test.php"
default_session: selenium2
selenium2:
wd_host: "http://localhost:9876/wd/hub"
Thanks!
PS: Here the gist : https://gist.github.com/blazarecki/2888851