phpunit-mink icon indicating copy to clipboard operation
phpunit-mink copied to clipboard

Implemement PhantomJs Driver Factory

Open mablae opened this issue 9 years ago • 7 comments

Would be nice to be able to use this together with PhantomJs.

mablae avatar Jan 31 '16 05:01 mablae

You can use existing Selenium2DriverFactory for integrating with PhantomJS. To make it work you need to start PhantomJS like this:

phantomjs --webdriver=PORT

See http://phantomjs.org/release-1.8.html .

Since PHPUnit-Mink is using Mink for browser communication and Mink doesn't have direct PhantomJS (only via WebDriver protocol) we also can't directly support PhantomJS.

aik099 avatar Jan 31 '16 09:01 aik099

Hey @aik099 ,

Thanks for your reply. I found https://github.com/jcalderonzumba/MinkPhantomJSDriver which at least looks like a dedicated driver.

The problem with the selenium webdriver is, I need to read the response status code.

The phantomjs Driver does have all features, including getStatusCode()

mablae avatar Jan 31 '16 17:01 mablae

Yes, I'm aware of that project and we've discussed it at Mink (see https://github.com/minkphp/Mink/issues/654). The problem with that is, that it contains 3 libraries in a one:

  • the Poltergeist
  • the Mink driver that talks with Poltergeist
  • the MinkExtension factory that talks with a driver

and that fact prevents it from being properly integrated into Mink itself.

If you wish you can send PR with PhantomJSDriverFactory class, that would make use of that library.

aik099 avatar Jan 31 '16 18:01 aik099

Thanks for the pointers! I will check it and report back.

mablae avatar Jan 31 '16 23:01 mablae

@aik099 this is not really true anymore. The repository has been split into multiple packages

stof avatar Feb 01 '16 10:02 stof

It was? That's great, because original issue had no mention about this. Maybe we can then mention that driver on Mink page somewhere?

aik099 avatar Feb 01 '16 11:02 aik099

@mablae , please send PR, that would add new driver factory.

aik099 avatar Jul 03 '16 12:07 aik099

Closing this as PhantomJS is not maintained anymore.

stof avatar Jun 15 '23 07:06 stof