@@ -142,9 +142,12 @@ def hover_and_click(driver, hover_selector, click_selector,
142
142
if now_ms >= stop_ms :
143
143
break
144
144
time .sleep (0.1 )
145
+ plural = "s"
146
+ if timeout == 1 :
147
+ plural = ""
145
148
raise NoSuchElementException (
146
- "Element {%s} was not present after %s seconds !" %
147
- ( click_selector , timeout ))
149
+ "Element {%s} was not present after %s second%s !" % (
150
+ click_selector , timeout , plural ))
148
151
149
152
150
153
def hover_element_and_click (driver , element , click_selector ,
@@ -167,9 +170,12 @@ def hover_element_and_click(driver, element, click_selector,
167
170
if now_ms >= stop_ms :
168
171
break
169
172
time .sleep (0.1 )
173
+ plural = "s"
174
+ if timeout == 1 :
175
+ plural = ""
170
176
raise NoSuchElementException (
171
- "Element {%s} was not present after %s seconds !" %
172
- ( click_selector , timeout ))
177
+ "Element {%s} was not present after %s second%s !" % (
178
+ click_selector , timeout , plural ))
173
179
174
180
175
181
def hover_element_and_double_click (driver , element , click_selector ,
@@ -192,9 +198,12 @@ def hover_element_and_double_click(driver, element, click_selector,
192
198
if now_ms >= stop_ms :
193
199
break
194
200
time .sleep (0.1 )
201
+ plural = "s"
202
+ if timeout == 1 :
203
+ plural = ""
195
204
raise NoSuchElementException (
196
- "Element {%s} was not present after %s seconds !" %
197
- ( click_selector , timeout ))
205
+ "Element {%s} was not present after %s second%s !" % (
206
+ click_selector , timeout , plural ))
198
207
199
208
200
209
def wait_for_element_present (driver , selector , by = By .CSS_SELECTOR ,
@@ -225,10 +234,13 @@ def wait_for_element_present(driver, selector, by=By.CSS_SELECTOR,
225
234
if now_ms >= stop_ms :
226
235
break
227
236
time .sleep (0.1 )
237
+ plural = "s"
238
+ if timeout == 1 :
239
+ plural = ""
228
240
if not element :
229
241
raise NoSuchElementException (
230
- "Element {%s} was not present after %s seconds !" % (
231
- selector , timeout ))
242
+ "Element {%s} was not present after %s second%s !" % (
243
+ selector , timeout , plural ))
232
244
233
245
234
246
def wait_for_element_visible (driver , selector , by = By .CSS_SELECTOR ,
0 commit comments