Skip to content

Commit 0f7b24d

Browse files
committed
Update method names to be more clear
1 parent 5015c06 commit 0f7b24d

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

help_docs/method_summary.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ self.is_text_visible(text, selector, by=By.CSS_SELECTOR)
7373

7474
self.find_visible_elements(selector, by=By.CSS_SELECTOR)
7575

76-
self.is_element_in_frame(selector, by=By.CSS_SELECTOR)
76+
self.is_element_in_an_iframe(selector, by=By.CSS_SELECTOR)
7777

78-
self.enter_frame_of_element(selector, by=By.CSS_SELECTOR)
78+
self.switch_to_frame_of_element(selector, by=By.CSS_SELECTOR)
7979

8080
self.execute_script(script)
8181

seleniumbase/fixtures/base_case.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,8 @@ def find_visible_elements(self, selector, by=By.CSS_SELECTOR):
615615
by = By.LINK_TEXT
616616
return page_actions.find_visible_elements(self.driver, selector, by)
617617

618-
def is_element_in_frame(self, selector, by=By.CSS_SELECTOR):
619-
""" Returns True if the selector's element is located in an iFrame.
618+
def is_element_in_an_iframe(self, selector, by=By.CSS_SELECTOR):
619+
""" Returns True if the selector's element is located in an iframe.
620620
Otherwise returns False. """
621621
selector, by = self._recalculate_selector(selector, by)
622622
if self.is_element_present(selector, by=by):
@@ -639,10 +639,11 @@ def is_element_in_frame(self, selector, by=By.CSS_SELECTOR):
639639
self.switch_to_default_content()
640640
return False
641641

642-
def enter_frame_of_element(self, selector, by=By.CSS_SELECTOR):
643-
""" Returns the frame name of the selector's element if in an iFrame.
644-
Also enters the iFrame if the element was inside an iFrame.
645-
If the element is not in an iFrame, returns None. """
642+
def switch_to_frame_of_element(self, selector, by=By.CSS_SELECTOR):
643+
""" Set driver control to the iframe of the element (assuming the
644+
element is in a single-nested iframe) and returns the iframe name.
645+
If element is not in an iframe, returns None, and nothing happens.
646+
May not work if multiple iframes are nested within each other. """
646647
selector, by = self._recalculate_selector(selector, by)
647648
if self.is_element_present(selector, by=by):
648649
return None

0 commit comments

Comments
 (0)