@@ -4337,6 +4337,7 @@ def __process_recorded_actions(self):
4337
4337
ext_actions.append("as_at")
4338
4338
ext_actions.append("as_te")
4339
4339
ext_actions.append("astnv")
4340
+ ext_actions.append("aetnv")
4340
4341
ext_actions.append("as_et")
4341
4342
ext_actions.append("wf_el")
4342
4343
ext_actions.append("sw_fr")
@@ -4740,6 +4741,7 @@ def __process_recorded_actions(self):
4740
4741
action[0] == "as_te"
4741
4742
or action[0] == "as_et"
4742
4743
or action[0] == "astnv"
4744
+ or action[0] == "aetnv"
4743
4745
or action[0] == "da_te"
4744
4746
or action[0] == "da_et"
4745
4747
):
@@ -4752,6 +4754,8 @@ def __process_recorded_actions(self):
4752
4754
method = "assert_exact_text"
4753
4755
elif action[0] == "astnv":
4754
4756
method = "assert_text_not_visible"
4757
+ elif action[0] == "aetnv":
4758
+ method = "assert_exact_text_not_visible"
4755
4759
elif action[0] == "da_te":
4756
4760
method = "deferred_assert_text"
4757
4761
elif action[0] == "da_et":
@@ -8541,6 +8545,19 @@ def wait_for_text(
8541
8545
text, selector, by=by, timeout=timeout
8542
8546
)
8543
8547
8548
+ def wait_for_exact_text(
8549
+ self, text, selector="html", by="css selector", timeout=None
8550
+ ):
8551
+ """The shorter version of wait_for_exact_text_visible()"""
8552
+ self.__check_scope()
8553
+ if not timeout:
8554
+ timeout = settings.LARGE_TIMEOUT
8555
+ if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
8556
+ timeout = self.__get_new_timeout(timeout)
8557
+ return self.wait_for_exact_text_visible(
8558
+ text, selector, by=by, timeout=timeout
8559
+ )
8560
+
8544
8561
def find_text(
8545
8562
self, text, selector="html", by="css selector", timeout=None
8546
8563
):
@@ -8554,6 +8571,19 @@ def find_text(
8554
8571
text, selector, by=by, timeout=timeout
8555
8572
)
8556
8573
8574
+ def find_exact_text(
8575
+ self, text, selector="html", by="css selector", timeout=None
8576
+ ):
8577
+ """Same as wait_for_exact_text_visible() - returns the element"""
8578
+ self.__check_scope()
8579
+ if not timeout:
8580
+ timeout = settings.LARGE_TIMEOUT
8581
+ if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
8582
+ timeout = self.__get_new_timeout(timeout)
8583
+ return self.wait_for_exact_text_visible(
8584
+ text, selector, by=by, timeout=timeout
8585
+ )
8586
+
8557
8587
def assert_text_visible(
8558
8588
self, text, selector="html", by="css selector", timeout=None
8559
8589
):
@@ -8920,6 +8950,19 @@ def wait_for_text_not_visible(
8920
8950
self.driver, text, selector, by, timeout, self.browser
8921
8951
)
8922
8952
8953
+ def wait_for_exact_text_not_visible(
8954
+ self, text, selector="html", by="css selector", timeout=None
8955
+ ):
8956
+ self.__check_scope()
8957
+ if not timeout:
8958
+ timeout = settings.LARGE_TIMEOUT
8959
+ if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
8960
+ timeout = self.__get_new_timeout(timeout)
8961
+ selector, by = self.__recalculate_selector(selector, by)
8962
+ return page_actions.wait_for_exact_text_not_visible(
8963
+ self.driver, text, selector, by, timeout, self.browser
8964
+ )
8965
+
8923
8966
def assert_text_not_visible(
8924
8967
self, text, selector="html", by="css selector", timeout=None
8925
8968
):
@@ -8944,6 +8987,32 @@ def assert_text_not_visible(
8944
8987
self.__extra_actions.append(action)
8945
8988
return True
8946
8989
8990
+ def assert_exact_text_not_visible(
8991
+ self, text, selector="html", by="css selector", timeout=None
8992
+ ):
8993
+ """Similar to wait_for_exact_text_not_visible()
8994
+ Raises an exception if the exact text is still visible after timeout.
8995
+ Returns True if successful. Default timeout = SMALL_TIMEOUT."""
8996
+ self.__check_scope()
8997
+ if not timeout:
8998
+ timeout = settings.SMALL_TIMEOUT
8999
+ if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
9000
+ timeout = self.__get_new_timeout(timeout)
9001
+ self.wait_for_exact_text_not_visible(
9002
+ text, selector, by=by, timeout=timeout
9003
+ )
9004
+ if self.recorder_mode:
9005
+ url = self.get_current_url()
9006
+ if url and len(url) > 0:
9007
+ if ("http:") in url or ("https:") in url or ("file:") in url:
9008
+ if self.get_session_storage_item("pause_recorder") == "no":
9009
+ time_stamp = self.execute_script("return Date.now();")
9010
+ origin = self.get_origin()
9011
+ text_selector = [text, selector]
9012
+ action = ["aetnv", text_selector, origin, time_stamp]
9013
+ self.__extra_actions.append(action)
9014
+ return True
9015
+
8947
9016
############
8948
9017
8949
9018
def wait_for_attribute_not_present(
0 commit comments