@@ -1681,7 +1681,11 @@ def assert_link_status_code_is_not_404(self, link):
16811681 def assert_no_404_errors (self , multithreaded = True ):
16821682 """ Assert no 404 errors from page links obtained from:
16831683 "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 )
16851689 if multithreaded :
16861690 from multiprocessing .dummy import Pool as ThreadPool
16871691 pool = ThreadPool (10 )
@@ -1690,12 +1694,10 @@ def assert_no_404_errors(self, multithreaded=True):
16901694 pool .join ()
16911695 else :
16921696 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 )
16951698 if self .demo_mode :
16961699 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" )
16991701
17001702 def print_unique_links_with_status_codes (self ):
17011703 """ Finds all unique links in the html of the page source
@@ -1839,9 +1841,8 @@ def assert_title(self, title):
18391841 "does not match the actual page title [%s]!"
18401842 "" % (expected , actual ))
18411843 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" )
18451846
18461847 def assert_no_js_errors (self ):
18471848 """ Asserts that there are no JavaScript "SEVERE"-level page errors.
@@ -1868,6 +1869,9 @@ def assert_no_js_errors(self):
18681869 current_url = self .get_current_url ()
18691870 raise Exception (
18701871 "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" )
18711875
18721876 def get_google_auth_password (self , totp_key = None ):
18731877 """ Returns a time-based one-time password based on the
0 commit comments