- Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathtest_fail.py
16 lines (14 loc) · 592 Bytes
/
test_fail.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
""" 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/``)"""
importpytest
fromseleniumbaseimportBaseCase
BaseCase.main(__name__, __file__)
classFailingTests(BaseCase):
@pytest.mark.expected_failure
deftest_find_army_of_robots_on_xkcd_desert_island(self):
self.open("https://xkcd.com/731/")
print("\n(This test should fail)")
self.assert_element("div#ARMY_OF_ROBOTS", timeout=1)