MCPcopy Index your code
hub / github.com/seleniumbase/SeleniumBase / sleep

Method sleep

seleniumbase/fixtures/base_case.py:4996–5017  ·  view source on GitHub ↗
(self, seconds)

Source from the content-addressed store, hash-verified

4994 return True
4995
4996 def sleep(self, seconds):
4997 self.__check_scope()
4998 if not getattr(sb_config, "time_limit", None):
4999 time.sleep(seconds)
5000 elif seconds < 0.4:
5001 shared_utils.check_if_time_limit_exceeded()
5002 time.sleep(seconds)
5003 shared_utils.check_if_time_limit_exceeded()
5004 else:
5005 start_ms = time.time() * 1000.0
5006 stop_ms = start_ms + (seconds * 1000.0)
5007 for x in range(int(seconds * 5)):
5008 shared_utils.check_if_time_limit_exceeded()
5009 now_ms = time.time() * 1000.0
5010 if now_ms >= stop_ms:
5011 break
5012 time.sleep(0.2)
5013 if self.recorder_mode and getattr(sb_config, "record_sleep", None):
5014 time_stamp = self.execute_script("return Date.now();")
5015 origin = self.get_origin()
5016 action = ["sleep", seconds, origin, time_stamp]
5017 self.__extra_actions.append(action)
5018
5019 def install_addon(self, xpi_file):
5020 """Installs a Firefox add-on instantly at run-time.

Callers 15

click_if_visibleMethod · 0.95
get_pdf_textMethod · 0.95
waitMethod · 0.95
__click_with_offsetMethod · 0.95
openMethod · 0.45
clickMethod · 0.45
double_clickMethod · 0.45
context_clickMethod · 0.45
click_chainMethod · 0.45
update_textMethod · 0.45
add_textMethod · 0.45
press_keysMethod · 0.45

Calls 3

__check_scopeMethod · 0.95
execute_scriptMethod · 0.95
get_originMethod · 0.95

Tested by

no test coverage detected