@@ -67,9 +67,15 @@ def click_link_text(self, link_text, timeout=settings.SMALL_TIMEOUT):
67
67
if settings .WAIT_FOR_RSC_ON_CLICKS :
68
68
self .wait_for_ready_state_complete ()
69
69
70
+ def add_text (self , selector , new_value , timeout = settings .SMALL_TIMEOUT ):
71
+ """ The more-reliable version of driver.send_keys()
72
+ Similar to update_text(), but won't clear the text field first. """
73
+ element = self .wait_for_element_visible (selector , timeout = timeout )
74
+ element .send_keys (new_value )
75
+
70
76
def update_text_value (self , selector , new_value ,
71
77
timeout = settings .SMALL_TIMEOUT , retry = False ):
72
- """ This method updates a selector 's text value with a new value
78
+ """ This method updates an element 's text value with a new value.
73
79
@Params
74
80
selector - the selector with the value to update
75
81
new_value - the new value for setting the text field
@@ -85,6 +91,14 @@ def update_text_value(self, selector, new_value,
85
91
selector = self .jq_format (selector )
86
92
self .set_value (selector , new_value )
87
93
94
+ def update_text (self , selector , new_value ,
95
+ timeout = settings .SMALL_TIMEOUT , retry = False ):
96
+ """ The shorter version of update_text_value(), which
97
+ clears existing text and adds new text into the text field.
98
+ We want to keep the old version for backward compatibility. """
99
+ self .update_text_value (selector , new_value ,
100
+ timeout = timeout , retry = retry )
101
+
88
102
def is_element_present (self , selector , by = By .CSS_SELECTOR ):
89
103
return page_actions .is_element_present (self .driver , selector , by )
90
104
@@ -145,6 +159,10 @@ def jquery_update_text_value(self, selector, new_value,
145
159
if new_value .endswith ('\n ' ):
146
160
element .send_keys ('\n ' )
147
161
162
+ def jquery_update_text (self , selector , new_value ,
163
+ timeout = settings .SMALL_TIMEOUT ):
164
+ self .jquery_update_text_value (selector , new_value , timeout = timeout )
165
+
148
166
def hover_on_element (self , selector ):
149
167
return page_actions .hover_on_element (self .driver , selector )
150
168
0 commit comments