@@ -4296,6 +4296,10 @@ def __process_recorded_actions(self):
4296
4296
and srt_actions[n - 1][0] == "sh_fc"
4297
4297
):
4298
4298
srt_actions[n - 1][0] = "_skip"
4299
+ for n in range(len(srt_actions)):
4300
+ if srt_actions[n][0] == "canva":
4301
+ srt_actions[n][1][1] = math.ceil(float(srt_actions[n][1][1]))
4302
+ srt_actions[n][1][2] = math.ceil(float(srt_actions[n][1][2]))
4299
4303
ext_actions = []
4300
4304
ext_actions.append("_url_")
4301
4305
ext_actions.append("js_cl")
@@ -4305,6 +4309,8 @@ def __process_recorded_actions(self):
4305
4309
ext_actions.append("as_el")
4306
4310
ext_actions.append("as_ep")
4307
4311
ext_actions.append("asenv")
4312
+ ext_actions.append("acc_a")
4313
+ ext_actions.append("dis_a")
4308
4314
ext_actions.append("hi_li")
4309
4315
ext_actions.append("as_lt")
4310
4316
ext_actions.append("as_ti")
@@ -4635,6 +4641,10 @@ def __process_recorded_actions(self):
4635
4641
sb_actions.append('self.%s("%s")' % (method, action[1]))
4636
4642
else:
4637
4643
sb_actions.append("self.%s('%s')" % (method, action[1]))
4644
+ elif action[0] == "acc_a":
4645
+ sb_actions.append("self.accept_alert()")
4646
+ elif action[0] == "dis_a":
4647
+ sb_actions.append("self.dismiss_alert()")
4638
4648
elif action[0] == "hi_li":
4639
4649
method = "highlight"
4640
4650
if '"' not in action[1]:
@@ -8860,15 +8870,35 @@ def wait_for_and_accept_alert(self, timeout=None):
8860
8870
timeout = settings.LARGE_TIMEOUT
8861
8871
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
8862
8872
timeout = self.__get_new_timeout(timeout)
8863
- return page_actions.wait_for_and_accept_alert(self.driver, timeout)
8873
+ alert = page_actions.wait_for_and_accept_alert(self.driver, timeout)
8874
+ if self.recorder_mode:
8875
+ url = self.get_current_url()
8876
+ if url and len(url) > 0:
8877
+ if ("http:") in url or ("https:") in url or ("file:") in url:
8878
+ if self.get_session_storage_item("pause_recorder") == "no":
8879
+ time_stamp = self.execute_script("return Date.now();")
8880
+ origin = self.get_origin()
8881
+ action = ["acc_a", "", origin, time_stamp]
8882
+ self.__extra_actions.append(action)
8883
+ return alert
8864
8884
8865
8885
def wait_for_and_dismiss_alert(self, timeout=None):
8866
8886
self.__check_scope()
8867
8887
if not timeout:
8868
8888
timeout = settings.LARGE_TIMEOUT
8869
8889
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
8870
8890
timeout = self.__get_new_timeout(timeout)
8871
- return page_actions.wait_for_and_dismiss_alert(self.driver, timeout)
8891
+ alert = page_actions.wait_for_and_dismiss_alert(self.driver, timeout)
8892
+ if self.recorder_mode:
8893
+ url = self.get_current_url()
8894
+ if url and len(url) > 0:
8895
+ if ("http:") in url or ("https:") in url or ("file:") in url:
8896
+ if self.get_session_storage_item("pause_recorder") == "no":
8897
+ time_stamp = self.execute_script("return Date.now();")
8898
+ origin = self.get_origin()
8899
+ action = ["dis_a", "", origin, time_stamp]
8900
+ self.__extra_actions.append(action)
8901
+ return alert
8872
8902
8873
8903
def wait_for_and_switch_to_alert(self, timeout=None):
8874
8904
self.__check_scope()
@@ -8887,7 +8917,17 @@ def accept_alert(self, timeout=None):
8887
8917
timeout = settings.SMALL_TIMEOUT
8888
8918
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
8889
8919
timeout = self.__get_new_timeout(timeout)
8890
- return page_actions.wait_for_and_accept_alert(self.driver, timeout)
8920
+ alert = page_actions.wait_for_and_accept_alert(self.driver, timeout)
8921
+ if self.recorder_mode:
8922
+ url = self.get_current_url()
8923
+ if url and len(url) > 0:
8924
+ if ("http:") in url or ("https:") in url or ("file:") in url:
8925
+ if self.get_session_storage_item("pause_recorder") == "no":
8926
+ time_stamp = self.execute_script("return Date.now();")
8927
+ origin = self.get_origin()
8928
+ action = ["acc_a", "", origin, time_stamp]
8929
+ self.__extra_actions.append(action)
8930
+ return alert
8891
8931
8892
8932
def dismiss_alert(self, timeout=None):
8893
8933
"""Same as wait_for_and_dismiss_alert(), but smaller default T_O"""
@@ -8896,7 +8936,17 @@ def dismiss_alert(self, timeout=None):
8896
8936
timeout = settings.SMALL_TIMEOUT
8897
8937
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
8898
8938
timeout = self.__get_new_timeout(timeout)
8899
- return page_actions.wait_for_and_dismiss_alert(self.driver, timeout)
8939
+ alert = page_actions.wait_for_and_dismiss_alert(self.driver, timeout)
8940
+ if self.recorder_mode:
8941
+ url = self.get_current_url()
8942
+ if url and len(url) > 0:
8943
+ if ("http:") in url or ("https:") in url or ("file:") in url:
8944
+ if self.get_session_storage_item("pause_recorder") == "no":
8945
+ time_stamp = self.execute_script("return Date.now();")
8946
+ origin = self.get_origin()
8947
+ action = ["dis_a", "", origin, time_stamp]
8948
+ self.__extra_actions.append(action)
8949
+ return alert
8900
8950
8901
8951
def switch_to_alert(self, timeout=None):
8902
8952
"""Same as wait_for_and_switch_to_alert(), but smaller default T_O"""
0 commit comments