Skip to content

Commit 3a42568

Browse files
authored
Deprecate phantom (#223)
* Deprecate PhantomJS * Consistent naming of Appium * Run tests on travis in parallel
1 parent aa86d78 commit 3a42568

File tree

6 files changed

+27
-8
lines changed

6 files changed

+27
-8
lines changed

.travis.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,43 @@
11
language: python
22
jobs:
33
include:
4-
- stage: Linting
4+
- stage: Tests
5+
name: Linting
56
python: 3.7
67
dist: xenial
78
sudo: required
89
before_install: skip
910
addons: skip
1011
env: TOXENV=flake8
1112

12-
- stage: Docs
13+
-
14+
name: Docs
1315
python: 3.7
1416
dist: xenial
1517
sudo: required
1618
before_install: skip
1719
addons: skip
1820
env: TOXENV=docs
1921

20-
- stage: python 2.7
22+
-
23+
name: python 2.7
2124
python: 2.7
2225
env: TOXENV=py27
2326

24-
- stage: python 3.6
27+
-
28+
name: python 3.6
2529
python: 3.6
2630
env: TOXENV=py36
2731

28-
- stage: python 3.7
32+
-
33+
name: python 3.7
2934
python: 3.7
3035
dist: xenial
3136
sudo: required
3237
env: TOXENV=py37
3338

34-
- stage: pypy 5.6.0
39+
-
40+
name: pypy 5.6.0
3541
python: pypy-5.6.0
3642
env: TOXENV=pypy
3743

docs/installing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Optional packages
2626

2727
Appium
2828
~~~~~~
29-
To install pytest-selenium with `appium <https://appium.io/>`_ support:
29+
To install pytest-selenium with `Appium <https://appium.io/>`_ support:
3030

3131
.. code-block:: bash
3232

docs/user_guide.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ option to indicate where it can be found::
218218

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

222225
To use PhantomJS, you will need `download it <http://phantomjs.org/download.html>`_
223226
and specify ``PhantomJS`` for the ``--driver`` command line option. If

pytest_selenium/drivers/phantomjs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# This Source Code Form is subject to the terms of the Mozilla Public
22
# License, v. 2.0. If a copy of the MPL was not distributed with this
33
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
import warnings
45

56

67
def driver_kwargs(capabilities, driver_args, driver_log, driver_path, **kwargs):
8+
warnings.warn(
9+
"Support for PhantomJS has been deprecated and will be "
10+
"removed in a future release. If running headless is a "
11+
"requirement, please consider using Firefox or Chrome instead.",
12+
DeprecationWarning,
13+
)
714
kwargs = {"desired_capabilities": capabilities, "service_log_path": driver_log}
815
if driver_args is not None:
916
kwargs["service_args"] = driver_args

testing/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def chrome_options(chrome_options):
5151
filterwarnings =
5252
error::DeprecationWarning
5353
ignore:--firefox-\w+ has been deprecated:DeprecationWarning
54+
ignore:Support for PhantomJS:DeprecationWarning
5455
""",
5556
)
5657

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ envlist = py{27,36,37,py,py3}, docs, flake8
88

99
[testenv]
1010
passenv = PYTEST_ADDOPTS
11-
setenv = MOZ_HEADLESS=1
11+
setenv =
12+
PYTHONDONTWRITEBYTECODE=1
13+
MOZ_HEADLESS=1
1214
deps =
1315
pytest-localserver
1416
pytest-xdist

0 commit comments

Comments
 (0)