Skip to content

Commit fdeafdd

Browse files
committed
Refactoring
1 parent 4bb72a9 commit fdeafdd

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2860,22 +2860,30 @@ def open_url(self, url):
28602860
""" Same as open() - Original saved for backwards compatibility. """
28612861
self.open(url)
28622862

2863-
def get(self, url):
2864-
""" Same as open() - WebDriver uses this method name. """
2863+
def visit(self, url):
2864+
""" Same as open() - Some test frameworks use this method name. """
28652865
self.open(url)
28662866

2867-
def visit(self, url):
2868-
""" Same as open() - Some JS frameworks use this method name. """
2867+
def visit_url(self, url):
2868+
""" Same as open() - Some test frameworks use this method name. """
28692869
self.open(url)
28702870

28712871
def goto(self, url):
2872-
""" Same as open() - Some JS frameworks use this method name. """
2872+
""" Same as open() - Some test frameworks use this method name. """
28732873
self.open(url)
28742874

28752875
def go_to(self, url):
28762876
""" Same as open() - Some test frameworks use this method name. """
28772877
self.open(url)
28782878

2879+
def reload(self):
2880+
""" Same as refresh_page() """
2881+
self.refresh_page()
2882+
2883+
def reload_page(self):
2884+
""" Same as refresh_page() """
2885+
self.refresh_page()
2886+
28792887
def type(self, selector, text, by=By.CSS_SELECTOR,
28802888
timeout=None, retry=False):
28812889
""" Same as update_text(). """
@@ -3607,9 +3615,10 @@ def get_element(self, selector, by=By.CSS_SELECTOR, timeout=None):
36073615
""" Same as wait_for_element_present() - returns the element.
36083616
The element does not need be visible (it may be hidden). """
36093617
if not timeout:
3610-
timeout = settings.LARGE_TIMEOUT
3611-
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
3618+
timeout = settings.SMALL_TIMEOUT
3619+
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
36123620
timeout = self.__get_new_timeout(timeout)
3621+
selector, by = self.__recalculate_selector(selector, by)
36133622
return self.wait_for_element_present(selector, by=by, timeout=timeout)
36143623

36153624
def assert_element_present(self, selector, by=By.CSS_SELECTOR,
@@ -4517,6 +4526,13 @@ def __recalculate_selector(self, selector, by):
45174526
by = By.CSS_SELECTOR
45184527
return (selector, by)
45194528

4529+
def __looks_like_a_page_url(self, url):
4530+
if (url.startswith("http://") or url.startswith("https://") or (
4531+
url.startswith("://") or page_utils.is_valid_url(url))):
4532+
return True
4533+
else:
4534+
return False
4535+
45204536
def __make_css_match_first_element_only(self, selector):
45214537
# Only get the first match
45224538
return page_utils.make_css_match_first_element_only(selector)

0 commit comments

Comments
 (0)