Skip to content

Commit

Permalink
Add launcher tests for Google Chrome and PhantomJS
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Sep 2, 2015
1 parent 31e6e35 commit c740b0d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ install:
before_script:
- sh -e /etc/init.d/xvfb start
- flake8 .
script: py.test testing
script: py.test testing -m 'not chrome'
18 changes: 18 additions & 0 deletions testing/test_chrome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 pytest

pytestmark = pytest.mark.nondestructive


@pytest.mark.chrome
def test_launch(testdir):
file_test = testdir.makepyfile("""
import pytest
@pytest.mark.nondestructive
def test_pass(webtext):
assert webtext == u'Success!'
""")
testdir.quick_qa('--driver', 'Chrome', file_test, passed=1)
18 changes: 18 additions & 0 deletions testing/test_phantomjs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 pytest

pytestmark = pytest.mark.nondestructive


@pytest.mark.phantomjs
def test_launch(testdir):
file_test = testdir.makepyfile("""
import pytest
@pytest.mark.nondestructive
def test_pass(webtext):
assert webtext == u'Success!'
""")
testdir.quick_qa('--driver', 'PhantomJS', file_test, passed=1)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
envlist = py26, py27, py33, py34, pypy, pypy3

[testenv]
commands = py.test {posargs}
commands = py.test -m 'not (chrome or phantomjs)' {posargs}
deps = pytest

0 comments on commit c740b0d

Please sign in to comment.