Skip to content

Commit

Permalink
Merge pull request #158 from jacebrowning/xfail-ci
Browse files Browse the repository at this point in the history
Expect failures on CI
  • Loading branch information
jacebrowning authored Nov 11, 2023
2 parents de90754 + 82a3b07 commit 1b27e90
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
8 changes: 0 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@
"site/": true,
"geckodriver.log": true
},
"python.pythonPath": ".venv/bin/python",
"editor.formatOnSave": true,
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintArgs": ["--rcfile", ".pylint.ini"],
"python.linting.mypyEnabled": true,
"python.linting.pydocstyleEnabled": true,
"python.formatting.provider": "black",
"python.formatting.blackPath": ".venv/bin/black",
"cSpell.words": [
"autopage",
"chromedriver",
Expand Down
8 changes: 7 additions & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,24 @@ def test_package_contents(expect):


def describe_visit():
@pytest.mark.xfail(
os.name == "nt", reason="WebDriver Manager is not working on Windows"
)
def it_launches_a_browser(expect):
page = pomace.visit("http://example.com", browser="chrome", headless=True)
expect(page).contains("Example Domain")

@pytest.mark.skipif(os.name == "nt", reason="Path differs on Windows")
@pytest.mark.xfail(os.name == "nt", reason="Path differs on Windows")
def it_saves_data_relative_to_caller(expect):
page = pomace.visit("http://example.com", browser="chrome", headless=True)
path = Path(__file__).parent / "sites" / "example.com" / "@" / "default.yml"
expect(page.datafile.path) == path


def describe_freeze():
@pytest.mark.xfail(
os.name == "nt", reason="WebDriver Manager is not working on Windows"
)
def it_disables_automatic_actions(expect):
page = pomace.visit("http://example.com", browser="chrome", headless=True)
page.actions = []
Expand Down
8 changes: 6 additions & 2 deletions tests/test_sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def test_locator_uses_are_persisted(expect, browser):
expect(bad_locator.uses) <= 0


@pytest.mark.skipif("CI" in os.environ, reason="Wikipedia is blocked on CI")
@pytest.mark.xfail(
"CI" in os.environ, raises=AssertionError, reason="Wikipedia is blocked on CI"
)
def test_type_actions_are_supported(expect, browser):
page = Page.at("https://www.wikipedia.org")

Expand All @@ -34,7 +36,9 @@ def test_type_actions_are_supported(expect, browser):
expect(shared.client.url).endswith("wikipedia.org/wiki/Foobar")


@pytest.mark.skipif("CI" in os.environ, reason="Wikipedia is blocked on CI")
@pytest.mark.xfail(
"CI" in os.environ, raises=AssertionError, reason="Wikipedia is blocked on CI"
)
def test_modifier_keys_are_supported(expect, browser):
page = Page.at("https://www.wikipedia.org")

Expand Down

0 comments on commit 1b27e90

Please sign in to comment.