|
5 | 5 |
|
6 | 6 | class SwagLabsTests(BaseCase):
|
7 | 7 |
|
8 |
| - def login_to_swag_labs(self, username="standard_user"): |
| 8 | + def login_to_swag_labs(self, username="standard_user", v1=False): |
9 | 9 | """ Login to Swag Labs and verify success. """
|
10 |
| - self.open("https://www.saucedemo.com/") |
| 10 | + url = "https://www.saucedemo.com" |
| 11 | + if v1: |
| 12 | + url += "/v1" |
| 13 | + self.open(url) |
11 | 14 | if username not in self.get_text("#login_credentials"):
|
12 | 15 | self.fail("Invalid user for login: %s" % username)
|
13 | 16 | self.type("#user-name", username)
|
@@ -86,12 +89,8 @@ def test_swag_labs_basic_flow(self, username):
|
86 | 89 | @pytest.mark.run(order=2)
|
87 | 90 | def test_swag_labs_products_page_links(self, username):
|
88 | 91 | """ This test checks for 404s on the Swag Labs products page.
|
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. """ |
93 |
| - self.login_to_swag_labs(username=username) |
94 |
| - self.set_attributes('img[src*="/sl-404"]', "src", "/bad_link.jpg") |
| 92 | + This test is parameterized on the login user. """ |
| 93 | + self.login_to_swag_labs(username=username, v1=True) |
95 | 94 | self.assert_no_404_errors()
|
96 | 95 |
|
97 | 96 | @parameterized.expand([
|
|
0 commit comments