@@ -71,8 +71,8 @@ def __init__(self, *args, **kwargs):
71
71
self .env = None # Add a shortened version of self.environment
72
72
self .__last_url_of_delayed_assert = "data:,"
73
73
self .__last_page_load_url = "data:,"
74
- self .__page_check_count = 0
75
- self .__page_check_failures = []
74
+ self .__delayed_assert_count = 0
75
+ self .__delayed_assert_failures = []
76
76
# Requires self._* instead of self.__* for external class use
77
77
self ._html_report_extra = [] # (Used by pytest_plugin.py)
78
78
self ._default_driver = None
@@ -2287,7 +2287,7 @@ def assert_link_text(self, link_text, timeout=settings.SMALL_TIMEOUT):
2287
2287
return True
2288
2288
2289
2289
# For backwards compatibility, earlier method names of the next
2290
- # four methods have remained even though they do the same thing,
2290
+ # three methods have remained even though they do the same thing,
2291
2291
# with the exception of assert_*, which won't return the element,
2292
2292
# but like the others, will raise an exception if the call fails.
2293
2293
@@ -2609,16 +2609,16 @@ def __add_delayed_assert_failure(self):
2609
2609
""" Add a delayed_assert failure into a list for future processing. """
2610
2610
current_url = self .driver .current_url
2611
2611
message = self .__get_exception_message ()
2612
- self .__page_check_failures .append (
2612
+ self .__delayed_assert_failures .append (
2613
2613
"CHECK #%s: (%s)\n %s" % (
2614
- self .__page_check_count , current_url , message ))
2614
+ self .__delayed_assert_count , current_url , message ))
2615
2615
2616
2616
def delayed_assert_element (self , selector , by = By .CSS_SELECTOR ,
2617
2617
timeout = settings .MINI_TIMEOUT ):
2618
2618
""" A non-terminating assertion for an element on a page.
2619
2619
Failures will be saved until the process_delayed_asserts()
2620
2620
method is called from inside a test, likely at the end of it. """
2621
- self .__page_check_count += 1
2621
+ self .__delayed_assert_count += 1
2622
2622
try :
2623
2623
url = self .get_current_url ()
2624
2624
if url == self .__last_url_of_delayed_assert :
@@ -2639,7 +2639,7 @@ def delayed_assert_text(self, text, selector="html", by=By.CSS_SELECTOR,
2639
2639
""" A non-terminating assertion for text from an element on a page.
2640
2640
Failures will be saved until the process_delayed_asserts()
2641
2641
method is called from inside a test, likely at the end of it. """
2642
- self .__page_check_count += 1
2642
+ self .__delayed_assert_count += 1
2643
2643
try :
2644
2644
url = self .get_current_url ()
2645
2645
if url == self .__last_url_of_delayed_assert :
@@ -2666,12 +2666,12 @@ def process_delayed_asserts(self, print_only=False):
2666
2666
the delayed asserts on a single html page so that the failure
2667
2667
screenshot matches the location of the delayed asserts.
2668
2668
If "print_only" is set to True, the exception won't get raised. """
2669
- if self .__page_check_failures :
2669
+ if self .__delayed_assert_failures :
2670
2670
exception_output = ''
2671
2671
exception_output += "\n *** DELAYED ASSERTION FAILURES FOR: "
2672
2672
exception_output += "%s\n " % self .id ()
2673
- all_failing_checks = self .__page_check_failures
2674
- self .__page_check_failures = []
2673
+ all_failing_checks = self .__delayed_assert_failures
2674
+ self .__delayed_assert_failures = []
2675
2675
for tb in all_failing_checks :
2676
2676
exception_output += "%s\n " % tb
2677
2677
if print_only :
@@ -3017,7 +3017,7 @@ def tearDown(self):
3017
3017
has_exception = True
3018
3018
else :
3019
3019
has_exception = sys .exc_info ()[1 ] is not None
3020
- if self .__page_check_failures :
3020
+ if self .__delayed_assert_failures :
3021
3021
print (
3022
3022
"\n When using self.delayed_assert_*() methods in your tests, "
3023
3023
"remember to call self.process_delayed_asserts() afterwards. "
0 commit comments