@@ -105,18 +105,6 @@ def open(self, url):
105105 self .wait_for_ready_state_complete ()
106106 self .__demo_mode_pause_if_active ()
107107
108- def open_url (self , url ):
109- """ Same as open() - Original saved for backwards compatibility. """
110- self .open (url )
111-
112- def get (self , url ):
113- """ Same as open() - WebDriver uses this method name. """
114- self .open (url )
115-
116- def visit (self , url ):
117- """ Same as open() - Some JS frameworks use this method name. """
118- self .open (url )
119-
120108 def click (self , selector , by = By .CSS_SELECTOR , timeout = None , delay = 0 ):
121109 if not timeout :
122110 timeout = settings .SMALL_TIMEOUT
@@ -257,30 +245,6 @@ def click_chain(self, selectors_list, by=By.CSS_SELECTOR,
257245 if spacing > 0 :
258246 time .sleep (spacing )
259247
260- def type (self , selector , text , by = By .CSS_SELECTOR ,
261- timeout = None , retry = False ):
262- """ The short version of update_text(), which clears existing text
263- and adds new text into the text field.
264- We want to keep the other version for backward compatibility. """
265- if not timeout :
266- timeout = settings .LARGE_TIMEOUT
267- if self .timeout_multiplier and timeout == settings .LARGE_TIMEOUT :
268- timeout = self .__get_new_timeout (timeout )
269- if page_utils .is_xpath_selector (selector ):
270- by = By .XPATH
271- self .update_text (selector , text , by = by , timeout = timeout , retry = retry )
272-
273- def input (self , selector , text , by = By .CSS_SELECTOR ,
274- timeout = None , retry = False ):
275- """ Same as update_text(). """
276- if not timeout :
277- timeout = settings .LARGE_TIMEOUT
278- if self .timeout_multiplier and timeout == settings .LARGE_TIMEOUT :
279- timeout = self .__get_new_timeout (timeout )
280- if page_utils .is_xpath_selector (selector ):
281- by = By .XPATH
282- self .update_text (selector , text , by = by , timeout = timeout , retry = retry )
283-
284248 def update_text (self , selector , new_value , by = By .CSS_SELECTOR ,
285249 timeout = None , retry = False ):
286250 """ This method updates an element's text field with new text.
@@ -413,16 +377,6 @@ def add_text(self, selector, text, by=By.CSS_SELECTOR, timeout=None):
413377 elif self .slow_mode :
414378 self .__slow_mode_pause_if_active ()
415379
416- def send_keys (self , selector , text , by = By .CSS_SELECTOR , timeout = None ):
417- """ Same as add_text() """
418- if not timeout :
419- timeout = settings .LARGE_TIMEOUT
420- if self .timeout_multiplier and timeout == settings .LARGE_TIMEOUT :
421- timeout = self .__get_new_timeout (timeout )
422- if page_utils .is_xpath_selector (selector ):
423- by = By .XPATH
424- self .add_text (selector , text , by = by , timeout = timeout )
425-
426380 def submit (self , selector , by = By .CSS_SELECTOR ):
427381 """ Alternative to self.driver.find_element_by_*(SELECTOR).submit() """
428382 if page_utils .is_xpath_selector (selector ):
@@ -2858,6 +2812,76 @@ def skip(self, reason=""):
28582812
28592813 ############
28602814
2815+ # Duplicates (Avoids name confusion when migrating from other frameworks.)
2816+
2817+ def open_url (self , url ):
2818+ """ Same as open() - Original saved for backwards compatibility. """
2819+ self .open (url )
2820+
2821+ def get (self , url ):
2822+ """ Same as open() - WebDriver uses this method name. """
2823+ self .open (url )
2824+
2825+ def visit (self , url ):
2826+ """ Same as open() - Some JS frameworks use this method name. """
2827+ self .open (url )
2828+
2829+ def goto (self , url ):
2830+ """ Same as open() - Some JS frameworks use this method name. """
2831+ self .open (url )
2832+
2833+ def go_to (self , url ):
2834+ """ Same as open() - Some test frameworks use this method name. """
2835+ self .open (url )
2836+
2837+ def type (self , selector , text , by = By .CSS_SELECTOR ,
2838+ timeout = None , retry = False ):
2839+ """ Same as update_text(). """
2840+ if not timeout :
2841+ timeout = settings .LARGE_TIMEOUT
2842+ if self .timeout_multiplier and timeout == settings .LARGE_TIMEOUT :
2843+ timeout = self .__get_new_timeout (timeout )
2844+ if page_utils .is_xpath_selector (selector ):
2845+ by = By .XPATH
2846+ self .update_text (selector , text , by = by , timeout = timeout , retry = retry )
2847+
2848+ def input (self , selector , text , by = By .CSS_SELECTOR ,
2849+ timeout = None , retry = False ):
2850+ """ Same as update_text(). """
2851+ if not timeout :
2852+ timeout = settings .LARGE_TIMEOUT
2853+ if self .timeout_multiplier and timeout == settings .LARGE_TIMEOUT :
2854+ timeout = self .__get_new_timeout (timeout )
2855+ if page_utils .is_xpath_selector (selector ):
2856+ by = By .XPATH
2857+ self .update_text (selector , text , by = by , timeout = timeout , retry = retry )
2858+
2859+ def write (self , selector , text , by = By .CSS_SELECTOR ,
2860+ timeout = None , retry = False ):
2861+ """ Same as update_text(). """
2862+ if not timeout :
2863+ timeout = settings .LARGE_TIMEOUT
2864+ if self .timeout_multiplier and timeout == settings .LARGE_TIMEOUT :
2865+ timeout = self .__get_new_timeout (timeout )
2866+ if page_utils .is_xpath_selector (selector ):
2867+ by = By .XPATH
2868+ self .update_text (selector , text , by = by , timeout = timeout , retry = retry )
2869+
2870+ def send_keys (self , selector , text , by = By .CSS_SELECTOR , timeout = None ):
2871+ """ Same as add_text() """
2872+ if not timeout :
2873+ timeout = settings .LARGE_TIMEOUT
2874+ if self .timeout_multiplier and timeout == settings .LARGE_TIMEOUT :
2875+ timeout = self .__get_new_timeout (timeout )
2876+ if page_utils .is_xpath_selector (selector ):
2877+ by = By .XPATH
2878+ self .add_text (selector , text , by = by , timeout = timeout )
2879+
2880+ def start_tour (self , name = None , interval = 0 ):
2881+ self .play_tour (name = name , interval = interval )
2882+
2883+ ############
2884+
28612885 def add_css_link (self , css_link ):
28622886 js_utils .add_css_link (self .driver , css_link )
28632887
@@ -3288,15 +3312,17 @@ def play_tour(self, name=None, interval=0):
32883312 def export_tour (self , name = None , filename = "my_tour.js" , url = None ):
32893313 """ Exports a tour as a JS file.
32903314 You can call self.export_tour() anywhere where you would
3291- normally use self.play_tour() to play a tour.
3315+ normally use self.play_tour() to play a website tour.
32923316 It will include necessary resources as well, such as jQuery.
32933317 You'll be able to copy the tour directly into the Console of
32943318 any web browser to play the tour outside of SeleniumBase runs.
32953319 @Params
32963320 name - If creating multiple tours at the same time,
32973321 use this to select the tour you wish to add steps to.
32983322 filename - The name of the JavaScript file that you wish to
3299- save the tour to. """
3323+ save the tour to.
3324+ url - The URL where the tour starts. If not specified, the URL
3325+ of the current page will be used. """
33003326 if not url :
33013327 url = self .get_current_url ()
33023328 tour_helper .export_tour (
0 commit comments