Skip to content

Commit

Permalink
Deprecate phantom (#223)
Browse files Browse the repository at this point in the history
* Deprecate PhantomJS

* Consistent naming of Appium

* Run tests on travis in parallel
  • Loading branch information
BeyondEvil committed Jun 13, 2019
1 parent aa86d78 commit 3a42568
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
18 changes: 12 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
language: python
jobs:
include:
- stage: Linting
- stage: Tests
name: Linting
python: 3.7
dist: xenial
sudo: required
before_install: skip
addons: skip
env: TOXENV=flake8

- stage: Docs
-
name: Docs
python: 3.7
dist: xenial
sudo: required
before_install: skip
addons: skip
env: TOXENV=docs

- stage: python 2.7
-
name: python 2.7
python: 2.7
env: TOXENV=py27

- stage: python 3.6
-
name: python 3.6
python: 3.6
env: TOXENV=py36

- stage: python 3.7
-
name: python 3.7
python: 3.7
dist: xenial
sudo: required
env: TOXENV=py37

- stage: pypy 5.6.0
-
name: pypy 5.6.0
python: pypy-5.6.0
env: TOXENV=pypy

Expand Down
2 changes: 1 addition & 1 deletion docs/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Optional packages

Appium
~~~~~~
To install pytest-selenium with `appium <https://appium.io/>`_ support:
To install pytest-selenium with `Appium <https://appium.io/>`_ support:

.. code-block:: bash
Expand Down
3 changes: 3 additions & 0 deletions docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ option to indicate where it can be found::

PhantomJS
---------
**NOTE:** Support for PhantomJS has been deprecated and will be removed in a
future release. If running headless is a requirement, please consider using
Firefox or Chrome instead.

To use PhantomJS, you will need `download it <http://phantomjs.org/download.html>`_
and specify ``PhantomJS`` for the ``--driver`` command line option. If
Expand Down
7 changes: 7 additions & 0 deletions pytest_selenium/drivers/phantomjs.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import warnings


def driver_kwargs(capabilities, driver_args, driver_log, driver_path, **kwargs):
warnings.warn(
"Support for PhantomJS has been deprecated and will be "
"removed in a future release. If running headless is a "
"requirement, please consider using Firefox or Chrome instead.",
DeprecationWarning,
)
kwargs = {"desired_capabilities": capabilities, "service_log_path": driver_log}
if driver_args is not None:
kwargs["service_args"] = driver_args
Expand Down
1 change: 1 addition & 0 deletions testing/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def chrome_options(chrome_options):
filterwarnings =
error::DeprecationWarning
ignore:--firefox-\w+ has been deprecated:DeprecationWarning
ignore:Support for PhantomJS:DeprecationWarning
""",
)

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ envlist = py{27,36,37,py,py3}, docs, flake8

[testenv]
passenv = PYTEST_ADDOPTS
setenv = MOZ_HEADLESS=1
setenv =
PYTHONDONTWRITEBYTECODE=1
MOZ_HEADLESS=1
deps =
pytest-localserver
pytest-xdist
Expand Down

0 comments on commit 3a42568

Please sign in to comment.