Complex classes like FunctionalTesterActions often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use FunctionalTesterActions, and based on these observations, apply Extract Interface, too.
1 | <?php //[STAMP] 0130fd3d10269a8451bfee2516ca6c99 |
||
12 | trait FunctionalTesterActions |
||
13 | { |
||
14 | /** |
||
15 | * @return \Codeception\Scenario |
||
16 | */ |
||
17 | abstract protected function getScenario(); |
||
18 | |||
19 | |||
20 | /** |
||
21 | * [!] Method is generated. Documentation taken from corresponding module. |
||
22 | * |
||
23 | * Enters a directory In local filesystem. |
||
24 | * Project root directory is used by default |
||
25 | * |
||
26 | * @param $path |
||
27 | * @see \Codeception\Module\Filesystem::amInPath() |
||
28 | */ |
||
29 | public function amInPath($path) { |
||
32 | |||
33 | |||
34 | /** |
||
35 | * [!] Method is generated. Documentation taken from corresponding module. |
||
36 | * |
||
37 | * Opens a file and stores it's content. |
||
38 | * |
||
39 | * Usage: |
||
40 | * |
||
41 | * ``` php |
||
42 | * <?php |
||
43 | * $I->openFile('composer.json'); |
||
44 | * $I->seeInThisFile('codeception/codeception'); |
||
45 | * ?> |
||
46 | * ``` |
||
47 | * |
||
48 | * @param $filename |
||
49 | * @see \Codeception\Module\Filesystem::openFile() |
||
50 | */ |
||
51 | public function openFile($filename) { |
||
54 | |||
55 | |||
56 | /** |
||
57 | * [!] Method is generated. Documentation taken from corresponding module. |
||
58 | * |
||
59 | * Deletes a file |
||
60 | * |
||
61 | * ``` php |
||
62 | * <?php |
||
63 | * $I->deleteFile('composer.lock'); |
||
64 | * ?> |
||
65 | * ``` |
||
66 | * |
||
67 | * @param $filename |
||
68 | * @see \Codeception\Module\Filesystem::deleteFile() |
||
69 | */ |
||
70 | public function deleteFile($filename) { |
||
73 | |||
74 | |||
75 | /** |
||
76 | * [!] Method is generated. Documentation taken from corresponding module. |
||
77 | * |
||
78 | * Deletes directory with all subdirectories |
||
79 | * |
||
80 | * ``` php |
||
81 | * <?php |
||
82 | * $I->deleteDir('vendor'); |
||
83 | * ?> |
||
84 | * ``` |
||
85 | * |
||
86 | * @param $dirname |
||
87 | * @see \Codeception\Module\Filesystem::deleteDir() |
||
88 | */ |
||
89 | public function deleteDir($dirname) { |
||
92 | |||
93 | |||
94 | /** |
||
95 | * [!] Method is generated. Documentation taken from corresponding module. |
||
96 | * |
||
97 | * Copies directory with all contents |
||
98 | * |
||
99 | * ``` php |
||
100 | * <?php |
||
101 | * $I->copyDir('vendor','old_vendor'); |
||
102 | * ?> |
||
103 | * ``` |
||
104 | * |
||
105 | * @param $src |
||
106 | * @param $dst |
||
107 | * @see \Codeception\Module\Filesystem::copyDir() |
||
108 | */ |
||
109 | public function copyDir($src, $dst) { |
||
112 | |||
113 | |||
114 | /** |
||
115 | * [!] Method is generated. Documentation taken from corresponding module. |
||
116 | * |
||
117 | * Checks If opened file has `text` in it. |
||
118 | * |
||
119 | * Usage: |
||
120 | * |
||
121 | * ``` php |
||
122 | * <?php |
||
123 | * $I->openFile('composer.json'); |
||
124 | * $I->seeInThisFile('codeception/codeception'); |
||
125 | * ?> |
||
126 | * ``` |
||
127 | * |
||
128 | * @param $text |
||
129 | * Conditional Assertion: Test won't be stopped on fail |
||
130 | * @see \Codeception\Module\Filesystem::seeInThisFile() |
||
131 | */ |
||
132 | public function canSeeInThisFile($text) { |
||
135 | /** |
||
136 | * [!] Method is generated. Documentation taken from corresponding module. |
||
137 | * |
||
138 | * Checks If opened file has `text` in it. |
||
139 | * |
||
140 | * Usage: |
||
141 | * |
||
142 | * ``` php |
||
143 | * <?php |
||
144 | * $I->openFile('composer.json'); |
||
145 | * $I->seeInThisFile('codeception/codeception'); |
||
146 | * ?> |
||
147 | * ``` |
||
148 | * |
||
149 | * @param $text |
||
150 | * @see \Codeception\Module\Filesystem::seeInThisFile() |
||
151 | */ |
||
152 | public function seeInThisFile($text) { |
||
155 | |||
156 | |||
157 | /** |
||
158 | * [!] Method is generated. Documentation taken from corresponding module. |
||
159 | * |
||
160 | * Checks the strict matching of file contents. |
||
161 | * Unlike `seeInThisFile` will fail if file has something more than expected lines. |
||
162 | * Better to use with HEREDOC strings. |
||
163 | * Matching is done after removing "\r" chars from file content. |
||
164 | * |
||
165 | * ``` php |
||
166 | * <?php |
||
167 | * $I->openFile('process.pid'); |
||
168 | * $I->seeFileContentsEqual('3192'); |
||
169 | * ?> |
||
170 | * ``` |
||
171 | * |
||
172 | * @param $text |
||
173 | * Conditional Assertion: Test won't be stopped on fail |
||
174 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() |
||
175 | */ |
||
176 | public function canSeeFileContentsEqual($text) { |
||
179 | /** |
||
180 | * [!] Method is generated. Documentation taken from corresponding module. |
||
181 | * |
||
182 | * Checks the strict matching of file contents. |
||
183 | * Unlike `seeInThisFile` will fail if file has something more than expected lines. |
||
184 | * Better to use with HEREDOC strings. |
||
185 | * Matching is done after removing "\r" chars from file content. |
||
186 | * |
||
187 | * ``` php |
||
188 | * <?php |
||
189 | * $I->openFile('process.pid'); |
||
190 | * $I->seeFileContentsEqual('3192'); |
||
191 | * ?> |
||
192 | * ``` |
||
193 | * |
||
194 | * @param $text |
||
195 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() |
||
196 | */ |
||
197 | public function seeFileContentsEqual($text) { |
||
200 | |||
201 | |||
202 | /** |
||
203 | * [!] Method is generated. Documentation taken from corresponding module. |
||
204 | * |
||
205 | * Checks If opened file doesn't contain `text` in it |
||
206 | * |
||
207 | * ``` php |
||
208 | * <?php |
||
209 | * $I->openFile('composer.json'); |
||
210 | * $I->dontSeeInThisFile('codeception/codeception'); |
||
211 | * ?> |
||
212 | * ``` |
||
213 | * |
||
214 | * @param $text |
||
215 | * Conditional Assertion: Test won't be stopped on fail |
||
216 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() |
||
217 | */ |
||
218 | public function cantSeeInThisFile($text) { |
||
221 | /** |
||
222 | * [!] Method is generated. Documentation taken from corresponding module. |
||
223 | * |
||
224 | * Checks If opened file doesn't contain `text` in it |
||
225 | * |
||
226 | * ``` php |
||
227 | * <?php |
||
228 | * $I->openFile('composer.json'); |
||
229 | * $I->dontSeeInThisFile('codeception/codeception'); |
||
230 | * ?> |
||
231 | * ``` |
||
232 | * |
||
233 | * @param $text |
||
234 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() |
||
235 | */ |
||
236 | public function dontSeeInThisFile($text) { |
||
239 | |||
240 | |||
241 | /** |
||
242 | * [!] Method is generated. Documentation taken from corresponding module. |
||
243 | * |
||
244 | * Deletes a file |
||
245 | * @see \Codeception\Module\Filesystem::deleteThisFile() |
||
246 | */ |
||
247 | public function deleteThisFile() { |
||
250 | |||
251 | |||
252 | /** |
||
253 | * [!] Method is generated. Documentation taken from corresponding module. |
||
254 | * |
||
255 | * Checks if file exists in path. |
||
256 | * Opens a file when it's exists |
||
257 | * |
||
258 | * ``` php |
||
259 | * <?php |
||
260 | * $I->seeFileFound('UserModel.php','app/models'); |
||
261 | * ?> |
||
262 | * ``` |
||
263 | * |
||
264 | * @param $filename |
||
265 | * @param string $path |
||
266 | * Conditional Assertion: Test won't be stopped on fail |
||
267 | * @see \Codeception\Module\Filesystem::seeFileFound() |
||
268 | */ |
||
269 | public function canSeeFileFound($filename, $path = null) { |
||
272 | /** |
||
273 | * [!] Method is generated. Documentation taken from corresponding module. |
||
274 | * |
||
275 | * Checks if file exists in path. |
||
276 | * Opens a file when it's exists |
||
277 | * |
||
278 | * ``` php |
||
279 | * <?php |
||
280 | * $I->seeFileFound('UserModel.php','app/models'); |
||
281 | * ?> |
||
282 | * ``` |
||
283 | * |
||
284 | * @param $filename |
||
285 | * @param string $path |
||
286 | * @see \Codeception\Module\Filesystem::seeFileFound() |
||
287 | */ |
||
288 | public function seeFileFound($filename, $path = null) { |
||
291 | |||
292 | |||
293 | /** |
||
294 | * [!] Method is generated. Documentation taken from corresponding module. |
||
295 | * |
||
296 | * Checks if file does not exists in path |
||
297 | * |
||
298 | * @param $filename |
||
299 | * @param string $path |
||
300 | * Conditional Assertion: Test won't be stopped on fail |
||
301 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() |
||
302 | */ |
||
303 | public function cantSeeFileFound($filename, $path = null) { |
||
306 | /** |
||
307 | * [!] Method is generated. Documentation taken from corresponding module. |
||
308 | * |
||
309 | * Checks if file does not exists in path |
||
310 | * |
||
311 | * @param $filename |
||
312 | * @param string $path |
||
313 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() |
||
314 | */ |
||
315 | public function dontSeeFileFound($filename, $path = null) { |
||
318 | |||
319 | |||
320 | /** |
||
321 | * [!] Method is generated. Documentation taken from corresponding module. |
||
322 | * |
||
323 | * Erases directory contents |
||
324 | * |
||
325 | * ``` php |
||
326 | * <?php |
||
327 | * $I->cleanDir('logs'); |
||
328 | * ?> |
||
329 | * ``` |
||
330 | * |
||
331 | * @param $dirname |
||
332 | * @see \Codeception\Module\Filesystem::cleanDir() |
||
333 | */ |
||
334 | public function cleanDir($dirname) { |
||
337 | |||
338 | |||
339 | /** |
||
340 | * [!] Method is generated. Documentation taken from corresponding module. |
||
341 | * |
||
342 | * Saves contents to file |
||
343 | * |
||
344 | * @param $filename |
||
345 | * @param $contents |
||
346 | * @see \Codeception\Module\Filesystem::writeToFile() |
||
347 | */ |
||
348 | public function writeToFile($filename, $contents) { |
||
351 | |||
352 | |||
353 | /** |
||
354 | * [!] Method is generated. Documentation taken from corresponding module. |
||
355 | * |
||
356 | * Inserts record into the database. |
||
357 | * |
||
358 | * ``` php |
||
359 | * <?php |
||
360 | * $user_id = $I->haveRecord('app\models\User', array('name' => 'Davert')); |
||
361 | * ?> |
||
362 | * ``` |
||
363 | * |
||
364 | * @param $model |
||
365 | * @param array $attributes |
||
366 | * @return mixed |
||
367 | * @part orm |
||
368 | * @see \Codeception\Module\Yii2::haveRecord() |
||
369 | */ |
||
370 | public function haveRecord($model, $attributes = null) { |
||
373 | |||
374 | |||
375 | /** |
||
376 | * [!] Method is generated. Documentation taken from corresponding module. |
||
377 | * |
||
378 | * Checks that record exists in database. |
||
379 | * |
||
380 | * ``` php |
||
381 | * $I->seeRecord('app\models\User', array('name' => 'davert')); |
||
382 | * ``` |
||
383 | * |
||
384 | * @param $model |
||
385 | * @param array $attributes |
||
386 | * @part orm |
||
387 | * Conditional Assertion: Test won't be stopped on fail |
||
388 | * @see \Codeception\Module\Yii2::seeRecord() |
||
389 | */ |
||
390 | public function canSeeRecord($model, $attributes = null) { |
||
393 | /** |
||
394 | * [!] Method is generated. Documentation taken from corresponding module. |
||
395 | * |
||
396 | * Checks that record exists in database. |
||
397 | * |
||
398 | * ``` php |
||
399 | * $I->seeRecord('app\models\User', array('name' => 'davert')); |
||
400 | * ``` |
||
401 | * |
||
402 | * @param $model |
||
403 | * @param array $attributes |
||
404 | * @part orm |
||
405 | * @see \Codeception\Module\Yii2::seeRecord() |
||
406 | */ |
||
407 | public function seeRecord($model, $attributes = null) { |
||
410 | |||
411 | |||
412 | /** |
||
413 | * [!] Method is generated. Documentation taken from corresponding module. |
||
414 | * |
||
415 | * Checks that record does not exist in database. |
||
416 | * |
||
417 | * ``` php |
||
418 | * $I->dontSeeRecord('app\models\User', array('name' => 'davert')); |
||
419 | * ``` |
||
420 | * |
||
421 | * @param $model |
||
422 | * @param array $attributes |
||
423 | * @part orm |
||
424 | * Conditional Assertion: Test won't be stopped on fail |
||
425 | * @see \Codeception\Module\Yii2::dontSeeRecord() |
||
426 | */ |
||
427 | public function cantSeeRecord($model, $attributes = null) { |
||
430 | /** |
||
431 | * [!] Method is generated. Documentation taken from corresponding module. |
||
432 | * |
||
433 | * Checks that record does not exist in database. |
||
434 | * |
||
435 | * ``` php |
||
436 | * $I->dontSeeRecord('app\models\User', array('name' => 'davert')); |
||
437 | * ``` |
||
438 | * |
||
439 | * @param $model |
||
440 | * @param array $attributes |
||
441 | * @part orm |
||
442 | * @see \Codeception\Module\Yii2::dontSeeRecord() |
||
443 | */ |
||
444 | public function dontSeeRecord($model, $attributes = null) { |
||
447 | |||
448 | |||
449 | /** |
||
450 | * [!] Method is generated. Documentation taken from corresponding module. |
||
451 | * |
||
452 | * Retrieves record from database |
||
453 | * |
||
454 | * ``` php |
||
455 | * $category = $I->grabRecord('app\models\User', array('name' => 'davert')); |
||
456 | * ``` |
||
457 | * |
||
458 | * @param $model |
||
459 | * @param array $attributes |
||
460 | * @return mixed |
||
461 | * @part orm |
||
462 | * @see \Codeception\Module\Yii2::grabRecord() |
||
463 | */ |
||
464 | public function grabRecord($model, $attributes = null) { |
||
467 | |||
468 | |||
469 | /** |
||
470 | * [!] Method is generated. Documentation taken from corresponding module. |
||
471 | * |
||
472 | * Converting $page to valid Yii 2 URL |
||
473 | * |
||
474 | * Allows input like: |
||
475 | * |
||
476 | * ```php |
||
477 | * $I->amOnPage(['site/view','page'=>'about']); |
||
478 | * $I->amOnPage('index-test.php?site/index'); |
||
479 | * $I->amOnPage('http://localhost/index-test.php?site/index'); |
||
480 | * ``` |
||
481 | * |
||
482 | * @param $page string|array parameter for \yii\web\UrlManager::createUrl() |
||
483 | * @see \Codeception\Module\Yii2::amOnPage() |
||
484 | */ |
||
485 | public function amOnPage($page) { |
||
488 | |||
489 | |||
490 | /** |
||
491 | * [!] Method is generated. Documentation taken from corresponding module. |
||
492 | * |
||
493 | * Authenticates user for HTTP_AUTH |
||
494 | * |
||
495 | * @param $username |
||
496 | * @param $password |
||
497 | * @see \Codeception\Lib\InnerBrowser::amHttpAuthenticated() |
||
498 | */ |
||
499 | public function amHttpAuthenticated($username, $password) { |
||
502 | |||
503 | |||
504 | /** |
||
505 | * [!] Method is generated. Documentation taken from corresponding module. |
||
506 | * |
||
507 | * Perform a click on a link or a button, given by a locator. |
||
508 | * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. |
||
509 | * For buttons, the "value" attribute, "name" attribute, and inner text are searched. |
||
510 | * For links, the link text is searched. |
||
511 | * For images, the "alt" attribute and inner text of any parent links are searched. |
||
512 | * |
||
513 | * The second parameter is a context (CSS or XPath locator) to narrow the search. |
||
514 | * |
||
515 | * Note that if the locator matches a button of type `submit`, the form will be submitted. |
||
516 | * |
||
517 | * ``` php |
||
518 | * <?php |
||
519 | * // simple link |
||
520 | * $I->click('Logout'); |
||
521 | * // button of form |
||
522 | * $I->click('Submit'); |
||
523 | * // CSS button |
||
524 | * $I->click('#form input[type=submit]'); |
||
525 | * // XPath |
||
526 | * $I->click('//form/*[@type=submit]'); |
||
527 | * // link in context |
||
528 | * $I->click('Logout', '#nav'); |
||
529 | * // using strict locator |
||
530 | * $I->click(['link' => 'Login']); |
||
531 | * ?> |
||
532 | * ``` |
||
533 | * |
||
534 | * @param $link |
||
535 | * @param $context |
||
536 | * @see \Codeception\Lib\InnerBrowser::click() |
||
537 | */ |
||
538 | public function click($link, $context = null) { |
||
541 | |||
542 | |||
543 | /** |
||
544 | * [!] Method is generated. Documentation taken from corresponding module. |
||
545 | * |
||
546 | * Checks that the current page contains the given string. |
||
547 | * Specify a locator as the second parameter to match a specific region. |
||
548 | * |
||
549 | * ``` php |
||
550 | * <?php |
||
551 | * $I->see('Logout'); // I can suppose user is logged in |
||
552 | * $I->see('Sign Up','h1'); // I can suppose it's a signup page |
||
553 | * $I->see('Sign Up','//body/h1'); // with XPath |
||
554 | * ?> |
||
555 | * ``` |
||
556 | * |
||
557 | * @param $text |
||
558 | * @param null $selector |
||
559 | * Conditional Assertion: Test won't be stopped on fail |
||
560 | * @see \Codeception\Lib\InnerBrowser::see() |
||
561 | */ |
||
562 | public function canSee($text, $selector = null) { |
||
565 | /** |
||
566 | * [!] Method is generated. Documentation taken from corresponding module. |
||
567 | * |
||
568 | * Checks that the current page contains the given string. |
||
569 | * Specify a locator as the second parameter to match a specific region. |
||
570 | * |
||
571 | * ``` php |
||
572 | * <?php |
||
573 | * $I->see('Logout'); // I can suppose user is logged in |
||
574 | * $I->see('Sign Up','h1'); // I can suppose it's a signup page |
||
575 | * $I->see('Sign Up','//body/h1'); // with XPath |
||
576 | * ?> |
||
577 | * ``` |
||
578 | * |
||
579 | * @param $text |
||
580 | * @param null $selector |
||
581 | * @see \Codeception\Lib\InnerBrowser::see() |
||
582 | */ |
||
583 | public function see($text, $selector = null) { |
||
586 | |||
587 | |||
588 | /** |
||
589 | * [!] Method is generated. Documentation taken from corresponding module. |
||
590 | * |
||
591 | * Checks that the current page doesn't contain the text specified. |
||
592 | * Give a locator as the second parameter to match a specific region. |
||
593 | * |
||
594 | * ```php |
||
595 | * <?php |
||
596 | * $I->dontSee('Login'); // I can suppose user is already logged in |
||
597 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page |
||
598 | * $I->dontSee('Sign Up','//body/h1'); // with XPath |
||
599 | * ?> |
||
600 | * ``` |
||
601 | * |
||
602 | * @param $text |
||
603 | * @param null $selector |
||
604 | * Conditional Assertion: Test won't be stopped on fail |
||
605 | * @see \Codeception\Lib\InnerBrowser::dontSee() |
||
606 | */ |
||
607 | public function cantSee($text, $selector = null) { |
||
610 | /** |
||
611 | * [!] Method is generated. Documentation taken from corresponding module. |
||
612 | * |
||
613 | * Checks that the current page doesn't contain the text specified. |
||
614 | * Give a locator as the second parameter to match a specific region. |
||
615 | * |
||
616 | * ```php |
||
617 | * <?php |
||
618 | * $I->dontSee('Login'); // I can suppose user is already logged in |
||
619 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page |
||
620 | * $I->dontSee('Sign Up','//body/h1'); // with XPath |
||
621 | * ?> |
||
622 | * ``` |
||
623 | * |
||
624 | * @param $text |
||
625 | * @param null $selector |
||
626 | * @see \Codeception\Lib\InnerBrowser::dontSee() |
||
627 | */ |
||
628 | public function dontSee($text, $selector = null) { |
||
631 | |||
632 | |||
633 | /** |
||
634 | * [!] Method is generated. Documentation taken from corresponding module. |
||
635 | * |
||
636 | * Checks that there's a link with the specified text. |
||
637 | * Give a full URL as the second parameter to match links with that exact URL. |
||
638 | * |
||
639 | * ``` php |
||
640 | * <?php |
||
641 | * $I->seeLink('Logout'); // matches <a href="#">Logout</a> |
||
642 | * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a> |
||
643 | * ?> |
||
644 | * ``` |
||
645 | * |
||
646 | * @param $text |
||
647 | * @param null $url |
||
648 | * Conditional Assertion: Test won't be stopped on fail |
||
649 | * @see \Codeception\Lib\InnerBrowser::seeLink() |
||
650 | */ |
||
651 | public function canSeeLink($text, $url = null) { |
||
654 | /** |
||
655 | * [!] Method is generated. Documentation taken from corresponding module. |
||
656 | * |
||
657 | * Checks that there's a link with the specified text. |
||
658 | * Give a full URL as the second parameter to match links with that exact URL. |
||
659 | * |
||
660 | * ``` php |
||
661 | * <?php |
||
662 | * $I->seeLink('Logout'); // matches <a href="#">Logout</a> |
||
663 | * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a> |
||
664 | * ?> |
||
665 | * ``` |
||
666 | * |
||
667 | * @param $text |
||
668 | * @param null $url |
||
669 | * @see \Codeception\Lib\InnerBrowser::seeLink() |
||
670 | */ |
||
671 | public function seeLink($text, $url = null) { |
||
674 | |||
675 | |||
676 | /** |
||
677 | * [!] Method is generated. Documentation taken from corresponding module. |
||
678 | * |
||
679 | * Checks that the page doesn't contain a link with the given string. |
||
680 | * If the second parameter is given, only links with a matching "href" attribute will be checked. |
||
681 | * |
||
682 | * ``` php |
||
683 | * <?php |
||
684 | * $I->dontSeeLink('Logout'); // I suppose user is not logged in |
||
685 | * $I->dontSeeLink('Checkout now', '/store/cart.php'); |
||
686 | * ?> |
||
687 | * ``` |
||
688 | * |
||
689 | * @param $text |
||
690 | * @param null $url |
||
691 | * Conditional Assertion: Test won't be stopped on fail |
||
692 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() |
||
693 | */ |
||
694 | public function cantSeeLink($text, $url = null) { |
||
697 | /** |
||
698 | * [!] Method is generated. Documentation taken from corresponding module. |
||
699 | * |
||
700 | * Checks that the page doesn't contain a link with the given string. |
||
701 | * If the second parameter is given, only links with a matching "href" attribute will be checked. |
||
702 | * |
||
703 | * ``` php |
||
704 | * <?php |
||
705 | * $I->dontSeeLink('Logout'); // I suppose user is not logged in |
||
706 | * $I->dontSeeLink('Checkout now', '/store/cart.php'); |
||
707 | * ?> |
||
708 | * ``` |
||
709 | * |
||
710 | * @param $text |
||
711 | * @param null $url |
||
712 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() |
||
713 | */ |
||
714 | public function dontSeeLink($text, $url = null) { |
||
717 | |||
718 | |||
719 | /** |
||
720 | * [!] Method is generated. Documentation taken from corresponding module. |
||
721 | * |
||
722 | * Checks that current URI contains the given string. |
||
723 | * |
||
724 | * ``` php |
||
725 | * <?php |
||
726 | * // to match: /home/dashboard |
||
727 | * $I->seeInCurrentUrl('home'); |
||
728 | * // to match: /users/1 |
||
729 | * $I->seeInCurrentUrl('/users/'); |
||
730 | * ?> |
||
731 | * ``` |
||
732 | * |
||
733 | * @param $uri |
||
734 | * Conditional Assertion: Test won't be stopped on fail |
||
735 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() |
||
736 | */ |
||
737 | public function canSeeInCurrentUrl($uri) { |
||
740 | /** |
||
741 | * [!] Method is generated. Documentation taken from corresponding module. |
||
742 | * |
||
743 | * Checks that current URI contains the given string. |
||
744 | * |
||
745 | * ``` php |
||
746 | * <?php |
||
747 | * // to match: /home/dashboard |
||
748 | * $I->seeInCurrentUrl('home'); |
||
749 | * // to match: /users/1 |
||
750 | * $I->seeInCurrentUrl('/users/'); |
||
751 | * ?> |
||
752 | * ``` |
||
753 | * |
||
754 | * @param $uri |
||
755 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() |
||
756 | */ |
||
757 | public function seeInCurrentUrl($uri) { |
||
760 | |||
761 | |||
762 | /** |
||
763 | * [!] Method is generated. Documentation taken from corresponding module. |
||
764 | * |
||
765 | * Checks that the current URI doesn't contain the given string. |
||
766 | * |
||
767 | * ``` php |
||
768 | * <?php |
||
769 | * $I->dontSeeInCurrentUrl('/users/'); |
||
770 | * ?> |
||
771 | * ``` |
||
772 | * |
||
773 | * @param $uri |
||
774 | * Conditional Assertion: Test won't be stopped on fail |
||
775 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() |
||
776 | */ |
||
777 | public function cantSeeInCurrentUrl($uri) { |
||
780 | /** |
||
781 | * [!] Method is generated. Documentation taken from corresponding module. |
||
782 | * |
||
783 | * Checks that the current URI doesn't contain the given string. |
||
784 | * |
||
785 | * ``` php |
||
786 | * <?php |
||
787 | * $I->dontSeeInCurrentUrl('/users/'); |
||
788 | * ?> |
||
789 | * ``` |
||
790 | * |
||
791 | * @param $uri |
||
792 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() |
||
793 | */ |
||
794 | public function dontSeeInCurrentUrl($uri) { |
||
797 | |||
798 | |||
799 | /** |
||
800 | * [!] Method is generated. Documentation taken from corresponding module. |
||
801 | * |
||
802 | * Checks that the current URL is equal to the given string. |
||
803 | * Unlike `seeInCurrentUrl`, this only matches the full URL. |
||
804 | * |
||
805 | * ``` php |
||
806 | * <?php |
||
807 | * // to match root url |
||
808 | * $I->seeCurrentUrlEquals('/'); |
||
809 | * ?> |
||
810 | * ``` |
||
811 | * |
||
812 | * @param $uri |
||
813 | * Conditional Assertion: Test won't be stopped on fail |
||
814 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() |
||
815 | */ |
||
816 | public function canSeeCurrentUrlEquals($uri) { |
||
819 | /** |
||
820 | * [!] Method is generated. Documentation taken from corresponding module. |
||
821 | * |
||
822 | * Checks that the current URL is equal to the given string. |
||
823 | * Unlike `seeInCurrentUrl`, this only matches the full URL. |
||
824 | * |
||
825 | * ``` php |
||
826 | * <?php |
||
827 | * // to match root url |
||
828 | * $I->seeCurrentUrlEquals('/'); |
||
829 | * ?> |
||
830 | * ``` |
||
831 | * |
||
832 | * @param $uri |
||
833 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() |
||
834 | */ |
||
835 | public function seeCurrentUrlEquals($uri) { |
||
838 | |||
839 | |||
840 | /** |
||
841 | * [!] Method is generated. Documentation taken from corresponding module. |
||
842 | * |
||
843 | * Checks that the current URL doesn't equal the given string. |
||
844 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. |
||
845 | * |
||
846 | * ``` php |
||
847 | * <?php |
||
848 | * // current url is not root |
||
849 | * $I->dontSeeCurrentUrlEquals('/'); |
||
850 | * ?> |
||
851 | * ``` |
||
852 | * |
||
853 | * @param $uri |
||
854 | * Conditional Assertion: Test won't be stopped on fail |
||
855 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() |
||
856 | */ |
||
857 | public function cantSeeCurrentUrlEquals($uri) { |
||
860 | /** |
||
861 | * [!] Method is generated. Documentation taken from corresponding module. |
||
862 | * |
||
863 | * Checks that the current URL doesn't equal the given string. |
||
864 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. |
||
865 | * |
||
866 | * ``` php |
||
867 | * <?php |
||
868 | * // current url is not root |
||
869 | * $I->dontSeeCurrentUrlEquals('/'); |
||
870 | * ?> |
||
871 | * ``` |
||
872 | * |
||
873 | * @param $uri |
||
874 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() |
||
875 | */ |
||
876 | public function dontSeeCurrentUrlEquals($uri) { |
||
879 | |||
880 | |||
881 | /** |
||
882 | * [!] Method is generated. Documentation taken from corresponding module. |
||
883 | * |
||
884 | * Checks that the current URL matches the given regular expression. |
||
885 | * |
||
886 | * ``` php |
||
887 | * <?php |
||
888 | * // to match root url |
||
889 | * $I->seeCurrentUrlMatches('~$/users/(\d+)~'); |
||
890 | * ?> |
||
891 | * ``` |
||
892 | * |
||
893 | * @param $uri |
||
894 | * Conditional Assertion: Test won't be stopped on fail |
||
895 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() |
||
896 | */ |
||
897 | public function canSeeCurrentUrlMatches($uri) { |
||
900 | /** |
||
901 | * [!] Method is generated. Documentation taken from corresponding module. |
||
902 | * |
||
903 | * Checks that the current URL matches the given regular expression. |
||
904 | * |
||
905 | * ``` php |
||
906 | * <?php |
||
907 | * // to match root url |
||
908 | * $I->seeCurrentUrlMatches('~$/users/(\d+)~'); |
||
909 | * ?> |
||
910 | * ``` |
||
911 | * |
||
912 | * @param $uri |
||
913 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() |
||
914 | */ |
||
915 | public function seeCurrentUrlMatches($uri) { |
||
918 | |||
919 | |||
920 | /** |
||
921 | * [!] Method is generated. Documentation taken from corresponding module. |
||
922 | * |
||
923 | * Checks that current url doesn't match the given regular expression. |
||
924 | * |
||
925 | * ``` php |
||
926 | * <?php |
||
927 | * // to match root url |
||
928 | * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~'); |
||
929 | * ?> |
||
930 | * ``` |
||
931 | * |
||
932 | * @param $uri |
||
933 | * Conditional Assertion: Test won't be stopped on fail |
||
934 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() |
||
935 | */ |
||
936 | public function cantSeeCurrentUrlMatches($uri) { |
||
939 | /** |
||
940 | * [!] Method is generated. Documentation taken from corresponding module. |
||
941 | * |
||
942 | * Checks that current url doesn't match the given regular expression. |
||
943 | * |
||
944 | * ``` php |
||
945 | * <?php |
||
946 | * // to match root url |
||
947 | * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~'); |
||
948 | * ?> |
||
949 | * ``` |
||
950 | * |
||
951 | * @param $uri |
||
952 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() |
||
953 | */ |
||
954 | public function dontSeeCurrentUrlMatches($uri) { |
||
957 | |||
958 | |||
959 | /** |
||
960 | * [!] Method is generated. Documentation taken from corresponding module. |
||
961 | * |
||
962 | * Executes the given regular expression against the current URI and returns the first match. |
||
963 | * If no parameters are provided, the full URI is returned. |
||
964 | * |
||
965 | * ``` php |
||
966 | * <?php |
||
967 | * $user_id = $I->grabFromCurrentUrl('~$/user/(\d+)/~'); |
||
968 | * $uri = $I->grabFromCurrentUrl(); |
||
969 | * ?> |
||
970 | * ``` |
||
971 | * |
||
972 | * @param null $uri |
||
973 | * |
||
974 | * @internal param $url |
||
975 | * @return mixed |
||
976 | * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl() |
||
977 | */ |
||
978 | public function grabFromCurrentUrl($uri = null) { |
||
981 | |||
982 | |||
983 | /** |
||
984 | * [!] Method is generated. Documentation taken from corresponding module. |
||
985 | * |
||
986 | * Checks that the specified checkbox is checked. |
||
987 | * |
||
988 | * ``` php |
||
989 | * <?php |
||
990 | * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms |
||
991 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. |
||
992 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); |
||
993 | * ?> |
||
994 | * ``` |
||
995 | * |
||
996 | * @param $checkbox |
||
997 | * Conditional Assertion: Test won't be stopped on fail |
||
998 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() |
||
999 | */ |
||
1000 | public function canSeeCheckboxIsChecked($checkbox) { |
||
1003 | /** |
||
1004 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1005 | * |
||
1006 | * Checks that the specified checkbox is checked. |
||
1007 | * |
||
1008 | * ``` php |
||
1009 | * <?php |
||
1010 | * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms |
||
1011 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. |
||
1012 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); |
||
1013 | * ?> |
||
1014 | * ``` |
||
1015 | * |
||
1016 | * @param $checkbox |
||
1017 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() |
||
1018 | */ |
||
1019 | public function seeCheckboxIsChecked($checkbox) { |
||
1022 | |||
1023 | |||
1024 | /** |
||
1025 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1026 | * |
||
1027 | * Check that the specified checkbox is unchecked. |
||
1028 | * |
||
1029 | * ``` php |
||
1030 | * <?php |
||
1031 | * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms |
||
1032 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. |
||
1033 | * ?> |
||
1034 | * ``` |
||
1035 | * |
||
1036 | * @param $checkbox |
||
1037 | * Conditional Assertion: Test won't be stopped on fail |
||
1038 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() |
||
1039 | */ |
||
1040 | public function cantSeeCheckboxIsChecked($checkbox) { |
||
1043 | /** |
||
1044 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1045 | * |
||
1046 | * Check that the specified checkbox is unchecked. |
||
1047 | * |
||
1048 | * ``` php |
||
1049 | * <?php |
||
1050 | * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms |
||
1051 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. |
||
1052 | * ?> |
||
1053 | * ``` |
||
1054 | * |
||
1055 | * @param $checkbox |
||
1056 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() |
||
1057 | */ |
||
1058 | public function dontSeeCheckboxIsChecked($checkbox) { |
||
1061 | |||
1062 | |||
1063 | /** |
||
1064 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1065 | * |
||
1066 | * Checks that the given input field or textarea contains the given value. |
||
1067 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. |
||
1068 | * |
||
1069 | * ``` php |
||
1070 | * <?php |
||
1071 | * $I->seeInField('Body','Type your comment here'); |
||
1072 | * $I->seeInField('form textarea[name=body]','Type your comment here'); |
||
1073 | * $I->seeInField('form input[type=hidden]','hidden_value'); |
||
1074 | * $I->seeInField('#searchform input','Search'); |
||
1075 | * $I->seeInField('//form/*[@name=search]','Search'); |
||
1076 | * $I->seeInField(['name' => 'search'], 'Search'); |
||
1077 | * ?> |
||
1078 | * ``` |
||
1079 | * |
||
1080 | * @param $field |
||
1081 | * @param $value |
||
1082 | * Conditional Assertion: Test won't be stopped on fail |
||
1083 | * @see \Codeception\Lib\InnerBrowser::seeInField() |
||
1084 | */ |
||
1085 | public function canSeeInField($field, $value) { |
||
1088 | /** |
||
1089 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1090 | * |
||
1091 | * Checks that the given input field or textarea contains the given value. |
||
1092 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. |
||
1093 | * |
||
1094 | * ``` php |
||
1095 | * <?php |
||
1096 | * $I->seeInField('Body','Type your comment here'); |
||
1097 | * $I->seeInField('form textarea[name=body]','Type your comment here'); |
||
1098 | * $I->seeInField('form input[type=hidden]','hidden_value'); |
||
1099 | * $I->seeInField('#searchform input','Search'); |
||
1100 | * $I->seeInField('//form/*[@name=search]','Search'); |
||
1101 | * $I->seeInField(['name' => 'search'], 'Search'); |
||
1102 | * ?> |
||
1103 | * ``` |
||
1104 | * |
||
1105 | * @param $field |
||
1106 | * @param $value |
||
1107 | * @see \Codeception\Lib\InnerBrowser::seeInField() |
||
1108 | */ |
||
1109 | public function seeInField($field, $value) { |
||
1112 | |||
1113 | |||
1114 | /** |
||
1115 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1116 | * |
||
1117 | * Checks that an input field or textarea doesn't contain the given value. |
||
1118 | * For fuzzy locators, the field is matched by label text, CSS and XPath. |
||
1119 | * |
||
1120 | * ``` php |
||
1121 | * <?php |
||
1122 | * $I->dontSeeInField('Body','Type your comment here'); |
||
1123 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); |
||
1124 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); |
||
1125 | * $I->dontSeeInField('#searchform input','Search'); |
||
1126 | * $I->dontSeeInField('//form/*[@name=search]','Search'); |
||
1127 | * $I->dontSeeInField(['name' => 'search'], 'Search'); |
||
1128 | * ?> |
||
1129 | * ``` |
||
1130 | * |
||
1131 | * @param $field |
||
1132 | * @param $value |
||
1133 | * Conditional Assertion: Test won't be stopped on fail |
||
1134 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() |
||
1135 | */ |
||
1136 | public function cantSeeInField($field, $value) { |
||
1139 | /** |
||
1140 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1141 | * |
||
1142 | * Checks that an input field or textarea doesn't contain the given value. |
||
1143 | * For fuzzy locators, the field is matched by label text, CSS and XPath. |
||
1144 | * |
||
1145 | * ``` php |
||
1146 | * <?php |
||
1147 | * $I->dontSeeInField('Body','Type your comment here'); |
||
1148 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); |
||
1149 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); |
||
1150 | * $I->dontSeeInField('#searchform input','Search'); |
||
1151 | * $I->dontSeeInField('//form/*[@name=search]','Search'); |
||
1152 | * $I->dontSeeInField(['name' => 'search'], 'Search'); |
||
1153 | * ?> |
||
1154 | * ``` |
||
1155 | * |
||
1156 | * @param $field |
||
1157 | * @param $value |
||
1158 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() |
||
1159 | */ |
||
1160 | public function dontSeeInField($field, $value) { |
||
1163 | |||
1164 | |||
1165 | /** |
||
1166 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1167 | * |
||
1168 | * Checks if the array of form parameters (name => value) are set on the form matched with the |
||
1169 | * passed selector. |
||
1170 | * |
||
1171 | * ``` php |
||
1172 | * <?php |
||
1173 | * $I->seeInFormFields('form[name=myform]', [ |
||
1174 | * 'input1' => 'value', |
||
1175 | * 'input2' => 'other value', |
||
1176 | * ]); |
||
1177 | * ?> |
||
1178 | * ``` |
||
1179 | * |
||
1180 | * For multi-select elements, or to check values of multiple elements with the same name, an |
||
1181 | * array may be passed: |
||
1182 | * |
||
1183 | * ``` php |
||
1184 | * <?php |
||
1185 | * $I->seeInFormFields('.form-class', [ |
||
1186 | * 'multiselect' => [ |
||
1187 | * 'value1', |
||
1188 | * 'value2', |
||
1189 | * ], |
||
1190 | * 'checkbox[]' => [ |
||
1191 | * 'a checked value', |
||
1192 | * 'another checked value', |
||
1193 | * ], |
||
1194 | * ]); |
||
1195 | * ?> |
||
1196 | * ``` |
||
1197 | * |
||
1198 | * Additionally, checkbox values can be checked with a boolean. |
||
1199 | * |
||
1200 | * ``` php |
||
1201 | * <?php |
||
1202 | * $I->seeInFormFields('#form-id', [ |
||
1203 | * 'checkbox1' => true, // passes if checked |
||
1204 | * 'checkbox2' => false, // passes if unchecked |
||
1205 | * ]); |
||
1206 | * ?> |
||
1207 | * ``` |
||
1208 | * |
||
1209 | * Pair this with submitForm for quick testing magic. |
||
1210 | * |
||
1211 | * ``` php |
||
1212 | * <?php |
||
1213 | * $form = [ |
||
1214 | * 'field1' => 'value', |
||
1215 | * 'field2' => 'another value', |
||
1216 | * 'checkbox1' => true, |
||
1217 | * // ... |
||
1218 | * ]; |
||
1219 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); |
||
1220 | * // $I->amOnPage('/path/to/form-page') may be needed |
||
1221 | * $I->seeInFormFields('//form[@id=my-form]', $form); |
||
1222 | * ?> |
||
1223 | * ``` |
||
1224 | * |
||
1225 | * @param $formSelector |
||
1226 | * @param $params |
||
1227 | * Conditional Assertion: Test won't be stopped on fail |
||
1228 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields() |
||
1229 | */ |
||
1230 | public function canSeeInFormFields($formSelector, $params) { |
||
1233 | /** |
||
1234 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1235 | * |
||
1236 | * Checks if the array of form parameters (name => value) are set on the form matched with the |
||
1237 | * passed selector. |
||
1238 | * |
||
1239 | * ``` php |
||
1240 | * <?php |
||
1241 | * $I->seeInFormFields('form[name=myform]', [ |
||
1242 | * 'input1' => 'value', |
||
1243 | * 'input2' => 'other value', |
||
1244 | * ]); |
||
1245 | * ?> |
||
1246 | * ``` |
||
1247 | * |
||
1248 | * For multi-select elements, or to check values of multiple elements with the same name, an |
||
1249 | * array may be passed: |
||
1250 | * |
||
1251 | * ``` php |
||
1252 | * <?php |
||
1253 | * $I->seeInFormFields('.form-class', [ |
||
1254 | * 'multiselect' => [ |
||
1255 | * 'value1', |
||
1256 | * 'value2', |
||
1257 | * ], |
||
1258 | * 'checkbox[]' => [ |
||
1259 | * 'a checked value', |
||
1260 | * 'another checked value', |
||
1261 | * ], |
||
1262 | * ]); |
||
1263 | * ?> |
||
1264 | * ``` |
||
1265 | * |
||
1266 | * Additionally, checkbox values can be checked with a boolean. |
||
1267 | * |
||
1268 | * ``` php |
||
1269 | * <?php |
||
1270 | * $I->seeInFormFields('#form-id', [ |
||
1271 | * 'checkbox1' => true, // passes if checked |
||
1272 | * 'checkbox2' => false, // passes if unchecked |
||
1273 | * ]); |
||
1274 | * ?> |
||
1275 | * ``` |
||
1276 | * |
||
1277 | * Pair this with submitForm for quick testing magic. |
||
1278 | * |
||
1279 | * ``` php |
||
1280 | * <?php |
||
1281 | * $form = [ |
||
1282 | * 'field1' => 'value', |
||
1283 | * 'field2' => 'another value', |
||
1284 | * 'checkbox1' => true, |
||
1285 | * // ... |
||
1286 | * ]; |
||
1287 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); |
||
1288 | * // $I->amOnPage('/path/to/form-page') may be needed |
||
1289 | * $I->seeInFormFields('//form[@id=my-form]', $form); |
||
1290 | * ?> |
||
1291 | * ``` |
||
1292 | * |
||
1293 | * @param $formSelector |
||
1294 | * @param $params |
||
1295 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields() |
||
1296 | */ |
||
1297 | public function seeInFormFields($formSelector, $params) { |
||
1300 | |||
1301 | |||
1302 | /** |
||
1303 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1304 | * |
||
1305 | * Checks if the array of form parameters (name => value) are not set on the form matched with |
||
1306 | * the passed selector. |
||
1307 | * |
||
1308 | * ``` php |
||
1309 | * <?php |
||
1310 | * $I->dontSeeInFormFields('form[name=myform]', [ |
||
1311 | * 'input1' => 'non-existent value', |
||
1312 | * 'input2' => 'other non-existent value', |
||
1313 | * ]); |
||
1314 | * ?> |
||
1315 | * ``` |
||
1316 | * |
||
1317 | * To check that an element hasn't been assigned any one of many values, an array can be passed |
||
1318 | * as the value: |
||
1319 | * |
||
1320 | * ``` php |
||
1321 | * <?php |
||
1322 | * $I->dontSeeInFormFields('.form-class', [ |
||
1323 | * 'fieldName' => [ |
||
1324 | * 'This value shouldn\'t be set', |
||
1325 | * 'And this value shouldn\'t be set', |
||
1326 | * ], |
||
1327 | * ]); |
||
1328 | * ?> |
||
1329 | * ``` |
||
1330 | * |
||
1331 | * Additionally, checkbox values can be checked with a boolean. |
||
1332 | * |
||
1333 | * ``` php |
||
1334 | * <?php |
||
1335 | * $I->dontSeeInFormFields('#form-id', [ |
||
1336 | * 'checkbox1' => true, // fails if checked |
||
1337 | * 'checkbox2' => false, // fails if unchecked |
||
1338 | * ]); |
||
1339 | * ?> |
||
1340 | * ``` |
||
1341 | * |
||
1342 | * @param $formSelector |
||
1343 | * @param $params |
||
1344 | * Conditional Assertion: Test won't be stopped on fail |
||
1345 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() |
||
1346 | */ |
||
1347 | public function cantSeeInFormFields($formSelector, $params) { |
||
1350 | /** |
||
1351 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1352 | * |
||
1353 | * Checks if the array of form parameters (name => value) are not set on the form matched with |
||
1354 | * the passed selector. |
||
1355 | * |
||
1356 | * ``` php |
||
1357 | * <?php |
||
1358 | * $I->dontSeeInFormFields('form[name=myform]', [ |
||
1359 | * 'input1' => 'non-existent value', |
||
1360 | * 'input2' => 'other non-existent value', |
||
1361 | * ]); |
||
1362 | * ?> |
||
1363 | * ``` |
||
1364 | * |
||
1365 | * To check that an element hasn't been assigned any one of many values, an array can be passed |
||
1366 | * as the value: |
||
1367 | * |
||
1368 | * ``` php |
||
1369 | * <?php |
||
1370 | * $I->dontSeeInFormFields('.form-class', [ |
||
1371 | * 'fieldName' => [ |
||
1372 | * 'This value shouldn\'t be set', |
||
1373 | * 'And this value shouldn\'t be set', |
||
1374 | * ], |
||
1375 | * ]); |
||
1376 | * ?> |
||
1377 | * ``` |
||
1378 | * |
||
1379 | * Additionally, checkbox values can be checked with a boolean. |
||
1380 | * |
||
1381 | * ``` php |
||
1382 | * <?php |
||
1383 | * $I->dontSeeInFormFields('#form-id', [ |
||
1384 | * 'checkbox1' => true, // fails if checked |
||
1385 | * 'checkbox2' => false, // fails if unchecked |
||
1386 | * ]); |
||
1387 | * ?> |
||
1388 | * ``` |
||
1389 | * |
||
1390 | * @param $formSelector |
||
1391 | * @param $params |
||
1392 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() |
||
1393 | */ |
||
1394 | public function dontSeeInFormFields($formSelector, $params) { |
||
1397 | |||
1398 | |||
1399 | /** |
||
1400 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1401 | * |
||
1402 | * Submits the given form on the page, optionally with the given form |
||
1403 | * values. Give the form fields values as an array. |
||
1404 | * |
||
1405 | * Skipped fields will be filled by their values from the page. |
||
1406 | * You don't need to click the 'Submit' button afterwards. |
||
1407 | * This command itself triggers the request to form's action. |
||
1408 | * |
||
1409 | * You can optionally specify what button's value to include |
||
1410 | * in the request with the last parameter as an alternative to |
||
1411 | * explicitly setting its value in the second parameter, as |
||
1412 | * button values are not otherwise included in the request. |
||
1413 | * |
||
1414 | * Examples: |
||
1415 | * |
||
1416 | * ``` php |
||
1417 | * <?php |
||
1418 | * $I->submitForm('#login', [ |
||
1419 | * 'login' => 'davert', |
||
1420 | * 'password' => '123456' |
||
1421 | * ]); |
||
1422 | * // or |
||
1423 | * $I->submitForm('#login', [ |
||
1424 | * 'login' => 'davert', |
||
1425 | * 'password' => '123456' |
||
1426 | * ], 'submitButtonName'); |
||
1427 | * |
||
1428 | * ``` |
||
1429 | * |
||
1430 | * For example, given this sample "Sign Up" form: |
||
1431 | * |
||
1432 | * ``` html |
||
1433 | * <form action="/sign_up"> |
||
1434 | * Login: |
||
1435 | * <input type="text" name="user[login]" /><br/> |
||
1436 | * Password: |
||
1437 | * <input type="password" name="user[password]" /><br/> |
||
1438 | * Do you agree to our terms? |
||
1439 | * <input type="checkbox" name="user[agree]" /><br/> |
||
1440 | * Select pricing plan: |
||
1441 | * <select name="plan"> |
||
1442 | * <option value="1">Free</option> |
||
1443 | * <option value="2" selected="selected">Paid</option> |
||
1444 | * </select> |
||
1445 | * <input type="submit" name="submitButton" value="Submit" /> |
||
1446 | * </form> |
||
1447 | * ``` |
||
1448 | * |
||
1449 | * You could write the following to submit it: |
||
1450 | * |
||
1451 | * ``` php |
||
1452 | * <?php |
||
1453 | * $I->submitForm( |
||
1454 | * '#userForm', |
||
1455 | * [ |
||
1456 | * 'user' => [ |
||
1457 | * 'login' => 'Davert', |
||
1458 | * 'password' => '123456', |
||
1459 | * 'agree' => true |
||
1460 | * ] |
||
1461 | * ], |
||
1462 | * 'submitButton' |
||
1463 | * ); |
||
1464 | * ``` |
||
1465 | * Note that "2" will be the submitted value for the "plan" field, as it is |
||
1466 | * the selected option. |
||
1467 | * |
||
1468 | * You can also emulate a JavaScript submission by not specifying any |
||
1469 | * buttons in the third parameter to submitForm. |
||
1470 | * |
||
1471 | * ```php |
||
1472 | * <?php |
||
1473 | * $I->submitForm( |
||
1474 | * '#userForm', |
||
1475 | * [ |
||
1476 | * 'user' => [ |
||
1477 | * 'login' => 'Davert', |
||
1478 | * 'password' => '123456', |
||
1479 | * 'agree' => true |
||
1480 | * ] |
||
1481 | * ] |
||
1482 | * ); |
||
1483 | * ``` |
||
1484 | * |
||
1485 | * Pair this with seeInFormFields for quick testing magic. |
||
1486 | * |
||
1487 | * ``` php |
||
1488 | * <?php |
||
1489 | * $form = [ |
||
1490 | * 'field1' => 'value', |
||
1491 | * 'field2' => 'another value', |
||
1492 | * 'checkbox1' => true, |
||
1493 | * // ... |
||
1494 | * ]; |
||
1495 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); |
||
1496 | * // $I->amOnPage('/path/to/form-page') may be needed |
||
1497 | * $I->seeInFormFields('//form[@id=my-form]', $form); |
||
1498 | * ?> |
||
1499 | * ``` |
||
1500 | * |
||
1501 | * Parameter values can be set to arrays for multiple input fields |
||
1502 | * of the same name, or multi-select combo boxes. For checkboxes, |
||
1503 | * either the string value can be used, or boolean values which will |
||
1504 | * be replaced by the checkbox's value in the DOM. |
||
1505 | * |
||
1506 | * ``` php |
||
1507 | * <?php |
||
1508 | * $I->submitForm('#my-form', [ |
||
1509 | * 'field1' => 'value', |
||
1510 | * 'checkbox' => [ |
||
1511 | * 'value of first checkbox', |
||
1512 | * 'value of second checkbox, |
||
1513 | * ], |
||
1514 | * 'otherCheckboxes' => [ |
||
1515 | * true, |
||
1516 | * false, |
||
1517 | * false |
||
1518 | * ], |
||
1519 | * 'multiselect' => [ |
||
1520 | * 'first option value', |
||
1521 | * 'second option value' |
||
1522 | * ] |
||
1523 | * ]); |
||
1524 | * ?> |
||
1525 | * ``` |
||
1526 | * |
||
1527 | * Mixing string and boolean values for a checkbox's value is not supported |
||
1528 | * and may produce unexpected results. |
||
1529 | * |
||
1530 | * Field names ending in "[]" must be passed without the trailing square |
||
1531 | * bracket characters, and must contain an array for its value. This allows |
||
1532 | * submitting multiple values with the same name, consider: |
||
1533 | * |
||
1534 | * ```php |
||
1535 | * $I->submitForm('#my-form', [ |
||
1536 | * 'field[]' => 'value', |
||
1537 | * 'field[]' => 'another value', // 'field[]' is already a defined key |
||
1538 | * ]); |
||
1539 | * ``` |
||
1540 | * |
||
1541 | * The solution is to pass an array value: |
||
1542 | * |
||
1543 | * ```php |
||
1544 | * // this way both values are submitted |
||
1545 | * $I->submitForm('#my-form', [ |
||
1546 | * 'field' => [ |
||
1547 | * 'value', |
||
1548 | * 'another value', |
||
1549 | * ] |
||
1550 | * ]); |
||
1551 | * ``` |
||
1552 | * |
||
1553 | * @param $selector |
||
1554 | * @param $params |
||
1555 | * @param $button |
||
1556 | * @see \Codeception\Lib\InnerBrowser::submitForm() |
||
1557 | */ |
||
1558 | public function submitForm($selector, $params, $button = null) { |
||
1561 | |||
1562 | |||
1563 | /** |
||
1564 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1565 | * |
||
1566 | * Fills a text field or textarea with the given string. |
||
1567 | * |
||
1568 | * ``` php |
||
1569 | * <?php |
||
1570 | * $I->fillField("//input[@type='text']", "Hello World!"); |
||
1571 | * $I->fillField(['name' => 'email'], '[email protected]'); |
||
1572 | * ?> |
||
1573 | * ``` |
||
1574 | * |
||
1575 | * @param $field |
||
1576 | * @param $value |
||
1577 | * @see \Codeception\Lib\InnerBrowser::fillField() |
||
1578 | */ |
||
1579 | public function fillField($field, $value) { |
||
1582 | |||
1583 | |||
1584 | /** |
||
1585 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1586 | * |
||
1587 | * Selects an option in a select tag or in radio button group. |
||
1588 | * |
||
1589 | * ``` php |
||
1590 | * <?php |
||
1591 | * $I->selectOption('form select[name=account]', 'Premium'); |
||
1592 | * $I->selectOption('form input[name=payment]', 'Monthly'); |
||
1593 | * $I->selectOption('//form/select[@name=account]', 'Monthly'); |
||
1594 | * ?> |
||
1595 | * ``` |
||
1596 | * |
||
1597 | * Provide an array for the second argument to select multiple options: |
||
1598 | * |
||
1599 | * ``` php |
||
1600 | * <?php |
||
1601 | * $I->selectOption('Which OS do you use?', array('Windows','Linux')); |
||
1602 | * ?> |
||
1603 | * ``` |
||
1604 | * |
||
1605 | * @param $select |
||
1606 | * @param $option |
||
1607 | * @see \Codeception\Lib\InnerBrowser::selectOption() |
||
1608 | */ |
||
1609 | public function selectOption($select, $option) { |
||
1612 | |||
1613 | |||
1614 | /** |
||
1615 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1616 | * |
||
1617 | * Ticks a checkbox. For radio buttons, use the `selectOption` method instead. |
||
1618 | * |
||
1619 | * ``` php |
||
1620 | * <?php |
||
1621 | * $I->checkOption('#agree'); |
||
1622 | * ?> |
||
1623 | * ``` |
||
1624 | * |
||
1625 | * @param $option |
||
1626 | * @see \Codeception\Lib\InnerBrowser::checkOption() |
||
1627 | */ |
||
1628 | public function checkOption($option) { |
||
1631 | |||
1632 | |||
1633 | /** |
||
1634 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1635 | * |
||
1636 | * Unticks a checkbox. |
||
1637 | * |
||
1638 | * ``` php |
||
1639 | * <?php |
||
1640 | * $I->uncheckOption('#notify'); |
||
1641 | * ?> |
||
1642 | * ``` |
||
1643 | * |
||
1644 | * @param $option |
||
1645 | * @see \Codeception\Lib\InnerBrowser::uncheckOption() |
||
1646 | */ |
||
1647 | public function uncheckOption($option) { |
||
1650 | |||
1651 | |||
1652 | /** |
||
1653 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1654 | * |
||
1655 | * Attaches a file relative to the Codeception data directory to the given file upload field. |
||
1656 | * |
||
1657 | * ``` php |
||
1658 | * <?php |
||
1659 | * // file is stored in 'tests/_data/prices.xls' |
||
1660 | * $I->attachFile('input[@type="file"]', 'prices.xls'); |
||
1661 | * ?> |
||
1662 | * ``` |
||
1663 | * |
||
1664 | * @param $field |
||
1665 | * @param $filename |
||
1666 | * @see \Codeception\Lib\InnerBrowser::attachFile() |
||
1667 | */ |
||
1668 | public function attachFile($field, $filename) { |
||
1671 | |||
1672 | |||
1673 | /** |
||
1674 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1675 | * |
||
1676 | * If your page triggers an ajax request, you can perform it manually. |
||
1677 | * This action sends a GET ajax request with specified params. |
||
1678 | * |
||
1679 | * See ->sendAjaxPostRequest for examples. |
||
1680 | * |
||
1681 | * @param $uri |
||
1682 | * @param $params |
||
1683 | * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest() |
||
1684 | */ |
||
1685 | public function sendAjaxGetRequest($uri, $params = null) { |
||
1688 | |||
1689 | |||
1690 | /** |
||
1691 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1692 | * |
||
1693 | * If your page triggers an ajax request, you can perform it manually. |
||
1694 | * This action sends a POST ajax request with specified params. |
||
1695 | * Additional params can be passed as array. |
||
1696 | * |
||
1697 | * Example: |
||
1698 | * |
||
1699 | * Imagine that by clicking checkbox you trigger ajax request which updates user settings. |
||
1700 | * We emulate that click by running this ajax request manually. |
||
1701 | * |
||
1702 | * ``` php |
||
1703 | * <?php |
||
1704 | * $I->sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST |
||
1705 | * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET |
||
1706 | * |
||
1707 | * ``` |
||
1708 | * |
||
1709 | * @param $uri |
||
1710 | * @param $params |
||
1711 | * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest() |
||
1712 | */ |
||
1713 | public function sendAjaxPostRequest($uri, $params = null) { |
||
1716 | |||
1717 | |||
1718 | /** |
||
1719 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1720 | * |
||
1721 | * If your page triggers an ajax request, you can perform it manually. |
||
1722 | * This action sends an ajax request with specified method and params. |
||
1723 | * |
||
1724 | * Example: |
||
1725 | * |
||
1726 | * You need to perform an ajax request specifying the HTTP method. |
||
1727 | * |
||
1728 | * ``` php |
||
1729 | * <?php |
||
1730 | * $I->sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title')); |
||
1731 | * |
||
1732 | * ``` |
||
1733 | * |
||
1734 | * @param $method |
||
1735 | * @param $uri |
||
1736 | * @param $params |
||
1737 | * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest() |
||
1738 | */ |
||
1739 | public function sendAjaxRequest($method, $uri, $params = null) { |
||
1742 | |||
1743 | |||
1744 | /** |
||
1745 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1746 | * |
||
1747 | * Finds and returns the text contents of the given element. |
||
1748 | * If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression. |
||
1749 | * |
||
1750 | * ``` php |
||
1751 | * <?php |
||
1752 | * $heading = $I->grabTextFrom('h1'); |
||
1753 | * $heading = $I->grabTextFrom('descendant-or-self::h1'); |
||
1754 | * $value = $I->grabTextFrom('~<input value=(.*?)]~sgi'); // match with a regex |
||
1755 | * ?> |
||
1756 | * ``` |
||
1757 | * |
||
1758 | * @param $cssOrXPathOrRegex |
||
1759 | * |
||
1760 | * @return mixed |
||
1761 | * @see \Codeception\Lib\InnerBrowser::grabTextFrom() |
||
1762 | */ |
||
1763 | public function grabTextFrom($cssOrXPathOrRegex) { |
||
1766 | |||
1767 | |||
1768 | /** |
||
1769 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1770 | * |
||
1771 | * Grabs the value of the given attribute value from the given element. |
||
1772 | * Fails if element is not found. |
||
1773 | * |
||
1774 | * ``` php |
||
1775 | * <?php |
||
1776 | * $I->grabAttributeFrom('#tooltip', 'title'); |
||
1777 | * ?> |
||
1778 | * ``` |
||
1779 | * |
||
1780 | * |
||
1781 | * @param $cssOrXpath |
||
1782 | * @param $attribute |
||
1783 | * @internal param $element |
||
1784 | * @return mixed |
||
1785 | * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom() |
||
1786 | */ |
||
1787 | public function grabAttributeFrom($cssOrXpath, $attribute) { |
||
1790 | |||
1791 | |||
1792 | /** |
||
1793 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1794 | * |
||
1795 | * |
||
1796 | * @see \Codeception\Lib\InnerBrowser::grabMultiple() |
||
1797 | */ |
||
1798 | public function grabMultiple($cssOrXpath, $attribute = null) { |
||
1801 | |||
1802 | |||
1803 | /** |
||
1804 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1805 | * |
||
1806 | * @param $field |
||
1807 | * |
||
1808 | * @return array|mixed|null|string |
||
1809 | * @see \Codeception\Lib\InnerBrowser::grabValueFrom() |
||
1810 | */ |
||
1811 | public function grabValueFrom($field) { |
||
1814 | |||
1815 | |||
1816 | /** |
||
1817 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1818 | * |
||
1819 | * Sets a cookie with the given name and value. |
||
1820 | * You can set additional cookie params like `domain`, `path`, `expire`, `secure` in array passed as last argument. |
||
1821 | * |
||
1822 | * ``` php |
||
1823 | * <?php |
||
1824 | * $I->setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); |
||
1825 | * ?> |
||
1826 | * ``` |
||
1827 | * |
||
1828 | * @param $name |
||
1829 | * @param $val |
||
1830 | * @param array $params |
||
1831 | * |
||
1832 | * @return mixed |
||
1833 | * @see \Codeception\Lib\InnerBrowser::setCookie() |
||
1834 | */ |
||
1835 | public function setCookie($name, $val, $params = null) { |
||
1838 | |||
1839 | |||
1840 | /** |
||
1841 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1842 | * |
||
1843 | * Grabs a cookie value. |
||
1844 | * You can set additional cookie params like `domain`, `path` in array passed as last argument. |
||
1845 | * |
||
1846 | * @param $cookie |
||
1847 | * |
||
1848 | * @param array $params |
||
1849 | * @return mixed |
||
1850 | * @see \Codeception\Lib\InnerBrowser::grabCookie() |
||
1851 | */ |
||
1852 | public function grabCookie($cookie, $params = null) { |
||
1855 | |||
1856 | |||
1857 | /** |
||
1858 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1859 | * |
||
1860 | * Checks that a cookie with the given name is set. |
||
1861 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
||
1862 | * |
||
1863 | * ``` php |
||
1864 | * <?php |
||
1865 | * $I->seeCookie('PHPSESSID'); |
||
1866 | * ?> |
||
1867 | * ``` |
||
1868 | * |
||
1869 | * @param $cookie |
||
1870 | * @param array $params |
||
1871 | * @return mixed |
||
1872 | * Conditional Assertion: Test won't be stopped on fail |
||
1873 | * @see \Codeception\Lib\InnerBrowser::seeCookie() |
||
1874 | */ |
||
1875 | public function canSeeCookie($cookie, $params = null) { |
||
1878 | /** |
||
1879 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1880 | * |
||
1881 | * Checks that a cookie with the given name is set. |
||
1882 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
||
1883 | * |
||
1884 | * ``` php |
||
1885 | * <?php |
||
1886 | * $I->seeCookie('PHPSESSID'); |
||
1887 | * ?> |
||
1888 | * ``` |
||
1889 | * |
||
1890 | * @param $cookie |
||
1891 | * @param array $params |
||
1892 | * @return mixed |
||
1893 | * @see \Codeception\Lib\InnerBrowser::seeCookie() |
||
1894 | */ |
||
1895 | public function seeCookie($cookie, $params = null) { |
||
1898 | |||
1899 | |||
1900 | /** |
||
1901 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1902 | * |
||
1903 | * Checks that there isn't a cookie with the given name. |
||
1904 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
||
1905 | * |
||
1906 | * @param $cookie |
||
1907 | * |
||
1908 | * @param array $params |
||
1909 | * @return mixed |
||
1910 | * Conditional Assertion: Test won't be stopped on fail |
||
1911 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() |
||
1912 | */ |
||
1913 | public function cantSeeCookie($cookie, $params = null) { |
||
1916 | /** |
||
1917 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1918 | * |
||
1919 | * Checks that there isn't a cookie with the given name. |
||
1920 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
||
1921 | * |
||
1922 | * @param $cookie |
||
1923 | * |
||
1924 | * @param array $params |
||
1925 | * @return mixed |
||
1926 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() |
||
1927 | */ |
||
1928 | public function dontSeeCookie($cookie, $params = null) { |
||
1931 | |||
1932 | |||
1933 | /** |
||
1934 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1935 | * |
||
1936 | * Unsets cookie with the given name. |
||
1937 | * You can set additional cookie params like `domain`, `path` in array passed as last argument. |
||
1938 | * |
||
1939 | * @param $cookie |
||
1940 | * |
||
1941 | * @param array $params |
||
1942 | * @return mixed |
||
1943 | * @see \Codeception\Lib\InnerBrowser::resetCookie() |
||
1944 | */ |
||
1945 | public function resetCookie($name, $params = null) { |
||
1948 | |||
1949 | |||
1950 | /** |
||
1951 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1952 | * |
||
1953 | * Checks that the given element exists on the page and is visible. |
||
1954 | * You can also specify expected attributes of this element. |
||
1955 | * |
||
1956 | * ``` php |
||
1957 | * <?php |
||
1958 | * $I->seeElement('.error'); |
||
1959 | * $I->seeElement('//form/input[1]'); |
||
1960 | * $I->seeElement('input', ['name' => 'login']); |
||
1961 | * $I->seeElement('input', ['value' => '123456']); |
||
1962 | * |
||
1963 | * // strict locator in first arg, attributes in second |
||
1964 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); |
||
1965 | * ?> |
||
1966 | * ``` |
||
1967 | * |
||
1968 | * @param $selector |
||
1969 | * @param array $attributes |
||
1970 | * @return |
||
1971 | * Conditional Assertion: Test won't be stopped on fail |
||
1972 | * @see \Codeception\Lib\InnerBrowser::seeElement() |
||
1973 | */ |
||
1974 | public function canSeeElement($selector, $attributes = null) { |
||
1977 | /** |
||
1978 | * [!] Method is generated. Documentation taken from corresponding module. |
||
1979 | * |
||
1980 | * Checks that the given element exists on the page and is visible. |
||
1981 | * You can also specify expected attributes of this element. |
||
1982 | * |
||
1983 | * ``` php |
||
1984 | * <?php |
||
1985 | * $I->seeElement('.error'); |
||
1986 | * $I->seeElement('//form/input[1]'); |
||
1987 | * $I->seeElement('input', ['name' => 'login']); |
||
1988 | * $I->seeElement('input', ['value' => '123456']); |
||
1989 | * |
||
1990 | * // strict locator in first arg, attributes in second |
||
1991 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); |
||
1992 | * ?> |
||
1993 | * ``` |
||
1994 | * |
||
1995 | * @param $selector |
||
1996 | * @param array $attributes |
||
1997 | * @return |
||
1998 | * @see \Codeception\Lib\InnerBrowser::seeElement() |
||
1999 | */ |
||
2000 | public function seeElement($selector, $attributes = null) { |
||
2003 | |||
2004 | |||
2005 | /** |
||
2006 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2007 | * |
||
2008 | * Checks that the given element is invisible or not present on the page. |
||
2009 | * You can also specify expected attributes of this element. |
||
2010 | * |
||
2011 | * ``` php |
||
2012 | * <?php |
||
2013 | * $I->dontSeeElement('.error'); |
||
2014 | * $I->dontSeeElement('//form/input[1]'); |
||
2015 | * $I->dontSeeElement('input', ['name' => 'login']); |
||
2016 | * $I->dontSeeElement('input', ['value' => '123456']); |
||
2017 | * ?> |
||
2018 | * ``` |
||
2019 | * |
||
2020 | * @param $selector |
||
2021 | * @param array $attributes |
||
2022 | * Conditional Assertion: Test won't be stopped on fail |
||
2023 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() |
||
2024 | */ |
||
2025 | public function cantSeeElement($selector, $attributes = null) { |
||
2028 | /** |
||
2029 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2030 | * |
||
2031 | * Checks that the given element is invisible or not present on the page. |
||
2032 | * You can also specify expected attributes of this element. |
||
2033 | * |
||
2034 | * ``` php |
||
2035 | * <?php |
||
2036 | * $I->dontSeeElement('.error'); |
||
2037 | * $I->dontSeeElement('//form/input[1]'); |
||
2038 | * $I->dontSeeElement('input', ['name' => 'login']); |
||
2039 | * $I->dontSeeElement('input', ['value' => '123456']); |
||
2040 | * ?> |
||
2041 | * ``` |
||
2042 | * |
||
2043 | * @param $selector |
||
2044 | * @param array $attributes |
||
2045 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() |
||
2046 | */ |
||
2047 | public function dontSeeElement($selector, $attributes = null) { |
||
2050 | |||
2051 | |||
2052 | /** |
||
2053 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2054 | * |
||
2055 | * Checks that there are a certain number of elements matched by the given locator on the page. |
||
2056 | * |
||
2057 | * ``` php |
||
2058 | * <?php |
||
2059 | * $I->seeNumberOfElements('tr', 10); |
||
2060 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements |
||
2061 | * ?> |
||
2062 | * ``` |
||
2063 | * @param $selector |
||
2064 | * @param mixed $expected : |
||
2065 | * - string: strict number |
||
2066 | * - array: range of numbers [0,10] |
||
2067 | * Conditional Assertion: Test won't be stopped on fail |
||
2068 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() |
||
2069 | */ |
||
2070 | public function canSeeNumberOfElements($selector, $expected) { |
||
2073 | /** |
||
2074 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2075 | * |
||
2076 | * Checks that there are a certain number of elements matched by the given locator on the page. |
||
2077 | * |
||
2078 | * ``` php |
||
2079 | * <?php |
||
2080 | * $I->seeNumberOfElements('tr', 10); |
||
2081 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements |
||
2082 | * ?> |
||
2083 | * ``` |
||
2084 | * @param $selector |
||
2085 | * @param mixed $expected : |
||
2086 | * - string: strict number |
||
2087 | * - array: range of numbers [0,10] |
||
2088 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() |
||
2089 | */ |
||
2090 | public function seeNumberOfElements($selector, $expected) { |
||
2093 | |||
2094 | |||
2095 | /** |
||
2096 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2097 | * |
||
2098 | * Checks that the given option is selected. |
||
2099 | * |
||
2100 | * ``` php |
||
2101 | * <?php |
||
2102 | * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa'); |
||
2103 | * ?> |
||
2104 | * ``` |
||
2105 | * |
||
2106 | * @param $selector |
||
2107 | * @param $optionText |
||
2108 | * |
||
2109 | * @return mixed |
||
2110 | * Conditional Assertion: Test won't be stopped on fail |
||
2111 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() |
||
2112 | */ |
||
2113 | public function canSeeOptionIsSelected($selector, $optionText) { |
||
2116 | /** |
||
2117 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2118 | * |
||
2119 | * Checks that the given option is selected. |
||
2120 | * |
||
2121 | * ``` php |
||
2122 | * <?php |
||
2123 | * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa'); |
||
2124 | * ?> |
||
2125 | * ``` |
||
2126 | * |
||
2127 | * @param $selector |
||
2128 | * @param $optionText |
||
2129 | * |
||
2130 | * @return mixed |
||
2131 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() |
||
2132 | */ |
||
2133 | public function seeOptionIsSelected($selector, $optionText) { |
||
2136 | |||
2137 | |||
2138 | /** |
||
2139 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2140 | * |
||
2141 | * Checks that the given option is not selected. |
||
2142 | * |
||
2143 | * ``` php |
||
2144 | * <?php |
||
2145 | * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); |
||
2146 | * ?> |
||
2147 | * ``` |
||
2148 | * |
||
2149 | * @param $selector |
||
2150 | * @param $optionText |
||
2151 | * |
||
2152 | * @return mixed |
||
2153 | * Conditional Assertion: Test won't be stopped on fail |
||
2154 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() |
||
2155 | */ |
||
2156 | public function cantSeeOptionIsSelected($selector, $optionText) { |
||
2159 | /** |
||
2160 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2161 | * |
||
2162 | * Checks that the given option is not selected. |
||
2163 | * |
||
2164 | * ``` php |
||
2165 | * <?php |
||
2166 | * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); |
||
2167 | * ?> |
||
2168 | * ``` |
||
2169 | * |
||
2170 | * @param $selector |
||
2171 | * @param $optionText |
||
2172 | * |
||
2173 | * @return mixed |
||
2174 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() |
||
2175 | */ |
||
2176 | public function dontSeeOptionIsSelected($selector, $optionText) { |
||
2179 | |||
2180 | |||
2181 | /** |
||
2182 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2183 | * |
||
2184 | * Asserts that current page has 404 response status code. |
||
2185 | * Conditional Assertion: Test won't be stopped on fail |
||
2186 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() |
||
2187 | */ |
||
2188 | public function canSeePageNotFound() { |
||
2191 | /** |
||
2192 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2193 | * |
||
2194 | * Asserts that current page has 404 response status code. |
||
2195 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() |
||
2196 | */ |
||
2197 | public function seePageNotFound() { |
||
2200 | |||
2201 | |||
2202 | /** |
||
2203 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2204 | * |
||
2205 | * Checks that response code is equal to value provided. |
||
2206 | * |
||
2207 | * @param $code |
||
2208 | * |
||
2209 | * @return mixed |
||
2210 | * Conditional Assertion: Test won't be stopped on fail |
||
2211 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() |
||
2212 | */ |
||
2213 | public function canSeeResponseCodeIs($code) { |
||
2216 | /** |
||
2217 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2218 | * |
||
2219 | * Checks that response code is equal to value provided. |
||
2220 | * |
||
2221 | * @param $code |
||
2222 | * |
||
2223 | * @return mixed |
||
2224 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() |
||
2225 | */ |
||
2226 | public function seeResponseCodeIs($code) { |
||
2229 | |||
2230 | |||
2231 | /** |
||
2232 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2233 | * |
||
2234 | * Checks that the page title contains the given string. |
||
2235 | * |
||
2236 | * ``` php |
||
2237 | * <?php |
||
2238 | * $I->seeInTitle('Blog - Post #1'); |
||
2239 | * ?> |
||
2240 | * ``` |
||
2241 | * |
||
2242 | * @param $title |
||
2243 | * |
||
2244 | * @return mixed |
||
2245 | * Conditional Assertion: Test won't be stopped on fail |
||
2246 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() |
||
2247 | */ |
||
2248 | public function canSeeInTitle($title) { |
||
2251 | /** |
||
2252 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2253 | * |
||
2254 | * Checks that the page title contains the given string. |
||
2255 | * |
||
2256 | * ``` php |
||
2257 | * <?php |
||
2258 | * $I->seeInTitle('Blog - Post #1'); |
||
2259 | * ?> |
||
2260 | * ``` |
||
2261 | * |
||
2262 | * @param $title |
||
2263 | * |
||
2264 | * @return mixed |
||
2265 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() |
||
2266 | */ |
||
2267 | public function seeInTitle($title) { |
||
2270 | |||
2271 | |||
2272 | /** |
||
2273 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2274 | * |
||
2275 | * Checks that the page title does not contain the given string. |
||
2276 | * |
||
2277 | * @param $title |
||
2278 | * |
||
2279 | * @return mixed |
||
2280 | * Conditional Assertion: Test won't be stopped on fail |
||
2281 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() |
||
2282 | */ |
||
2283 | public function cantSeeInTitle($title) { |
||
2286 | /** |
||
2287 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2288 | * |
||
2289 | * Checks that the page title does not contain the given string. |
||
2290 | * |
||
2291 | * @param $title |
||
2292 | * |
||
2293 | * @return mixed |
||
2294 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() |
||
2295 | */ |
||
2296 | public function dontSeeInTitle($title) { |
||
2299 | |||
2300 | |||
2301 | /** |
||
2302 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2303 | * |
||
2304 | * @inheritdoc |
||
2305 | * @see \tests\codeception\common\_support\FixtureHelper::globalFixtures() |
||
2306 | */ |
||
2307 | public function globalFixtures() { |
||
2310 | |||
2311 | |||
2312 | /** |
||
2313 | * [!] Method is generated. Documentation taken from corresponding module. |
||
2314 | * |
||
2315 | * @inheritdoc |
||
2316 | * @see \tests\codeception\common\_support\FixtureHelper::fixtures() |
||
2317 | */ |
||
2318 | public function fixtures() { |
||
2321 | } |
||
2322 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.