Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 /*
|
Chris@0
|
4 * This file is part of the Mink package.
|
Chris@0
|
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
|
Chris@0
|
6 *
|
Chris@0
|
7 * For the full copyright and license information, please view the LICENSE
|
Chris@0
|
8 * file that was distributed with this source code.
|
Chris@0
|
9 */
|
Chris@0
|
10
|
Chris@0
|
11 namespace Behat\Mink\Driver;
|
Chris@0
|
12
|
Chris@0
|
13 use Behat\Mink\Element\NodeElement;
|
Chris@0
|
14 use Behat\Mink\Exception\DriverException;
|
Chris@0
|
15 use Behat\Mink\Exception\UnsupportedDriverActionException;
|
Chris@0
|
16 use Behat\Mink\Session;
|
Chris@0
|
17
|
Chris@0
|
18 /**
|
Chris@0
|
19 * Driver interface.
|
Chris@0
|
20 *
|
Chris@0
|
21 * @author Konstantin Kudryashov <ever.zet@gmail.com>
|
Chris@0
|
22 */
|
Chris@0
|
23 interface DriverInterface
|
Chris@0
|
24 {
|
Chris@0
|
25 /**
|
Chris@0
|
26 * Sets driver's current session.
|
Chris@0
|
27 *
|
Chris@0
|
28 * @param Session $session
|
Chris@0
|
29 */
|
Chris@0
|
30 public function setSession(Session $session);
|
Chris@0
|
31
|
Chris@0
|
32 /**
|
Chris@0
|
33 * Starts driver.
|
Chris@0
|
34 *
|
Chris@0
|
35 * Once started, the driver should be ready to visit a page.
|
Chris@0
|
36 *
|
Chris@0
|
37 * Calling any action before visiting a page is an undefined behavior.
|
Chris@0
|
38 * The only supported method calls on a fresh driver are
|
Chris@0
|
39 * - visit()
|
Chris@0
|
40 * - setRequestHeader()
|
Chris@0
|
41 * - setBasicAuth()
|
Chris@0
|
42 * - reset()
|
Chris@0
|
43 * - stop()
|
Chris@0
|
44 *
|
Chris@0
|
45 * Calling start on a started driver is an undefined behavior. Driver
|
Chris@0
|
46 * implementations are free to handle it silently or to fail with an
|
Chris@0
|
47 * exception.
|
Chris@0
|
48 *
|
Chris@0
|
49 * @throws DriverException When the driver cannot be started
|
Chris@0
|
50 */
|
Chris@0
|
51 public function start();
|
Chris@0
|
52
|
Chris@0
|
53 /**
|
Chris@0
|
54 * Checks whether driver is started.
|
Chris@0
|
55 *
|
Chris@0
|
56 * @return Boolean
|
Chris@0
|
57 */
|
Chris@0
|
58 public function isStarted();
|
Chris@0
|
59
|
Chris@0
|
60 /**
|
Chris@0
|
61 * Stops driver.
|
Chris@0
|
62 *
|
Chris@0
|
63 * Once stopped, the driver should be started again before using it again.
|
Chris@0
|
64 *
|
Chris@0
|
65 * Calling any action on a stopped driver is an undefined behavior.
|
Chris@0
|
66 * The only supported method call after stopping a driver is starting it again.
|
Chris@0
|
67 *
|
Chris@0
|
68 * Calling stop on a stopped driver is an undefined behavior. Driver
|
Chris@0
|
69 * implementations are free to handle it silently or to fail with an
|
Chris@0
|
70 * exception.
|
Chris@0
|
71 *
|
Chris@0
|
72 * @throws DriverException When the driver cannot be closed
|
Chris@0
|
73 */
|
Chris@0
|
74 public function stop();
|
Chris@0
|
75
|
Chris@0
|
76 /**
|
Chris@0
|
77 * Resets driver state.
|
Chris@0
|
78 *
|
Chris@0
|
79 * This should reset cookies, request headers and basic authentication.
|
Chris@0
|
80 * When possible, the history should be reset as well, but this is not enforced
|
Chris@0
|
81 * as some implementations may not be able to reset it without restarting the
|
Chris@0
|
82 * driver entirely. Consumers requiring a clean history should restart the driver
|
Chris@0
|
83 * to enforce it.
|
Chris@0
|
84 *
|
Chris@0
|
85 * Once reset, the driver should be ready to visit a page.
|
Chris@0
|
86 * Calling any action before visiting a page is an undefined behavior.
|
Chris@0
|
87 * The only supported method calls on a fresh driver are
|
Chris@0
|
88 * - visit()
|
Chris@0
|
89 * - setRequestHeader()
|
Chris@0
|
90 * - setBasicAuth()
|
Chris@0
|
91 * - reset()
|
Chris@0
|
92 * - stop()
|
Chris@0
|
93 *
|
Chris@0
|
94 * Calling reset on a stopped driver is an undefined behavior.
|
Chris@0
|
95 */
|
Chris@0
|
96 public function reset();
|
Chris@0
|
97
|
Chris@0
|
98 /**
|
Chris@0
|
99 * Visit specified URL.
|
Chris@0
|
100 *
|
Chris@0
|
101 * @param string $url url of the page
|
Chris@0
|
102 *
|
Chris@0
|
103 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
104 * @throws DriverException When the operation cannot be done
|
Chris@0
|
105 */
|
Chris@0
|
106 public function visit($url);
|
Chris@0
|
107
|
Chris@0
|
108 /**
|
Chris@0
|
109 * Returns current URL address.
|
Chris@0
|
110 *
|
Chris@0
|
111 * @return string
|
Chris@0
|
112 *
|
Chris@0
|
113 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
114 * @throws DriverException When the operation cannot be done
|
Chris@0
|
115 */
|
Chris@0
|
116 public function getCurrentUrl();
|
Chris@0
|
117
|
Chris@0
|
118 /**
|
Chris@0
|
119 * Reloads current page.
|
Chris@0
|
120 *
|
Chris@0
|
121 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
122 * @throws DriverException When the operation cannot be done
|
Chris@0
|
123 */
|
Chris@0
|
124 public function reload();
|
Chris@0
|
125
|
Chris@0
|
126 /**
|
Chris@0
|
127 * Moves browser forward 1 page.
|
Chris@0
|
128 *
|
Chris@0
|
129 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
130 * @throws DriverException When the operation cannot be done
|
Chris@0
|
131 */
|
Chris@0
|
132 public function forward();
|
Chris@0
|
133
|
Chris@0
|
134 /**
|
Chris@0
|
135 * Moves browser backward 1 page.
|
Chris@0
|
136 *
|
Chris@0
|
137 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
138 * @throws DriverException When the operation cannot be done
|
Chris@0
|
139 */
|
Chris@0
|
140 public function back();
|
Chris@0
|
141
|
Chris@0
|
142 /**
|
Chris@0
|
143 * Sets HTTP Basic authentication parameters.
|
Chris@0
|
144 *
|
Chris@0
|
145 * @param string|Boolean $user user name or false to disable authentication
|
Chris@0
|
146 * @param string $password password
|
Chris@0
|
147 *
|
Chris@0
|
148 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
149 * @throws DriverException When the operation cannot be done
|
Chris@0
|
150 */
|
Chris@0
|
151 public function setBasicAuth($user, $password);
|
Chris@0
|
152
|
Chris@0
|
153 /**
|
Chris@0
|
154 * Switches to specific browser window.
|
Chris@0
|
155 *
|
Chris@0
|
156 * @param string $name window name (null for switching back to main window)
|
Chris@0
|
157 *
|
Chris@0
|
158 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
159 * @throws DriverException When the operation cannot be done
|
Chris@0
|
160 */
|
Chris@0
|
161 public function switchToWindow($name = null);
|
Chris@0
|
162
|
Chris@0
|
163 /**
|
Chris@0
|
164 * Switches to specific iFrame.
|
Chris@0
|
165 *
|
Chris@0
|
166 * @param string $name iframe name (null for switching back)
|
Chris@0
|
167 *
|
Chris@0
|
168 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
169 * @throws DriverException When the operation cannot be done
|
Chris@0
|
170 */
|
Chris@0
|
171 public function switchToIFrame($name = null);
|
Chris@0
|
172
|
Chris@0
|
173 /**
|
Chris@0
|
174 * Sets specific request header on client.
|
Chris@0
|
175 *
|
Chris@0
|
176 * @param string $name
|
Chris@0
|
177 * @param string $value
|
Chris@0
|
178 *
|
Chris@0
|
179 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
180 * @throws DriverException When the operation cannot be done
|
Chris@0
|
181 */
|
Chris@0
|
182 public function setRequestHeader($name, $value);
|
Chris@0
|
183
|
Chris@0
|
184 /**
|
Chris@0
|
185 * Returns last response headers.
|
Chris@0
|
186 *
|
Chris@0
|
187 * @return array
|
Chris@0
|
188 *
|
Chris@0
|
189 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
190 * @throws DriverException When the operation cannot be done
|
Chris@0
|
191 */
|
Chris@0
|
192 public function getResponseHeaders();
|
Chris@0
|
193
|
Chris@0
|
194 /**
|
Chris@0
|
195 * Sets cookie.
|
Chris@0
|
196 *
|
Chris@0
|
197 * @param string $name
|
Chris@0
|
198 * @param string $value
|
Chris@0
|
199 *
|
Chris@0
|
200 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
201 * @throws DriverException When the operation cannot be done
|
Chris@0
|
202 */
|
Chris@0
|
203 public function setCookie($name, $value = null);
|
Chris@0
|
204
|
Chris@0
|
205 /**
|
Chris@0
|
206 * Returns cookie by name.
|
Chris@0
|
207 *
|
Chris@0
|
208 * @param string $name
|
Chris@0
|
209 *
|
Chris@0
|
210 * @return string|null
|
Chris@0
|
211 *
|
Chris@0
|
212 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
213 * @throws DriverException When the operation cannot be done
|
Chris@0
|
214 */
|
Chris@0
|
215 public function getCookie($name);
|
Chris@0
|
216
|
Chris@0
|
217 /**
|
Chris@0
|
218 * Returns last response status code.
|
Chris@0
|
219 *
|
Chris@0
|
220 * @return int
|
Chris@0
|
221 *
|
Chris@0
|
222 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
223 * @throws DriverException When the operation cannot be done
|
Chris@0
|
224 */
|
Chris@0
|
225 public function getStatusCode();
|
Chris@0
|
226
|
Chris@0
|
227 /**
|
Chris@0
|
228 * Returns last response content.
|
Chris@0
|
229 *
|
Chris@0
|
230 * @return string
|
Chris@0
|
231 *
|
Chris@0
|
232 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
233 * @throws DriverException When the operation cannot be done
|
Chris@0
|
234 */
|
Chris@0
|
235 public function getContent();
|
Chris@0
|
236
|
Chris@0
|
237 /**
|
Chris@0
|
238 * Capture a screenshot of the current window.
|
Chris@0
|
239 *
|
Chris@0
|
240 * @return string screenshot of MIME type image/* depending
|
Chris@0
|
241 * on driver (e.g., image/png, image/jpeg)
|
Chris@0
|
242 *
|
Chris@0
|
243 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
244 * @throws DriverException When the operation cannot be done
|
Chris@0
|
245 */
|
Chris@0
|
246 public function getScreenshot();
|
Chris@0
|
247
|
Chris@0
|
248 /**
|
Chris@0
|
249 * Return the names of all open windows.
|
Chris@0
|
250 *
|
Chris@0
|
251 * @return array array of all open windows
|
Chris@0
|
252 *
|
Chris@0
|
253 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
254 * @throws DriverException When the operation cannot be done
|
Chris@0
|
255 */
|
Chris@0
|
256 public function getWindowNames();
|
Chris@0
|
257
|
Chris@0
|
258 /**
|
Chris@0
|
259 * Return the name of the currently active window.
|
Chris@0
|
260 *
|
Chris@0
|
261 * @return string the name of the current window
|
Chris@0
|
262 *
|
Chris@0
|
263 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
264 * @throws DriverException When the operation cannot be done
|
Chris@0
|
265 */
|
Chris@0
|
266 public function getWindowName();
|
Chris@0
|
267
|
Chris@0
|
268 /**
|
Chris@0
|
269 * Finds elements with specified XPath query.
|
Chris@0
|
270 *
|
Chris@0
|
271 * @param string $xpath
|
Chris@0
|
272 *
|
Chris@0
|
273 * @return NodeElement[]
|
Chris@0
|
274 *
|
Chris@0
|
275 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
276 * @throws DriverException When the operation cannot be done
|
Chris@0
|
277 */
|
Chris@0
|
278 public function find($xpath);
|
Chris@0
|
279
|
Chris@0
|
280 /**
|
Chris@0
|
281 * Returns element's tag name by it's XPath query.
|
Chris@0
|
282 *
|
Chris@0
|
283 * @param string $xpath
|
Chris@0
|
284 *
|
Chris@0
|
285 * @return string
|
Chris@0
|
286 *
|
Chris@0
|
287 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
288 * @throws DriverException When the operation cannot be done
|
Chris@0
|
289 */
|
Chris@0
|
290 public function getTagName($xpath);
|
Chris@0
|
291
|
Chris@0
|
292 /**
|
Chris@0
|
293 * Returns element's text by it's XPath query.
|
Chris@0
|
294 *
|
Chris@0
|
295 * @param string $xpath
|
Chris@0
|
296 *
|
Chris@0
|
297 * @return string
|
Chris@0
|
298 *
|
Chris@0
|
299 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
300 * @throws DriverException When the operation cannot be done
|
Chris@0
|
301 */
|
Chris@0
|
302 public function getText($xpath);
|
Chris@0
|
303
|
Chris@0
|
304 /**
|
Chris@0
|
305 * Returns element's inner html by it's XPath query.
|
Chris@0
|
306 *
|
Chris@0
|
307 * @param string $xpath
|
Chris@0
|
308 *
|
Chris@0
|
309 * @return string
|
Chris@0
|
310 *
|
Chris@0
|
311 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
312 * @throws DriverException When the operation cannot be done
|
Chris@0
|
313 */
|
Chris@0
|
314 public function getHtml($xpath);
|
Chris@0
|
315
|
Chris@0
|
316 /**
|
Chris@0
|
317 * Returns element's outer html by it's XPath query.
|
Chris@0
|
318 *
|
Chris@0
|
319 * @param string $xpath
|
Chris@0
|
320 *
|
Chris@0
|
321 * @return string
|
Chris@0
|
322 *
|
Chris@0
|
323 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
324 * @throws DriverException When the operation cannot be done
|
Chris@0
|
325 */
|
Chris@0
|
326 public function getOuterHtml($xpath);
|
Chris@0
|
327
|
Chris@0
|
328 /**
|
Chris@0
|
329 * Returns element's attribute by it's XPath query.
|
Chris@0
|
330 *
|
Chris@0
|
331 * @param string $xpath
|
Chris@0
|
332 * @param string $name
|
Chris@0
|
333 *
|
Chris@0
|
334 * @return string|null
|
Chris@0
|
335 *
|
Chris@0
|
336 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
337 * @throws DriverException When the operation cannot be done
|
Chris@0
|
338 */
|
Chris@0
|
339 public function getAttribute($xpath, $name);
|
Chris@0
|
340
|
Chris@0
|
341 /**
|
Chris@0
|
342 * Returns element's value by it's XPath query.
|
Chris@0
|
343 *
|
Chris@0
|
344 * @param string $xpath
|
Chris@0
|
345 *
|
Chris@0
|
346 * @return string|bool|array
|
Chris@0
|
347 *
|
Chris@0
|
348 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
349 * @throws DriverException When the operation cannot be done
|
Chris@0
|
350 *
|
Chris@0
|
351 * @see \Behat\Mink\Element\NodeElement::getValue
|
Chris@0
|
352 */
|
Chris@0
|
353 public function getValue($xpath);
|
Chris@0
|
354
|
Chris@0
|
355 /**
|
Chris@0
|
356 * Sets element's value by it's XPath query.
|
Chris@0
|
357 *
|
Chris@0
|
358 * @param string $xpath
|
Chris@0
|
359 * @param string|bool|array $value
|
Chris@0
|
360 *
|
Chris@0
|
361 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
362 * @throws DriverException When the operation cannot be done
|
Chris@0
|
363 *
|
Chris@0
|
364 * @see \Behat\Mink\Element\NodeElement::setValue
|
Chris@0
|
365 */
|
Chris@0
|
366 public function setValue($xpath, $value);
|
Chris@0
|
367
|
Chris@0
|
368 /**
|
Chris@0
|
369 * Checks checkbox by it's XPath query.
|
Chris@0
|
370 *
|
Chris@0
|
371 * @param string $xpath
|
Chris@0
|
372 *
|
Chris@0
|
373 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
374 * @throws DriverException When the operation cannot be done
|
Chris@0
|
375 *
|
Chris@0
|
376 * @see \Behat\Mink\Element\NodeElement::check
|
Chris@0
|
377 */
|
Chris@0
|
378 public function check($xpath);
|
Chris@0
|
379
|
Chris@0
|
380 /**
|
Chris@0
|
381 * Unchecks checkbox by it's XPath query.
|
Chris@0
|
382 *
|
Chris@0
|
383 * @param string $xpath
|
Chris@0
|
384 *
|
Chris@0
|
385 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
386 * @throws DriverException When the operation cannot be done
|
Chris@0
|
387 *
|
Chris@0
|
388 * @see \Behat\Mink\Element\NodeElement::uncheck
|
Chris@0
|
389 */
|
Chris@0
|
390 public function uncheck($xpath);
|
Chris@0
|
391
|
Chris@0
|
392 /**
|
Chris@0
|
393 * Checks whether checkbox or radio button located by it's XPath query is checked.
|
Chris@0
|
394 *
|
Chris@0
|
395 * @param string $xpath
|
Chris@0
|
396 *
|
Chris@0
|
397 * @return Boolean
|
Chris@0
|
398 *
|
Chris@0
|
399 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
400 * @throws DriverException When the operation cannot be done
|
Chris@0
|
401 *
|
Chris@0
|
402 * @see \Behat\Mink\Element\NodeElement::isChecked
|
Chris@0
|
403 */
|
Chris@0
|
404 public function isChecked($xpath);
|
Chris@0
|
405
|
Chris@0
|
406 /**
|
Chris@0
|
407 * Selects option from select field or value in radio group located by it's XPath query.
|
Chris@0
|
408 *
|
Chris@0
|
409 * @param string $xpath
|
Chris@0
|
410 * @param string $value
|
Chris@0
|
411 * @param Boolean $multiple
|
Chris@0
|
412 *
|
Chris@0
|
413 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
414 * @throws DriverException When the operation cannot be done
|
Chris@0
|
415 *
|
Chris@0
|
416 * @see \Behat\Mink\Element\NodeElement::selectOption
|
Chris@0
|
417 */
|
Chris@0
|
418 public function selectOption($xpath, $value, $multiple = false);
|
Chris@0
|
419
|
Chris@0
|
420 /**
|
Chris@0
|
421 * Checks whether select option, located by it's XPath query, is selected.
|
Chris@0
|
422 *
|
Chris@0
|
423 * @param string $xpath
|
Chris@0
|
424 *
|
Chris@0
|
425 * @return Boolean
|
Chris@0
|
426 *
|
Chris@0
|
427 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
428 * @throws DriverException When the operation cannot be done
|
Chris@0
|
429 *
|
Chris@0
|
430 * @see \Behat\Mink\Element\NodeElement::isSelected
|
Chris@0
|
431 */
|
Chris@0
|
432 public function isSelected($xpath);
|
Chris@0
|
433
|
Chris@0
|
434 /**
|
Chris@0
|
435 * Clicks button or link located by it's XPath query.
|
Chris@0
|
436 *
|
Chris@0
|
437 * @param string $xpath
|
Chris@0
|
438 *
|
Chris@0
|
439 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
440 * @throws DriverException When the operation cannot be done
|
Chris@0
|
441 */
|
Chris@0
|
442 public function click($xpath);
|
Chris@0
|
443
|
Chris@0
|
444 /**
|
Chris@0
|
445 * Double-clicks button or link located by it's XPath query.
|
Chris@0
|
446 *
|
Chris@0
|
447 * @param string $xpath
|
Chris@0
|
448 *
|
Chris@0
|
449 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
450 * @throws DriverException When the operation cannot be done
|
Chris@0
|
451 */
|
Chris@0
|
452 public function doubleClick($xpath);
|
Chris@0
|
453
|
Chris@0
|
454 /**
|
Chris@0
|
455 * Right-clicks button or link located by it's XPath query.
|
Chris@0
|
456 *
|
Chris@0
|
457 * @param string $xpath
|
Chris@0
|
458 *
|
Chris@0
|
459 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
460 * @throws DriverException When the operation cannot be done
|
Chris@0
|
461 */
|
Chris@0
|
462 public function rightClick($xpath);
|
Chris@0
|
463
|
Chris@0
|
464 /**
|
Chris@0
|
465 * Attaches file path to file field located by it's XPath query.
|
Chris@0
|
466 *
|
Chris@0
|
467 * @param string $xpath
|
Chris@0
|
468 * @param string $path
|
Chris@0
|
469 *
|
Chris@0
|
470 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
471 * @throws DriverException When the operation cannot be done
|
Chris@0
|
472 *
|
Chris@0
|
473 * @see \Behat\Mink\Element\NodeElement::attachFile
|
Chris@0
|
474 */
|
Chris@0
|
475 public function attachFile($xpath, $path);
|
Chris@0
|
476
|
Chris@0
|
477 /**
|
Chris@0
|
478 * Checks whether element visible located by it's XPath query.
|
Chris@0
|
479 *
|
Chris@0
|
480 * @param string $xpath
|
Chris@0
|
481 *
|
Chris@0
|
482 * @return Boolean
|
Chris@0
|
483 *
|
Chris@0
|
484 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
485 * @throws DriverException When the operation cannot be done
|
Chris@0
|
486 */
|
Chris@0
|
487 public function isVisible($xpath);
|
Chris@0
|
488
|
Chris@0
|
489 /**
|
Chris@0
|
490 * Simulates a mouse over on the element.
|
Chris@0
|
491 *
|
Chris@0
|
492 * @param string $xpath
|
Chris@0
|
493 *
|
Chris@0
|
494 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
495 * @throws DriverException When the operation cannot be done
|
Chris@0
|
496 */
|
Chris@0
|
497 public function mouseOver($xpath);
|
Chris@0
|
498
|
Chris@0
|
499 /**
|
Chris@0
|
500 * Brings focus to element.
|
Chris@0
|
501 *
|
Chris@0
|
502 * @param string $xpath
|
Chris@0
|
503 *
|
Chris@0
|
504 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
505 * @throws DriverException When the operation cannot be done
|
Chris@0
|
506 */
|
Chris@0
|
507 public function focus($xpath);
|
Chris@0
|
508
|
Chris@0
|
509 /**
|
Chris@0
|
510 * Removes focus from element.
|
Chris@0
|
511 *
|
Chris@0
|
512 * @param string $xpath
|
Chris@0
|
513 *
|
Chris@0
|
514 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
515 * @throws DriverException When the operation cannot be done
|
Chris@0
|
516 */
|
Chris@0
|
517 public function blur($xpath);
|
Chris@0
|
518
|
Chris@0
|
519 /**
|
Chris@0
|
520 * Presses specific keyboard key.
|
Chris@0
|
521 *
|
Chris@0
|
522 * @param string $xpath
|
Chris@0
|
523 * @param string|int $char could be either char ('b') or char-code (98)
|
Chris@0
|
524 * @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
|
Chris@0
|
525 *
|
Chris@0
|
526 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
527 * @throws DriverException When the operation cannot be done
|
Chris@0
|
528 */
|
Chris@0
|
529 public function keyPress($xpath, $char, $modifier = null);
|
Chris@0
|
530
|
Chris@0
|
531 /**
|
Chris@0
|
532 * Pressed down specific keyboard key.
|
Chris@0
|
533 *
|
Chris@0
|
534 * @param string $xpath
|
Chris@0
|
535 * @param string|int $char could be either char ('b') or char-code (98)
|
Chris@0
|
536 * @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
|
Chris@0
|
537 *
|
Chris@0
|
538 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
539 * @throws DriverException When the operation cannot be done
|
Chris@0
|
540 */
|
Chris@0
|
541 public function keyDown($xpath, $char, $modifier = null);
|
Chris@0
|
542
|
Chris@0
|
543 /**
|
Chris@0
|
544 * Pressed up specific keyboard key.
|
Chris@0
|
545 *
|
Chris@0
|
546 * @param string $xpath
|
Chris@0
|
547 * @param string|int $char could be either char ('b') or char-code (98)
|
Chris@0
|
548 * @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta')
|
Chris@0
|
549 *
|
Chris@0
|
550 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
551 * @throws DriverException When the operation cannot be done
|
Chris@0
|
552 */
|
Chris@0
|
553 public function keyUp($xpath, $char, $modifier = null);
|
Chris@0
|
554
|
Chris@0
|
555 /**
|
Chris@0
|
556 * Drag one element onto another.
|
Chris@0
|
557 *
|
Chris@0
|
558 * @param string $sourceXpath
|
Chris@0
|
559 * @param string $destinationXpath
|
Chris@0
|
560 *
|
Chris@0
|
561 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
562 * @throws DriverException When the operation cannot be done
|
Chris@0
|
563 */
|
Chris@0
|
564 public function dragTo($sourceXpath, $destinationXpath);
|
Chris@0
|
565
|
Chris@0
|
566 /**
|
Chris@0
|
567 * Executes JS script.
|
Chris@0
|
568 *
|
Chris@0
|
569 * @param string $script
|
Chris@0
|
570 *
|
Chris@0
|
571 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
572 * @throws DriverException When the operation cannot be done
|
Chris@0
|
573 */
|
Chris@0
|
574 public function executeScript($script);
|
Chris@0
|
575
|
Chris@0
|
576 /**
|
Chris@0
|
577 * Evaluates JS script.
|
Chris@0
|
578 *
|
Chris@0
|
579 * The "return" keyword is optional in the script passed as argument. Driver implementations
|
Chris@0
|
580 * must accept the expression both with and without the keyword.
|
Chris@0
|
581 *
|
Chris@0
|
582 * @param string $script
|
Chris@0
|
583 *
|
Chris@0
|
584 * @return mixed
|
Chris@0
|
585 *
|
Chris@0
|
586 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
587 * @throws DriverException When the operation cannot be done
|
Chris@0
|
588 */
|
Chris@0
|
589 public function evaluateScript($script);
|
Chris@0
|
590
|
Chris@0
|
591 /**
|
Chris@0
|
592 * Waits some time or until JS condition turns true.
|
Chris@0
|
593 *
|
Chris@0
|
594 * @param int $timeout timeout in milliseconds
|
Chris@0
|
595 * @param string $condition JS condition
|
Chris@0
|
596 *
|
Chris@0
|
597 * @return bool
|
Chris@0
|
598 *
|
Chris@0
|
599 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
600 * @throws DriverException When the operation cannot be done
|
Chris@0
|
601 */
|
Chris@0
|
602 public function wait($timeout, $condition);
|
Chris@0
|
603
|
Chris@0
|
604 /**
|
Chris@0
|
605 * Set the dimensions of the window.
|
Chris@0
|
606 *
|
Chris@0
|
607 * @param int $width set the window width, measured in pixels
|
Chris@0
|
608 * @param int $height set the window height, measured in pixels
|
Chris@0
|
609 * @param string $name window name (null for the main window)
|
Chris@0
|
610 *
|
Chris@0
|
611 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
612 * @throws DriverException When the operation cannot be done
|
Chris@0
|
613 */
|
Chris@0
|
614 public function resizeWindow($width, $height, $name = null);
|
Chris@0
|
615
|
Chris@0
|
616 /**
|
Chris@0
|
617 * Maximizes the window if it is not maximized already.
|
Chris@0
|
618 *
|
Chris@0
|
619 * @param string $name window name (null for the main window)
|
Chris@0
|
620 *
|
Chris@0
|
621 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
622 * @throws DriverException When the operation cannot be done
|
Chris@0
|
623 */
|
Chris@0
|
624 public function maximizeWindow($name = null);
|
Chris@0
|
625
|
Chris@0
|
626 /**
|
Chris@0
|
627 * Submits the form.
|
Chris@0
|
628 *
|
Chris@0
|
629 * @param string $xpath Xpath.
|
Chris@0
|
630 *
|
Chris@0
|
631 * @throws UnsupportedDriverActionException When operation not supported by the driver
|
Chris@0
|
632 * @throws DriverException When the operation cannot be done
|
Chris@0
|
633 *
|
Chris@0
|
634 * @see \Behat\Mink\Element\NodeElement::submitForm
|
Chris@0
|
635 */
|
Chris@0
|
636 public function submitForm($xpath);
|
Chris@0
|
637 }
|