Skip to content

Commit c9e5ec8

Browse files
authored
Merge pull request #389 from seleniumbase/fix-assert-no-404-errors-method
Fix assert_no_404_errors() method
2 parents 279f0d4 + f37ec16 commit c9e5ec8

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,8 @@ def assert_no_404_errors(self, multithreaded=True):
16901690
pool.join()
16911691
else:
16921692
for link in links:
1693-
self.assert_link_status_code_is_not_404(link)
1693+
if "javascript:" not in link: # Ignore links with JavaScript
1694+
self.assert_link_status_code_is_not_404(link)
16941695
if self.demo_mode:
16951696
messenger_post = ("ASSERT NO 404 ERRORS")
16961697
js_utils.post_messenger_success_message(

seleniumbase/fixtures/page_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def get_domain_url(url):
1313
Into this:
1414
https://blog.xkcd.com
1515
"""
16-
if "http://" not in url and "https://" not in url:
16+
if not url.startswith("http://") and not url.startswith("https://"):
1717
return url
1818
url_header = url.split('://')[0]
1919
simple_url = url.split('://')[1]
@@ -118,7 +118,8 @@ def _get_unique_links(page_url, soup):
118118
Includes:
119119
"a"->"href", "img"->"src", "link"->"href", and "script"->"src" links.
120120
"""
121-
if "http://" not in page_url and "https://" not in page_url:
121+
if not page_url.startswith("http://") and (
122+
not page_url.startswith("https://")):
122123
return []
123124
prefix = 'http:'
124125
if page_url.startswith('https:'):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
setup(
4747
name='seleniumbase',
48-
version='1.32.10',
48+
version='1.32.11',
4949
description='Fast, Easy, and Reliable Browser Automation & Testing.',
5050
long_description=long_description,
5151
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)