SeleniumBase/examples/test_fail.py

18 lines
565 B
Python
Raw Normal View History

2019-10-25 13:19:11 +08:00
""" This test fails on purpose to demonstrate
the logging capabilities of SeleniumBase.
>>> pytest test_fail.py --html=report.html
This creates ``report.html`` with details.
(Also find log files in ``latest_logs/``) """
2015-12-05 05:11:53 +08:00
2018-12-11 15:01:57 +08:00
import pytest
2015-12-05 05:11:53 +08:00
from seleniumbase import BaseCase
class MyTestClass(BaseCase):
2018-12-11 15:01:57 +08:00
@pytest.mark.expected_failure
2015-12-05 05:11:53 +08:00
def test_find_army_of_robots_on_xkcd_desert_island(self):
self.open("https://xkcd.com/731/")
2018-03-05 03:58:57 +08:00
print("\n(This test fails on purpose)")
self.assert_element("div#ARMY_OF_ROBOTS", timeout=1)