-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding MinkPhantomJSDriver to the documentation #71
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
PhantomJSDriver | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should be maintaining the doc for third-party drivers ourselves. You are the one knowing the driver and so you should be maintaining its doc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have a good point here, i'll create a phantomjsdriver.readthedocs.org page with the Driver info and link it here then. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if it is small, you could also use github itself to host the documentation (write it in markdown in this case though, as their rST renderer is not as good as their markdown one) (putting the doc in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, for the moment is small and mostly everything that i have written in this PR is contained in the README.md of the repo. |
||
====================== | ||
|
||
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-phantomjs-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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, the third-party drivers could be a section at the end of the
drivers
page instead of a separate page containing only the list, which has a single element for now.This could be changed in the future if we have tens of third-party drivers, but I doubt it will be the case.