-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding MinkPhantomJSDriver to the documentation via Third party drive…
…rs new section
- Loading branch information
Juan Francisco Calderon Zumba
committed
Nov 23, 2016
1 parent
7cf6c34
commit cf27aa4
Showing
5 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Third party Drivers | ||
====================== | ||
|
||
Thanks to the ``Behat\Mink\Driver\DriverInterface`` interface, anyone can create a driver. | ||
|
||
Drivers that have implemented the mentioned interface and respect the driver test suite: | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
/third-party-drivers/phantomjs.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
PhantomJSDriver | ||
====================== | ||
|
||
PhantomJSDriver provides a bridge for the `PhantomJS`_ headless browser, it uses native `APIs`_ to interact with the browser which makes it generally faster than `Selenium2 (webdriver)`_. | ||
|
||
If you want to use a headless browser in your automation tests, with PhantomJSDriver you can. | ||
|
||
Installation | ||
------------ | ||
|
||
PhantomJSDriver is available through Composer: | ||
|
||
.. code-block:: bash | ||
$ composer require jcalderonzumba/mink-selenium2-driver | ||
In order to talk with phantomjs, you must install and configure it | ||
first: | ||
|
||
1. Download the phantomjs browser from the `project website`_. | ||
|
||
2. Install PhantomJSDriver via Composer. | ||
|
||
3. Run the browser with the following command: | ||
|
||
.. code-block:: bash | ||
$ phantomjs --ssl-protocol=any --ignore-ssl-errors=true vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768 2>&1 >> /tmp/gastonjs.log & | ||
.. tip:: | ||
|
||
The PhantomJSDriver relies on the `GastonJS`_ project to talk to phantomjs, this means you can do more things that are outside of the scope of the Mink Driver interface. | ||
|
||
The testsuite of the driver is still triggering some failures because of bugs in phantomJS or in GastonJS that need to be fixed. | ||
|
||
Usage | ||
------------ | ||
|
||
That's it, now you can use PhantomJSDriver: | ||
|
||
.. code-block:: php | ||
$driver = new Zumba\Mink\Driver\PhantomJSDriver('http://localhost:8510'); | ||
PhantomJSDriver Feature Support | ||
--------------------------------- | ||
|
||
====================== ================= | ||
Feature PhantomJSDriver | ||
====================== ================= | ||
Page traversing Yes | ||
Form manipulation Yes | ||
HTTP Basic auth Yes | ||
Windows management Yes | ||
iFrames management Yes | ||
Request headers access Yes | ||
Response headers Yes | ||
Cookie manipulation Yes | ||
Status code access Yes | ||
Mouse manipulation Yes | ||
Drag'n Drop Yes | ||
Keyboard actions Yes | ||
Element visibility Yes | ||
JS evaluation Yes | ||
Window resizing Yes | ||
Window maximizing No | ||
====================== ================= | ||
|
||
FAQ | ||
--------- | ||
|
||
1. Is this a selenium based driver? | ||
|
||
**NO**, it has nothing to do with Selenium it's inspired on the `Poltergeist project`_. | ||
|
||
2. What features does this driver implements? | ||
|
||
**ALL** of the features defined in Mink DriverInterface. maximizeWindow is the only one not implemented since is a headless browser it does not make sense to implement it. | ||
|
||
.. _PhantomJS: http://phantomjs.org/ | ||
.. _APIs: http://phantomjs.org/api/webpage/ | ||
.. _Selenium2 (webdriver): http://seleniumhq.org/ | ||
.. _project website: http://phantomjs.org/download.html | ||
.. _GastonJS: http://gastonjs.readthedocs.io/en/latest/ | ||
.. _Poltergeist project: https://github.com/teampoltergeist/poltergeist |