|
| 1 | +PhantomJSDriver |
| 2 | +====================== |
| 3 | + |
| 4 | +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)`_. |
| 5 | + |
| 6 | +If you want to use a headless browser in your automation tests, with PhantomJSDriver you can. |
| 7 | + |
| 8 | +Installation |
| 9 | +------------ |
| 10 | + |
| 11 | +PhantomJSDriver is available through Composer: |
| 12 | + |
| 13 | +.. code-block:: bash |
| 14 | +
|
| 15 | + $ composer require jcalderonzumba/mink-phantomjs-driver |
| 16 | +
|
| 17 | +In order to talk with phantomjs, you must install and configure it |
| 18 | +first: |
| 19 | + |
| 20 | +1. Download the phantomjs browser from the `project website`_. |
| 21 | + |
| 22 | +2. Install PhantomJSDriver via Composer. |
| 23 | + |
| 24 | +3. Run the browser with the following command: |
| 25 | + |
| 26 | + .. code-block:: bash |
| 27 | +
|
| 28 | + $ phantomjs --ssl-protocol=any --ignore-ssl-errors=true vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768 2>&1 >> /tmp/gastonjs.log & |
| 29 | +
|
| 30 | +.. tip:: |
| 31 | + |
| 32 | + 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. |
| 33 | + |
| 34 | + The testsuite of the driver is still triggering some failures because of bugs in phantomJS or in GastonJS that need to be fixed. |
| 35 | + |
| 36 | +Usage |
| 37 | +------------ |
| 38 | + |
| 39 | +That's it, now you can use PhantomJSDriver: |
| 40 | + |
| 41 | +.. code-block:: php |
| 42 | +
|
| 43 | + $driver = new Zumba\Mink\Driver\PhantomJSDriver('http://localhost:8510'); |
| 44 | +
|
| 45 | +PhantomJSDriver Feature Support |
| 46 | +--------------------------------- |
| 47 | + |
| 48 | +====================== ================= |
| 49 | +Feature PhantomJSDriver |
| 50 | +====================== ================= |
| 51 | +Page traversing Yes |
| 52 | +Form manipulation Yes |
| 53 | +HTTP Basic auth Yes |
| 54 | +Windows management Yes |
| 55 | +iFrames management Yes |
| 56 | +Request headers access Yes |
| 57 | +Response headers Yes |
| 58 | +Cookie manipulation Yes |
| 59 | +Status code access Yes |
| 60 | +Mouse manipulation Yes |
| 61 | +Drag'n Drop Yes |
| 62 | +Keyboard actions Yes |
| 63 | +Element visibility Yes |
| 64 | +JS evaluation Yes |
| 65 | +Window resizing Yes |
| 66 | +Window maximizing No |
| 67 | +====================== ================= |
| 68 | + |
| 69 | +FAQ |
| 70 | +--------- |
| 71 | + |
| 72 | +1. Is this a selenium based driver? |
| 73 | + |
| 74 | + **NO**, it has nothing to do with Selenium it's inspired on the `Poltergeist project`_. |
| 75 | + |
| 76 | +2. What features does this driver implements? |
| 77 | + |
| 78 | + **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. |
| 79 | + |
| 80 | +.. _PhantomJS: http://phantomjs.org/ |
| 81 | +.. _APIs: http://phantomjs.org/api/webpage/ |
| 82 | +.. _Selenium2 (webdriver): http://seleniumhq.org/ |
| 83 | +.. _project website: http://phantomjs.org/download.html |
| 84 | +.. _GastonJS: http://gastonjs.readthedocs.io/en/latest/ |
| 85 | +.. _Poltergeist project: https://github.com/teampoltergeist/poltergeist |
0 commit comments