Skip to content

Commit 88f85fe

Browse files
committed
Update the Swag Labs example test
1 parent 13b5a22 commit 88f85fe

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

examples/swag_labs_suite.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,23 @@ def test_swag_labs_basic_flow(self, username):
8686
@pytest.mark.run(order=2)
8787
def test_swag_labs_products_page_links(self, username):
8888
""" This test checks for 404s on the Swag Labs products page.
89-
This test is parameterized on the login user. """
89+
This test is parameterized on the login user.
90+
Swag Labs replaced broken links with dog images for the
91+
"problem_user" login, so the test switches those back
92+
to demonstrate the "assert_no_404_errors()" method. """
9093
self.login_to_swag_labs(username=username)
94+
self.set_attributes('img[src*="/sl-404"]', "src", "/bad_link.jpg")
9195
self.assert_no_404_errors()
96+
97+
@parameterized.expand([
98+
["standard_user"],
99+
["problem_user"],
100+
])
101+
@pytest.mark.run(order=3)
102+
def test_swag_labs_visual_regressions(self, username):
103+
""" This test checks for visual regressions on the Swag Labs page.
104+
This test is parameterized on the login user. """
105+
self.login_to_swag_labs(username="standard_user")
106+
self.check_window(baseline=True)
107+
self.login_to_swag_labs(username=username)
108+
self.check_window(level=3)

0 commit comments

Comments
 (0)