@@ -355,9 +355,7 @@ def click(
355
355
if self.__is_shadow_selector(selector):
356
356
self.__shadow_click(selector, timeout)
357
357
return
358
- if self.browser == "safari":
359
- self.wait_for_ready_state_complete()
360
- if self.__needs_minimum_wait():
358
+ if self.__needs_minimum_wait() or self.browser == "safari":
361
359
time.sleep(0.022)
362
360
element = page_actions.wait_for_element_visible(
363
361
self.driver,
@@ -374,9 +372,7 @@ def click(
374
372
try:
375
373
if (
376
374
by == By.LINK_TEXT
377
- and (
378
- self.browser == "ie" or self.browser == "safari"
379
- )
375
+ and (self.browser == "ie" or self.browser == "safari")
380
376
):
381
377
self.__jquery_click(selector, by=by)
382
378
else:
@@ -598,8 +594,6 @@ def click(
598
594
self.__demo_mode_pause_if_active(tiny=True)
599
595
elif self.slow_mode:
600
596
self.__slow_mode_pause_if_active()
601
- elif self.browser == "safari":
602
- self.wait_for_ready_state_complete()
603
597
604
598
def slow_click(self, selector, by="css selector", timeout=None):
605
599
"""Similar to click(), but pauses for a brief moment before clicking.
@@ -2969,7 +2963,7 @@ def load_html_string(self, html_string, new_page=True):
2969
2963
html_string = html_string.replace("\\ ", " ")
2970
2964
2971
2965
if new_page:
2972
- self.open("data:text/html,<head></head><body></body>")
2966
+ self.open("data:text/html,<head></head><body><div></div>< /body>")
2973
2967
inner_head = """document.getElementsByTagName("head")[0].innerHTML"""
2974
2968
inner_body = """document.getElementsByTagName("body")[0].innerHTML"""
2975
2969
try:
@@ -3011,8 +3005,7 @@ def load_html_file(self, html_file, new_page=True):
3011
3005
"""Loads a local html file into the browser from a relative file path.
3012
3006
If new_page==True, the page will switch to: "data:text/html,"
3013
3007
If new_page==False, will load HTML into the current page.
3014
- Local images and other local src content WILL BE IGNORED.
3015
- """
3008
+ Local images and other local src content WILL BE IGNORED."""
3016
3009
self.__check_scope()
3017
3010
if self.__looks_like_a_page_url(html_file):
3018
3011
self.open(html_file)
@@ -3032,8 +3025,7 @@ def load_html_file(self, html_file, new_page=True):
3032
3025
3033
3026
def open_html_file(self, html_file):
3034
3027
"""Opens a local html file into the browser from a relative file path.
3035
- The URL displayed in the web browser will start with "file://".
3036
- """
3028
+ The URL displayed in the web browser will start with "file://"."""
3037
3029
self.__check_scope()
3038
3030
if self.__looks_like_a_page_url(html_file):
3039
3031
self.open(html_file)
0 commit comments