@@ -3407,6 +3407,15 @@ def sleep(self, seconds):
3407
3407
if now_ms >= stop_ms:
3408
3408
break
3409
3409
time.sleep(0.2)
3410
+ if (
3411
+ self.recorder_mode
3412
+ and hasattr(sb_config, "record_sleep")
3413
+ and sb_config.record_sleep
3414
+ ):
3415
+ time_stamp = self.execute_script("return Date.now();")
3416
+ origin = self.get_origin()
3417
+ action = ["sleep", seconds, origin, time_stamp]
3418
+ self.__extra_actions.append(action)
3410
3419
3411
3420
def install_addon(self, xpi_file):
3412
3421
"""Installs a Firefox add-on instantly at run-time.
@@ -3759,6 +3768,7 @@ def __process_recorded_actions(self):
3759
3768
ext_actions.append("sw_pf")
3760
3769
ext_actions.append("s_c_f")
3761
3770
ext_actions.append("s_c_d")
3771
+ ext_actions.append("sleep")
3762
3772
ext_actions.append("sh_fc")
3763
3773
ext_actions.append("c_l_s")
3764
3774
ext_actions.append("c_s_s")
@@ -4010,6 +4020,9 @@ def __process_recorded_actions(self):
4010
4020
sb_actions.append("self.%s()" % method)
4011
4021
else:
4012
4022
sb_actions.append("self.%s()" % method)
4023
+ elif action[0] == "sleep":
4024
+ method = "sleep"
4025
+ sb_actions.append("self.%s(%s)" % (method, action[1]))
4013
4026
elif action[0] == "as_el":
4014
4027
method = "assert_element"
4015
4028
if '"' not in action[1]:
0 commit comments