symfony - How to handle confirm popup with phantomjs + behat + mink -


in tests use step confirm javascript confirm popup:

/**  * @when /^(?:|i )confirm popup$/  */ public function confirmpopup() {     $this->getsession()->getdriver()->getwebdriversession()->accept_alert(); } 

this step work fine selenium2 , chrome/firefox, doesn't work phantomjs.

how can handle confirm popup 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 gist : https://gist.github.com/blazarecki/2888851

i updated "selenium2driver.php" following:

public function acceptalert() { $this->wdsession->accept_alert(); } 

this makes accept_alert() available driver.

so in script, line accept alert.

$this->getsession()->getdriver()->acceptalert();

note i'm using rawminkcontext not native minkcontext


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -