@@ -1704,7 +1704,13 @@ def is_downloaded_file_present(self, file):
1704
1704
1705
1705
def assert_downloaded_file (self , file ):
1706
1706
""" Asserts that the file exists in the Downloads Folder. """
1707
- assert os .path .exists (self .get_path_of_downloaded_file (file ))
1707
+ self .assertTrue (os .path .exists (self .get_path_of_downloaded_file (file )),
1708
+ "File [%s] was not found in the downloads folder [%s]!"
1709
+ "" % (file , self .get_downloads_folder ()))
1710
+ if self .demo_mode :
1711
+ messenger_post = ("ASSERT DOWNLOADED FILE: [%s]" % file )
1712
+ js_utils .post_messenger_success_message (
1713
+ self .driver , messenger_post , self .message_duration )
1708
1714
1709
1715
def assert_true (self , expr , msg = None ):
1710
1716
self .assertTrue (expr , msg = msg )
@@ -1736,7 +1742,11 @@ def assert_not_equal(self, first, second, msg=None):
1736
1742
1737
1743
def assert_title (self , title ):
1738
1744
""" Asserts that the web page title matches the expected title. """
1739
- assert self .get_title () == title
1745
+ expected = title
1746
+ actual = self .get_title ()
1747
+ self .assertEqual (expected , actual , "Expected page title [%s] "
1748
+ "does not match the actual page title [%s]!"
1749
+ "" % (expected , actual ))
1740
1750
if self .demo_mode :
1741
1751
messenger_post = ("ASSERT TITLE: {%s}" % title )
1742
1752
js_utils .post_messenger_success_message (
0 commit comments