Skip to content

Commit 87357f2

Browse files
authored
Merge pull request #833 from seleniumbase/update-method-and-dependencies
Improve reliability of asserting that there are no 404-errors
2 parents 030f636 + d046ec0 commit 87357f2

File tree

5 files changed

+27
-5
lines changed

5 files changed

+27
-5
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)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ pyflakes==2.2.0;python_version>="3.5"
8787
tornado==5.1.1;python_version<"3.5"
8888
tornado==6.1;python_version>="3.5"
8989
allure-pytest==2.8.22;python_version<"3.5"
90-
allure-pytest==2.8.35;python_version>="3.5"
90+
allure-pytest==2.8.36;python_version>="3.5"
9191
pdfminer.six==20191110;python_version<"3.5"
9292
pdfminer.six==20201018;python_version>="3.5"

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "1.56.5"
2+
__version__ = "1.56.6"

seleniumbase/fixtures/base_case.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2758,7 +2758,12 @@ def assert_link_status_code_is_not_404(self, link):
27582758
def __get_link_if_404_error(self, link):
27592759
status_code = str(self.get_link_status_code(link))
27602760
if status_code == "404":
2761-
return link
2761+
# Verify again to be sure. (In case of multi-threading overload.)
2762+
status_code = str(self.get_link_status_code(link))
2763+
if status_code == "404":
2764+
return link
2765+
else:
2766+
return None
27622767
else:
27632768
return None
27642769

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
'tornado==5.1.1;python_version<"3.5"',
192192
'tornado==6.1;python_version>="3.5"',
193193
'allure-pytest==2.8.22;python_version<"3.5"',
194-
'allure-pytest==2.8.35;python_version>="3.5"',
194+
'allure-pytest==2.8.36;python_version>="3.5"',
195195
'pdfminer.six==20191110;python_version<"3.5"',
196196
'pdfminer.six==20201018;python_version>="3.5"',
197197
],

0 commit comments

Comments
 (0)