@@ -1681,7 +1681,11 @@ def assert_link_status_code_is_not_404(self, link):
1681
1681
def assert_no_404_errors (self , multithreaded = True ):
1682
1682
""" Assert no 404 errors from page links obtained from:
1683
1683
"a"->"href", "img"->"src", "link"->"href", and "script"->"src". """
1684
- links = self .get_unique_links ()
1684
+ all_links = self .get_unique_links ()
1685
+ links = []
1686
+ for link in all_links :
1687
+ if "javascript:" not in link and "mailto:" not in link :
1688
+ links .append (link )
1685
1689
if multithreaded :
1686
1690
from multiprocessing .dummy import Pool as ThreadPool
1687
1691
pool = ThreadPool (10 )
@@ -1690,12 +1694,10 @@ def assert_no_404_errors(self, multithreaded=True):
1690
1694
pool .join ()
1691
1695
else :
1692
1696
for link in links :
1693
- if "javascript:" not in link : # Ignore links with JavaScript
1694
- self .assert_link_status_code_is_not_404 (link )
1697
+ self .assert_link_status_code_is_not_404 (link )
1695
1698
if self .demo_mode :
1696
1699
messenger_post = ("ASSERT NO 404 ERRORS" )
1697
- js_utils .post_messenger_success_message (
1698
- self .driver , messenger_post , self .message_duration )
1700
+ self .__highlight_with_assert_success (messenger_post , "html" )
1699
1701
1700
1702
def print_unique_links_with_status_codes (self ):
1701
1703
""" Finds all unique links in the html of the page source
@@ -1839,9 +1841,8 @@ def assert_title(self, title):
1839
1841
"does not match the actual page title [%s]!"
1840
1842
"" % (expected , actual ))
1841
1843
if self .demo_mode :
1842
- messenger_post = ("ASSERT TITLE: {%s}" % title )
1843
- js_utils .post_messenger_success_message (
1844
- self .driver , messenger_post , self .message_duration )
1844
+ messenger_post = ("ASSERT TITLE = {%s}" % title )
1845
+ self .__highlight_with_assert_success (messenger_post , "html" )
1845
1846
1846
1847
def assert_no_js_errors (self ):
1847
1848
""" Asserts that there are no JavaScript "SEVERE"-level page errors.
@@ -1868,6 +1869,9 @@ def assert_no_js_errors(self):
1868
1869
current_url = self .get_current_url ()
1869
1870
raise Exception (
1870
1871
"JavaScript errors found on %s => %s" % (current_url , errors ))
1872
+ if self .demo_mode and self .browser == 'chrome' :
1873
+ messenger_post = ("ASSERT NO JS ERRORS" )
1874
+ self .__highlight_with_assert_success (messenger_post , "html" )
1871
1875
1872
1876
def get_google_auth_password (self , totp_key = None ):
1873
1877
""" Returns a time-based one-time password based on the
0 commit comments