@@ 12-2610 (lines=2599) @@ | ||
9 | use Codeception\Module\Yii2; |
|
10 | use tests\codeception\common\_support\FixtureHelper; |
|
11 | ||
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) { |
|
30 | return $this->getScenario()->runStep(new \Codeception\Step\Condition('amInPath', func_get_args())); |
|
31 | } |
|
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) { |
|
52 | return $this->getScenario()->runStep(new \Codeception\Step\Action('openFile', func_get_args())); |
|
53 | } |
|
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) { |
|
71 | return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteFile', func_get_args())); |
|
72 | } |
|
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) { |
|
90 | return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteDir', func_get_args())); |
|
91 | } |
|
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) { |
|
110 | return $this->getScenario()->runStep(new \Codeception\Step\Action('copyDir', func_get_args())); |
|
111 | } |
|
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) { |
|
133 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args())); |
|
134 | } |
|
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) { |
|
153 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args())); |
|
154 | } |
|
155 | ||
156 | ||
157 | /** |
|
158 | * [!] Method is generated. Documentation taken from corresponding module. |
|
159 | * |
|
160 | * Checks If opened file has the `number` of new lines. |
|
161 | * |
|
162 | * Usage: |
|
163 | * |
|
164 | * ``` php |
|
165 | * <?php |
|
166 | * $I->openFile('composer.json'); |
|
167 | * $I->seeNumberNewLines(5); |
|
168 | * ?> |
|
169 | * ``` |
|
170 | * |
|
171 | * @param int $number New lines |
|
172 | * Conditional Assertion: Test won't be stopped on fail |
|
173 | * @see \Codeception\Module\Filesystem::seeNumberNewLines() |
|
174 | */ |
|
175 | public function canSeeNumberNewLines($number) { |
|
176 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberNewLines', func_get_args())); |
|
177 | } |
|
178 | /** |
|
179 | * [!] Method is generated. Documentation taken from corresponding module. |
|
180 | * |
|
181 | * Checks If opened file has the `number` of new lines. |
|
182 | * |
|
183 | * Usage: |
|
184 | * |
|
185 | * ``` php |
|
186 | * <?php |
|
187 | * $I->openFile('composer.json'); |
|
188 | * $I->seeNumberNewLines(5); |
|
189 | * ?> |
|
190 | * ``` |
|
191 | * |
|
192 | * @param int $number New lines |
|
193 | * @see \Codeception\Module\Filesystem::seeNumberNewLines() |
|
194 | */ |
|
195 | public function seeNumberNewLines($number) { |
|
196 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberNewLines', func_get_args())); |
|
197 | } |
|
198 | ||
199 | ||
200 | /** |
|
201 | * [!] Method is generated. Documentation taken from corresponding module. |
|
202 | * |
|
203 | * Checks the strict matching of file contents. |
|
204 | * Unlike `seeInThisFile` will fail if file has something more than expected lines. |
|
205 | * Better to use with HEREDOC strings. |
|
206 | * Matching is done after removing "\r" chars from file content. |
|
207 | * |
|
208 | * ``` php |
|
209 | * <?php |
|
210 | * $I->openFile('process.pid'); |
|
211 | * $I->seeFileContentsEqual('3192'); |
|
212 | * ?> |
|
213 | * ``` |
|
214 | * |
|
215 | * @param $text |
|
216 | * Conditional Assertion: Test won't be stopped on fail |
|
217 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() |
|
218 | */ |
|
219 | public function canSeeFileContentsEqual($text) { |
|
220 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args())); |
|
221 | } |
|
222 | /** |
|
223 | * [!] Method is generated. Documentation taken from corresponding module. |
|
224 | * |
|
225 | * Checks the strict matching of file contents. |
|
226 | * Unlike `seeInThisFile` will fail if file has something more than expected lines. |
|
227 | * Better to use with HEREDOC strings. |
|
228 | * Matching is done after removing "\r" chars from file content. |
|
229 | * |
|
230 | * ``` php |
|
231 | * <?php |
|
232 | * $I->openFile('process.pid'); |
|
233 | * $I->seeFileContentsEqual('3192'); |
|
234 | * ?> |
|
235 | * ``` |
|
236 | * |
|
237 | * @param $text |
|
238 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() |
|
239 | */ |
|
240 | public function seeFileContentsEqual($text) { |
|
241 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args())); |
|
242 | } |
|
243 | ||
244 | ||
245 | /** |
|
246 | * [!] Method is generated. Documentation taken from corresponding module. |
|
247 | * |
|
248 | * Checks If opened file doesn't contain `text` in it |
|
249 | * |
|
250 | * ``` php |
|
251 | * <?php |
|
252 | * $I->openFile('composer.json'); |
|
253 | * $I->dontSeeInThisFile('codeception/codeception'); |
|
254 | * ?> |
|
255 | * ``` |
|
256 | * |
|
257 | * @param $text |
|
258 | * Conditional Assertion: Test won't be stopped on fail |
|
259 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() |
|
260 | */ |
|
261 | public function cantSeeInThisFile($text) { |
|
262 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args())); |
|
263 | } |
|
264 | /** |
|
265 | * [!] Method is generated. Documentation taken from corresponding module. |
|
266 | * |
|
267 | * Checks If opened file doesn't contain `text` in it |
|
268 | * |
|
269 | * ``` php |
|
270 | * <?php |
|
271 | * $I->openFile('composer.json'); |
|
272 | * $I->dontSeeInThisFile('codeception/codeception'); |
|
273 | * ?> |
|
274 | * ``` |
|
275 | * |
|
276 | * @param $text |
|
277 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() |
|
278 | */ |
|
279 | public function dontSeeInThisFile($text) { |
|
280 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args())); |
|
281 | } |
|
282 | ||
283 | ||
284 | /** |
|
285 | * [!] Method is generated. Documentation taken from corresponding module. |
|
286 | * |
|
287 | * Deletes a file |
|
288 | * @see \Codeception\Module\Filesystem::deleteThisFile() |
|
289 | */ |
|
290 | public function deleteThisFile() { |
|
291 | return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args())); |
|
292 | } |
|
293 | ||
294 | ||
295 | /** |
|
296 | * [!] Method is generated. Documentation taken from corresponding module. |
|
297 | * |
|
298 | * Checks if file exists in path. |
|
299 | * Opens a file when it's exists |
|
300 | * |
|
301 | * ``` php |
|
302 | * <?php |
|
303 | * $I->seeFileFound('UserModel.php','app/models'); |
|
304 | * ?> |
|
305 | * ``` |
|
306 | * |
|
307 | * @param $filename |
|
308 | * @param string $path |
|
309 | * Conditional Assertion: Test won't be stopped on fail |
|
310 | * @see \Codeception\Module\Filesystem::seeFileFound() |
|
311 | */ |
|
312 | public function canSeeFileFound($filename, $path = null) { |
|
313 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args())); |
|
314 | } |
|
315 | /** |
|
316 | * [!] Method is generated. Documentation taken from corresponding module. |
|
317 | * |
|
318 | * Checks if file exists in path. |
|
319 | * Opens a file when it's exists |
|
320 | * |
|
321 | * ``` php |
|
322 | * <?php |
|
323 | * $I->seeFileFound('UserModel.php','app/models'); |
|
324 | * ?> |
|
325 | * ``` |
|
326 | * |
|
327 | * @param $filename |
|
328 | * @param string $path |
|
329 | * @see \Codeception\Module\Filesystem::seeFileFound() |
|
330 | */ |
|
331 | public function seeFileFound($filename, $path = null) { |
|
332 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args())); |
|
333 | } |
|
334 | ||
335 | ||
336 | /** |
|
337 | * [!] Method is generated. Documentation taken from corresponding module. |
|
338 | * |
|
339 | * Checks if file does not exist in path |
|
340 | * |
|
341 | * @param $filename |
|
342 | * @param string $path |
|
343 | * Conditional Assertion: Test won't be stopped on fail |
|
344 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() |
|
345 | */ |
|
346 | public function cantSeeFileFound($filename, $path = null) { |
|
347 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args())); |
|
348 | } |
|
349 | /** |
|
350 | * [!] Method is generated. Documentation taken from corresponding module. |
|
351 | * |
|
352 | * Checks if file does not exist in path |
|
353 | * |
|
354 | * @param $filename |
|
355 | * @param string $path |
|
356 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() |
|
357 | */ |
|
358 | public function dontSeeFileFound($filename, $path = null) { |
|
359 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args())); |
|
360 | } |
|
361 | ||
362 | ||
363 | /** |
|
364 | * [!] Method is generated. Documentation taken from corresponding module. |
|
365 | * |
|
366 | * Erases directory contents |
|
367 | * |
|
368 | * ``` php |
|
369 | * <?php |
|
370 | * $I->cleanDir('logs'); |
|
371 | * ?> |
|
372 | * ``` |
|
373 | * |
|
374 | * @param $dirname |
|
375 | * @see \Codeception\Module\Filesystem::cleanDir() |
|
376 | */ |
|
377 | public function cleanDir($dirname) { |
|
378 | return $this->getScenario()->runStep(new \Codeception\Step\Action('cleanDir', func_get_args())); |
|
379 | } |
|
380 | ||
381 | ||
382 | /** |
|
383 | * [!] Method is generated. Documentation taken from corresponding module. |
|
384 | * |
|
385 | * Saves contents to file |
|
386 | * |
|
387 | * @param $filename |
|
388 | * @param $contents |
|
389 | * @see \Codeception\Module\Filesystem::writeToFile() |
|
390 | */ |
|
391 | public function writeToFile($filename, $contents) { |
|
392 | return $this->getScenario()->runStep(new \Codeception\Step\Action('writeToFile', func_get_args())); |
|
393 | } |
|
394 | ||
395 | ||
396 | /** |
|
397 | * [!] Method is generated. Documentation taken from corresponding module. |
|
398 | * |
|
399 | * Inserts record into the database. |
|
400 | * |
|
401 | * ``` php |
|
402 | * <?php |
|
403 | * $user_id = $I->haveRecord('app\models\User', array('name' => 'Davert')); |
|
404 | * ?> |
|
405 | * ``` |
|
406 | * |
|
407 | * @param $model |
|
408 | * @param array $attributes |
|
409 | * @return mixed |
|
410 | * @part orm |
|
411 | * @see \Codeception\Module\Yii2::haveRecord() |
|
412 | */ |
|
413 | public function haveRecord($model, $attributes = null) { |
|
414 | return $this->getScenario()->runStep(new \Codeception\Step\Action('haveRecord', func_get_args())); |
|
415 | } |
|
416 | ||
417 | ||
418 | /** |
|
419 | * [!] Method is generated. Documentation taken from corresponding module. |
|
420 | * |
|
421 | * Checks that record exists in database. |
|
422 | * |
|
423 | * ``` php |
|
424 | * $I->seeRecord('app\models\User', array('name' => 'davert')); |
|
425 | * ``` |
|
426 | * |
|
427 | * @param $model |
|
428 | * @param array $attributes |
|
429 | * @part orm |
|
430 | * Conditional Assertion: Test won't be stopped on fail |
|
431 | * @see \Codeception\Module\Yii2::seeRecord() |
|
432 | */ |
|
433 | public function canSeeRecord($model, $attributes = null) { |
|
434 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeRecord', func_get_args())); |
|
435 | } |
|
436 | /** |
|
437 | * [!] Method is generated. Documentation taken from corresponding module. |
|
438 | * |
|
439 | * Checks that record exists in database. |
|
440 | * |
|
441 | * ``` php |
|
442 | * $I->seeRecord('app\models\User', array('name' => 'davert')); |
|
443 | * ``` |
|
444 | * |
|
445 | * @param $model |
|
446 | * @param array $attributes |
|
447 | * @part orm |
|
448 | * @see \Codeception\Module\Yii2::seeRecord() |
|
449 | */ |
|
450 | public function seeRecord($model, $attributes = null) { |
|
451 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeRecord', func_get_args())); |
|
452 | } |
|
453 | ||
454 | ||
455 | /** |
|
456 | * [!] Method is generated. Documentation taken from corresponding module. |
|
457 | * |
|
458 | * Checks that record does not exist in database. |
|
459 | * |
|
460 | * ``` php |
|
461 | * $I->dontSeeRecord('app\models\User', array('name' => 'davert')); |
|
462 | * ``` |
|
463 | * |
|
464 | * @param $model |
|
465 | * @param array $attributes |
|
466 | * @part orm |
|
467 | * Conditional Assertion: Test won't be stopped on fail |
|
468 | * @see \Codeception\Module\Yii2::dontSeeRecord() |
|
469 | */ |
|
470 | public function cantSeeRecord($model, $attributes = null) { |
|
471 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeRecord', func_get_args())); |
|
472 | } |
|
473 | /** |
|
474 | * [!] Method is generated. Documentation taken from corresponding module. |
|
475 | * |
|
476 | * Checks that record does not exist in database. |
|
477 | * |
|
478 | * ``` php |
|
479 | * $I->dontSeeRecord('app\models\User', array('name' => 'davert')); |
|
480 | * ``` |
|
481 | * |
|
482 | * @param $model |
|
483 | * @param array $attributes |
|
484 | * @part orm |
|
485 | * @see \Codeception\Module\Yii2::dontSeeRecord() |
|
486 | */ |
|
487 | public function dontSeeRecord($model, $attributes = null) { |
|
488 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeRecord', func_get_args())); |
|
489 | } |
|
490 | ||
491 | ||
492 | /** |
|
493 | * [!] Method is generated. Documentation taken from corresponding module. |
|
494 | * |
|
495 | * Retrieves record from database |
|
496 | * |
|
497 | * ``` php |
|
498 | * $category = $I->grabRecord('app\models\User', array('name' => 'davert')); |
|
499 | * ``` |
|
500 | * |
|
501 | * @param $model |
|
502 | * @param array $attributes |
|
503 | * @return mixed |
|
504 | * @part orm |
|
505 | * @see \Codeception\Module\Yii2::grabRecord() |
|
506 | */ |
|
507 | public function grabRecord($model, $attributes = null) { |
|
508 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabRecord', func_get_args())); |
|
509 | } |
|
510 | ||
511 | ||
512 | /** |
|
513 | * [!] Method is generated. Documentation taken from corresponding module. |
|
514 | * |
|
515 | * Converting $page to valid Yii 2 URL |
|
516 | * |
|
517 | * Allows input like: |
|
518 | * |
|
519 | * ```php |
|
520 | * $I->amOnPage(['site/view','page'=>'about']); |
|
521 | * $I->amOnPage('index-test.php?site/index'); |
|
522 | * $I->amOnPage('http://localhost/index-test.php?site/index'); |
|
523 | * ``` |
|
524 | * |
|
525 | * @param $page string|array parameter for \yii\web\UrlManager::createUrl() |
|
526 | * @see \Codeception\Module\Yii2::amOnPage() |
|
527 | */ |
|
528 | public function amOnPage($page) { |
|
529 | return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); |
|
530 | } |
|
531 | ||
532 | ||
533 | /** |
|
534 | * [!] Method is generated. Documentation taken from corresponding module. |
|
535 | * |
|
536 | * Returns a list of regex patterns for recognized domain names |
|
537 | * |
|
538 | * @return array |
|
539 | * @see \Codeception\Module\Yii2::getInternalDomains() |
|
540 | */ |
|
541 | public function getInternalDomains() { |
|
542 | return $this->getScenario()->runStep(new \Codeception\Step\Action('getInternalDomains', func_get_args())); |
|
543 | } |
|
544 | ||
545 | ||
546 | /** |
|
547 | * [!] Method is generated. Documentation taken from corresponding module. |
|
548 | * |
|
549 | * Authenticates user for HTTP_AUTH |
|
550 | * |
|
551 | * @param $username |
|
552 | * @param $password |
|
553 | * @see \Codeception\Lib\InnerBrowser::amHttpAuthenticated() |
|
554 | */ |
|
555 | public function amHttpAuthenticated($username, $password) { |
|
556 | return $this->getScenario()->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args())); |
|
557 | } |
|
558 | ||
559 | ||
560 | /** |
|
561 | * [!] Method is generated. Documentation taken from corresponding module. |
|
562 | * |
|
563 | * Perform a click on a link or a button, given by a locator. |
|
564 | * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. |
|
565 | * For buttons, the "value" attribute, "name" attribute, and inner text are searched. |
|
566 | * For links, the link text is searched. |
|
567 | * For images, the "alt" attribute and inner text of any parent links are searched. |
|
568 | * |
|
569 | * The second parameter is a context (CSS or XPath locator) to narrow the search. |
|
570 | * |
|
571 | * Note that if the locator matches a button of type `submit`, the form will be submitted. |
|
572 | * |
|
573 | * ``` php |
|
574 | * <?php |
|
575 | * // simple link |
|
576 | * $I->click('Logout'); |
|
577 | * // button of form |
|
578 | * $I->click('Submit'); |
|
579 | * // CSS button |
|
580 | * $I->click('#form input[type=submit]'); |
|
581 | * // XPath |
|
582 | * $I->click('//form/*[@type=submit]'); |
|
583 | * // link in context |
|
584 | * $I->click('Logout', '#nav'); |
|
585 | * // using strict locator |
|
586 | * $I->click(['link' => 'Login']); |
|
587 | * ?> |
|
588 | * ``` |
|
589 | * |
|
590 | * @param $link |
|
591 | * @param $context |
|
592 | * @see \Codeception\Lib\InnerBrowser::click() |
|
593 | */ |
|
594 | public function click($link, $context = null) { |
|
595 | return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args())); |
|
596 | } |
|
597 | ||
598 | ||
599 | /** |
|
600 | * [!] Method is generated. Documentation taken from corresponding module. |
|
601 | * |
|
602 | * Checks that the current page contains the given string (case insensitive). |
|
603 | * |
|
604 | * You can specify a specific HTML element (via CSS or XPath) as the second |
|
605 | * parameter to only search within that element. |
|
606 | * |
|
607 | * ``` php |
|
608 | * <?php |
|
609 | * $I->see('Logout'); // I can suppose user is logged in |
|
610 | * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page |
|
611 | * $I->see('Sign Up', '//body/h1'); // with XPath |
|
612 | * ``` |
|
613 | * |
|
614 | * Note that the search is done after stripping all HTML tags from the body, |
|
615 | * so `$I->see('strong')` will return true for strings like: |
|
616 | * |
|
617 | * - `<p>I am Stronger than thou</p>` |
|
618 | * - `<script>document.createElement('strong');</script>` |
|
619 | * |
|
620 | * But will *not* be true for strings like: |
|
621 | * |
|
622 | * - `<strong>Home</strong>` |
|
623 | * - `<div class="strong">Home</strong>` |
|
624 | * - `<!-- strong -->` |
|
625 | * |
|
626 | * For checking the raw source code, use `seeInSource()`. |
|
627 | * |
|
628 | * @param $text |
|
629 | * @param null $selector |
|
630 | * Conditional Assertion: Test won't be stopped on fail |
|
631 | * @see \Codeception\Lib\InnerBrowser::see() |
|
632 | */ |
|
633 | public function canSee($text, $selector = null) { |
|
634 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args())); |
|
635 | } |
|
636 | /** |
|
637 | * [!] Method is generated. Documentation taken from corresponding module. |
|
638 | * |
|
639 | * Checks that the current page contains the given string (case insensitive). |
|
640 | * |
|
641 | * You can specify a specific HTML element (via CSS or XPath) as the second |
|
642 | * parameter to only search within that element. |
|
643 | * |
|
644 | * ``` php |
|
645 | * <?php |
|
646 | * $I->see('Logout'); // I can suppose user is logged in |
|
647 | * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page |
|
648 | * $I->see('Sign Up', '//body/h1'); // with XPath |
|
649 | * ``` |
|
650 | * |
|
651 | * Note that the search is done after stripping all HTML tags from the body, |
|
652 | * so `$I->see('strong')` will return true for strings like: |
|
653 | * |
|
654 | * - `<p>I am Stronger than thou</p>` |
|
655 | * - `<script>document.createElement('strong');</script>` |
|
656 | * |
|
657 | * But will *not* be true for strings like: |
|
658 | * |
|
659 | * - `<strong>Home</strong>` |
|
660 | * - `<div class="strong">Home</strong>` |
|
661 | * - `<!-- strong -->` |
|
662 | * |
|
663 | * For checking the raw source code, use `seeInSource()`. |
|
664 | * |
|
665 | * @param $text |
|
666 | * @param null $selector |
|
667 | * @see \Codeception\Lib\InnerBrowser::see() |
|
668 | */ |
|
669 | public function see($text, $selector = null) { |
|
670 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args())); |
|
671 | } |
|
672 | ||
673 | ||
674 | /** |
|
675 | * [!] Method is generated. Documentation taken from corresponding module. |
|
676 | * |
|
677 | * Checks that the current page doesn't contain the text specified (case insensitive). |
|
678 | * Give a locator as the second parameter to match a specific region. |
|
679 | * |
|
680 | * ```php |
|
681 | * <?php |
|
682 | * $I->dontSee('Login'); // I can suppose user is already logged in |
|
683 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page |
|
684 | * $I->dontSee('Sign Up','//body/h1'); // with XPath |
|
685 | * ``` |
|
686 | * |
|
687 | * Note that the search is done after stripping all HTML tags from the body, |
|
688 | * so `$I->dontSee('strong')` will fail on strings like: |
|
689 | * |
|
690 | * - `<p>I am Stronger than thou</p>` |
|
691 | * - `<script>document.createElement('strong');</script>` |
|
692 | * |
|
693 | * But will ignore strings like: |
|
694 | * |
|
695 | * - `<strong>Home</strong>` |
|
696 | * - `<div class="strong">Home</strong>` |
|
697 | * - `<!-- strong -->` |
|
698 | * |
|
699 | * For checking the raw source code, use `seeInSource()`. |
|
700 | * |
|
701 | * @param $text |
|
702 | * @param null $selector |
|
703 | * Conditional Assertion: Test won't be stopped on fail |
|
704 | * @see \Codeception\Lib\InnerBrowser::dontSee() |
|
705 | */ |
|
706 | public function cantSee($text, $selector = null) { |
|
707 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args())); |
|
708 | } |
|
709 | /** |
|
710 | * [!] Method is generated. Documentation taken from corresponding module. |
|
711 | * |
|
712 | * Checks that the current page doesn't contain the text specified (case insensitive). |
|
713 | * Give a locator as the second parameter to match a specific region. |
|
714 | * |
|
715 | * ```php |
|
716 | * <?php |
|
717 | * $I->dontSee('Login'); // I can suppose user is already logged in |
|
718 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page |
|
719 | * $I->dontSee('Sign Up','//body/h1'); // with XPath |
|
720 | * ``` |
|
721 | * |
|
722 | * Note that the search is done after stripping all HTML tags from the body, |
|
723 | * so `$I->dontSee('strong')` will fail on strings like: |
|
724 | * |
|
725 | * - `<p>I am Stronger than thou</p>` |
|
726 | * - `<script>document.createElement('strong');</script>` |
|
727 | * |
|
728 | * But will ignore strings like: |
|
729 | * |
|
730 | * - `<strong>Home</strong>` |
|
731 | * - `<div class="strong">Home</strong>` |
|
732 | * - `<!-- strong -->` |
|
733 | * |
|
734 | * For checking the raw source code, use `seeInSource()`. |
|
735 | * |
|
736 | * @param $text |
|
737 | * @param null $selector |
|
738 | * @see \Codeception\Lib\InnerBrowser::dontSee() |
|
739 | */ |
|
740 | public function dontSee($text, $selector = null) { |
|
741 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args())); |
|
742 | } |
|
743 | ||
744 | ||
745 | /** |
|
746 | * [!] Method is generated. Documentation taken from corresponding module. |
|
747 | * |
|
748 | * Checks that the current page contains the given string in its |
|
749 | * raw source code. |
|
750 | * |
|
751 | * ``` php |
|
752 | * <?php |
|
753 | * $I->seeInSource('<h1>Green eggs & ham</h1>'); |
|
754 | * ``` |
|
755 | * |
|
756 | * @param $raw |
|
757 | * Conditional Assertion: Test won't be stopped on fail |
|
758 | * @see \Codeception\Lib\InnerBrowser::seeInSource() |
|
759 | */ |
|
760 | public function canSeeInSource($raw) { |
|
761 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInSource', func_get_args())); |
|
762 | } |
|
763 | /** |
|
764 | * [!] Method is generated. Documentation taken from corresponding module. |
|
765 | * |
|
766 | * Checks that the current page contains the given string in its |
|
767 | * raw source code. |
|
768 | * |
|
769 | * ``` php |
|
770 | * <?php |
|
771 | * $I->seeInSource('<h1>Green eggs & ham</h1>'); |
|
772 | * ``` |
|
773 | * |
|
774 | * @param $raw |
|
775 | * @see \Codeception\Lib\InnerBrowser::seeInSource() |
|
776 | */ |
|
777 | public function seeInSource($raw) { |
|
778 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args())); |
|
779 | } |
|
780 | ||
781 | ||
782 | /** |
|
783 | * [!] Method is generated. Documentation taken from corresponding module. |
|
784 | * |
|
785 | * Checks that the current page contains the given string in its |
|
786 | * raw source code. |
|
787 | * |
|
788 | * ```php |
|
789 | * <?php |
|
790 | * $I->dontSeeInSource('<h1>Green eggs & ham</h1>'); |
|
791 | * ``` |
|
792 | * |
|
793 | * @param $raw |
|
794 | * Conditional Assertion: Test won't be stopped on fail |
|
795 | * @see \Codeception\Lib\InnerBrowser::dontSeeInSource() |
|
796 | */ |
|
797 | public function cantSeeInSource($raw) { |
|
798 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args())); |
|
799 | } |
|
800 | /** |
|
801 | * [!] Method is generated. Documentation taken from corresponding module. |
|
802 | * |
|
803 | * Checks that the current page contains the given string in its |
|
804 | * raw source code. |
|
805 | * |
|
806 | * ```php |
|
807 | * <?php |
|
808 | * $I->dontSeeInSource('<h1>Green eggs & ham</h1>'); |
|
809 | * ``` |
|
810 | * |
|
811 | * @param $raw |
|
812 | * @see \Codeception\Lib\InnerBrowser::dontSeeInSource() |
|
813 | */ |
|
814 | public function dontSeeInSource($raw) { |
|
815 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInSource', func_get_args())); |
|
816 | } |
|
817 | ||
818 | ||
819 | /** |
|
820 | * [!] Method is generated. Documentation taken from corresponding module. |
|
821 | * |
|
822 | * Checks that there's a link with the specified text. |
|
823 | * Give a full URL as the second parameter to match links with that exact URL. |
|
824 | * |
|
825 | * ``` php |
|
826 | * <?php |
|
827 | * $I->seeLink('Logout'); // matches <a href="#">Logout</a> |
|
828 | * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a> |
|
829 | * ?> |
|
830 | * ``` |
|
831 | * |
|
832 | * @param $text |
|
833 | * @param null $url |
|
834 | * Conditional Assertion: Test won't be stopped on fail |
|
835 | * @see \Codeception\Lib\InnerBrowser::seeLink() |
|
836 | */ |
|
837 | public function canSeeLink($text, $url = null) { |
|
838 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args())); |
|
839 | } |
|
840 | /** |
|
841 | * [!] Method is generated. Documentation taken from corresponding module. |
|
842 | * |
|
843 | * Checks that there's a link with the specified text. |
|
844 | * Give a full URL as the second parameter to match links with that exact URL. |
|
845 | * |
|
846 | * ``` php |
|
847 | * <?php |
|
848 | * $I->seeLink('Logout'); // matches <a href="#">Logout</a> |
|
849 | * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a> |
|
850 | * ?> |
|
851 | * ``` |
|
852 | * |
|
853 | * @param $text |
|
854 | * @param null $url |
|
855 | * @see \Codeception\Lib\InnerBrowser::seeLink() |
|
856 | */ |
|
857 | public function seeLink($text, $url = null) { |
|
858 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args())); |
|
859 | } |
|
860 | ||
861 | ||
862 | /** |
|
863 | * [!] Method is generated. Documentation taken from corresponding module. |
|
864 | * |
|
865 | * Checks that the page doesn't contain a link with the given string. |
|
866 | * If the second parameter is given, only links with a matching "href" attribute will be checked. |
|
867 | * |
|
868 | * ``` php |
|
869 | * <?php |
|
870 | * $I->dontSeeLink('Logout'); // I suppose user is not logged in |
|
871 | * $I->dontSeeLink('Checkout now', '/store/cart.php'); |
|
872 | * ?> |
|
873 | * ``` |
|
874 | * |
|
875 | * @param $text |
|
876 | * @param null $url |
|
877 | * Conditional Assertion: Test won't be stopped on fail |
|
878 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() |
|
879 | */ |
|
880 | public function cantSeeLink($text, $url = null) { |
|
881 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args())); |
|
882 | } |
|
883 | /** |
|
884 | * [!] Method is generated. Documentation taken from corresponding module. |
|
885 | * |
|
886 | * Checks that the page doesn't contain a link with the given string. |
|
887 | * If the second parameter is given, only links with a matching "href" attribute will be checked. |
|
888 | * |
|
889 | * ``` php |
|
890 | * <?php |
|
891 | * $I->dontSeeLink('Logout'); // I suppose user is not logged in |
|
892 | * $I->dontSeeLink('Checkout now', '/store/cart.php'); |
|
893 | * ?> |
|
894 | * ``` |
|
895 | * |
|
896 | * @param $text |
|
897 | * @param null $url |
|
898 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() |
|
899 | */ |
|
900 | public function dontSeeLink($text, $url = null) { |
|
901 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args())); |
|
902 | } |
|
903 | ||
904 | ||
905 | /** |
|
906 | * [!] Method is generated. Documentation taken from corresponding module. |
|
907 | * |
|
908 | * Checks that current URI contains the given string. |
|
909 | * |
|
910 | * ``` php |
|
911 | * <?php |
|
912 | * // to match: /home/dashboard |
|
913 | * $I->seeInCurrentUrl('home'); |
|
914 | * // to match: /users/1 |
|
915 | * $I->seeInCurrentUrl('/users/'); |
|
916 | * ?> |
|
917 | * ``` |
|
918 | * |
|
919 | * @param $uri |
|
920 | * Conditional Assertion: Test won't be stopped on fail |
|
921 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() |
|
922 | */ |
|
923 | public function canSeeInCurrentUrl($uri) { |
|
924 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); |
|
925 | } |
|
926 | /** |
|
927 | * [!] Method is generated. Documentation taken from corresponding module. |
|
928 | * |
|
929 | * Checks that current URI contains the given string. |
|
930 | * |
|
931 | * ``` php |
|
932 | * <?php |
|
933 | * // to match: /home/dashboard |
|
934 | * $I->seeInCurrentUrl('home'); |
|
935 | * // to match: /users/1 |
|
936 | * $I->seeInCurrentUrl('/users/'); |
|
937 | * ?> |
|
938 | * ``` |
|
939 | * |
|
940 | * @param $uri |
|
941 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() |
|
942 | */ |
|
943 | public function seeInCurrentUrl($uri) { |
|
944 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args())); |
|
945 | } |
|
946 | ||
947 | ||
948 | /** |
|
949 | * [!] Method is generated. Documentation taken from corresponding module. |
|
950 | * |
|
951 | * Checks that the current URI doesn't contain the given string. |
|
952 | * |
|
953 | * ``` php |
|
954 | * <?php |
|
955 | * $I->dontSeeInCurrentUrl('/users/'); |
|
956 | * ?> |
|
957 | * ``` |
|
958 | * |
|
959 | * @param $uri |
|
960 | * Conditional Assertion: Test won't be stopped on fail |
|
961 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() |
|
962 | */ |
|
963 | public function cantSeeInCurrentUrl($uri) { |
|
964 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); |
|
965 | } |
|
966 | /** |
|
967 | * [!] Method is generated. Documentation taken from corresponding module. |
|
968 | * |
|
969 | * Checks that the current URI doesn't contain the given string. |
|
970 | * |
|
971 | * ``` php |
|
972 | * <?php |
|
973 | * $I->dontSeeInCurrentUrl('/users/'); |
|
974 | * ?> |
|
975 | * ``` |
|
976 | * |
|
977 | * @param $uri |
|
978 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() |
|
979 | */ |
|
980 | public function dontSeeInCurrentUrl($uri) { |
|
981 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args())); |
|
982 | } |
|
983 | ||
984 | ||
985 | /** |
|
986 | * [!] Method is generated. Documentation taken from corresponding module. |
|
987 | * |
|
988 | * Checks that the current URL is equal to the given string. |
|
989 | * Unlike `seeInCurrentUrl`, this only matches the full URL. |
|
990 | * |
|
991 | * ``` php |
|
992 | * <?php |
|
993 | * // to match root url |
|
994 | * $I->seeCurrentUrlEquals('/'); |
|
995 | * ?> |
|
996 | * ``` |
|
997 | * |
|
998 | * @param $uri |
|
999 | * Conditional Assertion: Test won't be stopped on fail |
|
1000 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() |
|
1001 | */ |
|
1002 | public function canSeeCurrentUrlEquals($uri) { |
|
1003 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); |
|
1004 | } |
|
1005 | /** |
|
1006 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1007 | * |
|
1008 | * Checks that the current URL is equal to the given string. |
|
1009 | * Unlike `seeInCurrentUrl`, this only matches the full URL. |
|
1010 | * |
|
1011 | * ``` php |
|
1012 | * <?php |
|
1013 | * // to match root url |
|
1014 | * $I->seeCurrentUrlEquals('/'); |
|
1015 | * ?> |
|
1016 | * ``` |
|
1017 | * |
|
1018 | * @param $uri |
|
1019 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() |
|
1020 | */ |
|
1021 | public function seeCurrentUrlEquals($uri) { |
|
1022 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args())); |
|
1023 | } |
|
1024 | ||
1025 | ||
1026 | /** |
|
1027 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1028 | * |
|
1029 | * Checks that the current URL doesn't equal the given string. |
|
1030 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. |
|
1031 | * |
|
1032 | * ``` php |
|
1033 | * <?php |
|
1034 | * // current url is not root |
|
1035 | * $I->dontSeeCurrentUrlEquals('/'); |
|
1036 | * ?> |
|
1037 | * ``` |
|
1038 | * |
|
1039 | * @param $uri |
|
1040 | * Conditional Assertion: Test won't be stopped on fail |
|
1041 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() |
|
1042 | */ |
|
1043 | public function cantSeeCurrentUrlEquals($uri) { |
|
1044 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); |
|
1045 | } |
|
1046 | /** |
|
1047 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1048 | * |
|
1049 | * Checks that the current URL doesn't equal the given string. |
|
1050 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. |
|
1051 | * |
|
1052 | * ``` php |
|
1053 | * <?php |
|
1054 | * // current url is not root |
|
1055 | * $I->dontSeeCurrentUrlEquals('/'); |
|
1056 | * ?> |
|
1057 | * ``` |
|
1058 | * |
|
1059 | * @param $uri |
|
1060 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() |
|
1061 | */ |
|
1062 | public function dontSeeCurrentUrlEquals($uri) { |
|
1063 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args())); |
|
1064 | } |
|
1065 | ||
1066 | ||
1067 | /** |
|
1068 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1069 | * |
|
1070 | * Checks that the current URL matches the given regular expression. |
|
1071 | * |
|
1072 | * ``` php |
|
1073 | * <?php |
|
1074 | * // to match root url |
|
1075 | * $I->seeCurrentUrlMatches('~$/users/(\d+)~'); |
|
1076 | * ?> |
|
1077 | * ``` |
|
1078 | * |
|
1079 | * @param $uri |
|
1080 | * Conditional Assertion: Test won't be stopped on fail |
|
1081 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() |
|
1082 | */ |
|
1083 | public function canSeeCurrentUrlMatches($uri) { |
|
1084 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); |
|
1085 | } |
|
1086 | /** |
|
1087 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1088 | * |
|
1089 | * Checks that the current URL matches the given regular expression. |
|
1090 | * |
|
1091 | * ``` php |
|
1092 | * <?php |
|
1093 | * // to match root url |
|
1094 | * $I->seeCurrentUrlMatches('~$/users/(\d+)~'); |
|
1095 | * ?> |
|
1096 | * ``` |
|
1097 | * |
|
1098 | * @param $uri |
|
1099 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() |
|
1100 | */ |
|
1101 | public function seeCurrentUrlMatches($uri) { |
|
1102 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args())); |
|
1103 | } |
|
1104 | ||
1105 | ||
1106 | /** |
|
1107 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1108 | * |
|
1109 | * Checks that current url doesn't match the given regular expression. |
|
1110 | * |
|
1111 | * ``` php |
|
1112 | * <?php |
|
1113 | * // to match root url |
|
1114 | * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~'); |
|
1115 | * ?> |
|
1116 | * ``` |
|
1117 | * |
|
1118 | * @param $uri |
|
1119 | * Conditional Assertion: Test won't be stopped on fail |
|
1120 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() |
|
1121 | */ |
|
1122 | public function cantSeeCurrentUrlMatches($uri) { |
|
1123 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); |
|
1124 | } |
|
1125 | /** |
|
1126 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1127 | * |
|
1128 | * Checks that current url doesn't match the given regular expression. |
|
1129 | * |
|
1130 | * ``` php |
|
1131 | * <?php |
|
1132 | * // to match root url |
|
1133 | * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~'); |
|
1134 | * ?> |
|
1135 | * ``` |
|
1136 | * |
|
1137 | * @param $uri |
|
1138 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() |
|
1139 | */ |
|
1140 | public function dontSeeCurrentUrlMatches($uri) { |
|
1141 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args())); |
|
1142 | } |
|
1143 | ||
1144 | ||
1145 | /** |
|
1146 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1147 | * |
|
1148 | * Executes the given regular expression against the current URI and returns the first match. |
|
1149 | * If no parameters are provided, the full URI is returned. |
|
1150 | * |
|
1151 | * ``` php |
|
1152 | * <?php |
|
1153 | * $user_id = $I->grabFromCurrentUrl('~$/user/(\d+)/~'); |
|
1154 | * $uri = $I->grabFromCurrentUrl(); |
|
1155 | * ?> |
|
1156 | * ``` |
|
1157 | * |
|
1158 | * @param null $uri |
|
1159 | * |
|
1160 | * @return mixed |
|
1161 | * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl() |
|
1162 | */ |
|
1163 | public function grabFromCurrentUrl($uri = null) { |
|
1164 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args())); |
|
1165 | } |
|
1166 | ||
1167 | ||
1168 | /** |
|
1169 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1170 | * |
|
1171 | * Checks that the specified checkbox is checked. |
|
1172 | * |
|
1173 | * ``` php |
|
1174 | * <?php |
|
1175 | * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms |
|
1176 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. |
|
1177 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); |
|
1178 | * ?> |
|
1179 | * ``` |
|
1180 | * |
|
1181 | * @param $checkbox |
|
1182 | * Conditional Assertion: Test won't be stopped on fail |
|
1183 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() |
|
1184 | */ |
|
1185 | public function canSeeCheckboxIsChecked($checkbox) { |
|
1186 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); |
|
1187 | } |
|
1188 | /** |
|
1189 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1190 | * |
|
1191 | * Checks that the specified checkbox is checked. |
|
1192 | * |
|
1193 | * ``` php |
|
1194 | * <?php |
|
1195 | * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms |
|
1196 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. |
|
1197 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); |
|
1198 | * ?> |
|
1199 | * ``` |
|
1200 | * |
|
1201 | * @param $checkbox |
|
1202 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() |
|
1203 | */ |
|
1204 | public function seeCheckboxIsChecked($checkbox) { |
|
1205 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args())); |
|
1206 | } |
|
1207 | ||
1208 | ||
1209 | /** |
|
1210 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1211 | * |
|
1212 | * Check that the specified checkbox is unchecked. |
|
1213 | * |
|
1214 | * ``` php |
|
1215 | * <?php |
|
1216 | * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms |
|
1217 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. |
|
1218 | * ?> |
|
1219 | * ``` |
|
1220 | * |
|
1221 | * @param $checkbox |
|
1222 | * Conditional Assertion: Test won't be stopped on fail |
|
1223 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() |
|
1224 | */ |
|
1225 | public function cantSeeCheckboxIsChecked($checkbox) { |
|
1226 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); |
|
1227 | } |
|
1228 | /** |
|
1229 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1230 | * |
|
1231 | * Check that the specified checkbox is unchecked. |
|
1232 | * |
|
1233 | * ``` php |
|
1234 | * <?php |
|
1235 | * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms |
|
1236 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. |
|
1237 | * ?> |
|
1238 | * ``` |
|
1239 | * |
|
1240 | * @param $checkbox |
|
1241 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() |
|
1242 | */ |
|
1243 | public function dontSeeCheckboxIsChecked($checkbox) { |
|
1244 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args())); |
|
1245 | } |
|
1246 | ||
1247 | ||
1248 | /** |
|
1249 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1250 | * |
|
1251 | * Checks that the given input field or textarea contains the given value. |
|
1252 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. |
|
1253 | * |
|
1254 | * ``` php |
|
1255 | * <?php |
|
1256 | * $I->seeInField('Body','Type your comment here'); |
|
1257 | * $I->seeInField('form textarea[name=body]','Type your comment here'); |
|
1258 | * $I->seeInField('form input[type=hidden]','hidden_value'); |
|
1259 | * $I->seeInField('#searchform input','Search'); |
|
1260 | * $I->seeInField('//form/*[@name=search]','Search'); |
|
1261 | * $I->seeInField(['name' => 'search'], 'Search'); |
|
1262 | * ?> |
|
1263 | * ``` |
|
1264 | * |
|
1265 | * @param $field |
|
1266 | * @param $value |
|
1267 | * Conditional Assertion: Test won't be stopped on fail |
|
1268 | * @see \Codeception\Lib\InnerBrowser::seeInField() |
|
1269 | */ |
|
1270 | public function canSeeInField($field, $value) { |
|
1271 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); |
|
1272 | } |
|
1273 | /** |
|
1274 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1275 | * |
|
1276 | * Checks that the given input field or textarea contains the given value. |
|
1277 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. |
|
1278 | * |
|
1279 | * ``` php |
|
1280 | * <?php |
|
1281 | * $I->seeInField('Body','Type your comment here'); |
|
1282 | * $I->seeInField('form textarea[name=body]','Type your comment here'); |
|
1283 | * $I->seeInField('form input[type=hidden]','hidden_value'); |
|
1284 | * $I->seeInField('#searchform input','Search'); |
|
1285 | * $I->seeInField('//form/*[@name=search]','Search'); |
|
1286 | * $I->seeInField(['name' => 'search'], 'Search'); |
|
1287 | * ?> |
|
1288 | * ``` |
|
1289 | * |
|
1290 | * @param $field |
|
1291 | * @param $value |
|
1292 | * @see \Codeception\Lib\InnerBrowser::seeInField() |
|
1293 | */ |
|
1294 | public function seeInField($field, $value) { |
|
1295 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); |
|
1296 | } |
|
1297 | ||
1298 | ||
1299 | /** |
|
1300 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1301 | * |
|
1302 | * Checks that an input field or textarea doesn't contain the given value. |
|
1303 | * For fuzzy locators, the field is matched by label text, CSS and XPath. |
|
1304 | * |
|
1305 | * ``` php |
|
1306 | * <?php |
|
1307 | * $I->dontSeeInField('Body','Type your comment here'); |
|
1308 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); |
|
1309 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); |
|
1310 | * $I->dontSeeInField('#searchform input','Search'); |
|
1311 | * $I->dontSeeInField('//form/*[@name=search]','Search'); |
|
1312 | * $I->dontSeeInField(['name' => 'search'], 'Search'); |
|
1313 | * ?> |
|
1314 | * ``` |
|
1315 | * |
|
1316 | * @param $field |
|
1317 | * @param $value |
|
1318 | * Conditional Assertion: Test won't be stopped on fail |
|
1319 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() |
|
1320 | */ |
|
1321 | public function cantSeeInField($field, $value) { |
|
1322 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); |
|
1323 | } |
|
1324 | /** |
|
1325 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1326 | * |
|
1327 | * Checks that an input field or textarea doesn't contain the given value. |
|
1328 | * For fuzzy locators, the field is matched by label text, CSS and XPath. |
|
1329 | * |
|
1330 | * ``` php |
|
1331 | * <?php |
|
1332 | * $I->dontSeeInField('Body','Type your comment here'); |
|
1333 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); |
|
1334 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); |
|
1335 | * $I->dontSeeInField('#searchform input','Search'); |
|
1336 | * $I->dontSeeInField('//form/*[@name=search]','Search'); |
|
1337 | * $I->dontSeeInField(['name' => 'search'], 'Search'); |
|
1338 | * ?> |
|
1339 | * ``` |
|
1340 | * |
|
1341 | * @param $field |
|
1342 | * @param $value |
|
1343 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() |
|
1344 | */ |
|
1345 | public function dontSeeInField($field, $value) { |
|
1346 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args())); |
|
1347 | } |
|
1348 | ||
1349 | ||
1350 | /** |
|
1351 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1352 | * |
|
1353 | * Checks if the array of form parameters (name => value) are set on the form matched with the |
|
1354 | * passed selector. |
|
1355 | * |
|
1356 | * ``` php |
|
1357 | * <?php |
|
1358 | * $I->seeInFormFields('form[name=myform]', [ |
|
1359 | * 'input1' => 'value', |
|
1360 | * 'input2' => 'other value', |
|
1361 | * ]); |
|
1362 | * ?> |
|
1363 | * ``` |
|
1364 | * |
|
1365 | * For multi-select elements, or to check values of multiple elements with the same name, an |
|
1366 | * array may be passed: |
|
1367 | * |
|
1368 | * ``` php |
|
1369 | * <?php |
|
1370 | * $I->seeInFormFields('.form-class', [ |
|
1371 | * 'multiselect' => [ |
|
1372 | * 'value1', |
|
1373 | * 'value2', |
|
1374 | * ], |
|
1375 | * 'checkbox[]' => [ |
|
1376 | * 'a checked value', |
|
1377 | * 'another checked value', |
|
1378 | * ], |
|
1379 | * ]); |
|
1380 | * ?> |
|
1381 | * ``` |
|
1382 | * |
|
1383 | * Additionally, checkbox values can be checked with a boolean. |
|
1384 | * |
|
1385 | * ``` php |
|
1386 | * <?php |
|
1387 | * $I->seeInFormFields('#form-id', [ |
|
1388 | * 'checkbox1' => true, // passes if checked |
|
1389 | * 'checkbox2' => false, // passes if unchecked |
|
1390 | * ]); |
|
1391 | * ?> |
|
1392 | * ``` |
|
1393 | * |
|
1394 | * Pair this with submitForm for quick testing magic. |
|
1395 | * |
|
1396 | * ``` php |
|
1397 | * <?php |
|
1398 | * $form = [ |
|
1399 | * 'field1' => 'value', |
|
1400 | * 'field2' => 'another value', |
|
1401 | * 'checkbox1' => true, |
|
1402 | * // ... |
|
1403 | * ]; |
|
1404 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); |
|
1405 | * // $I->amOnPage('/path/to/form-page') may be needed |
|
1406 | * $I->seeInFormFields('//form[@id=my-form]', $form); |
|
1407 | * ?> |
|
1408 | * ``` |
|
1409 | * |
|
1410 | * @param $formSelector |
|
1411 | * @param $params |
|
1412 | * Conditional Assertion: Test won't be stopped on fail |
|
1413 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields() |
|
1414 | */ |
|
1415 | public function canSeeInFormFields($formSelector, $params) { |
|
1416 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args())); |
|
1417 | } |
|
1418 | /** |
|
1419 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1420 | * |
|
1421 | * Checks if the array of form parameters (name => value) are set on the form matched with the |
|
1422 | * passed selector. |
|
1423 | * |
|
1424 | * ``` php |
|
1425 | * <?php |
|
1426 | * $I->seeInFormFields('form[name=myform]', [ |
|
1427 | * 'input1' => 'value', |
|
1428 | * 'input2' => 'other value', |
|
1429 | * ]); |
|
1430 | * ?> |
|
1431 | * ``` |
|
1432 | * |
|
1433 | * For multi-select elements, or to check values of multiple elements with the same name, an |
|
1434 | * array may be passed: |
|
1435 | * |
|
1436 | * ``` php |
|
1437 | * <?php |
|
1438 | * $I->seeInFormFields('.form-class', [ |
|
1439 | * 'multiselect' => [ |
|
1440 | * 'value1', |
|
1441 | * 'value2', |
|
1442 | * ], |
|
1443 | * 'checkbox[]' => [ |
|
1444 | * 'a checked value', |
|
1445 | * 'another checked value', |
|
1446 | * ], |
|
1447 | * ]); |
|
1448 | * ?> |
|
1449 | * ``` |
|
1450 | * |
|
1451 | * Additionally, checkbox values can be checked with a boolean. |
|
1452 | * |
|
1453 | * ``` php |
|
1454 | * <?php |
|
1455 | * $I->seeInFormFields('#form-id', [ |
|
1456 | * 'checkbox1' => true, // passes if checked |
|
1457 | * 'checkbox2' => false, // passes if unchecked |
|
1458 | * ]); |
|
1459 | * ?> |
|
1460 | * ``` |
|
1461 | * |
|
1462 | * Pair this with submitForm for quick testing magic. |
|
1463 | * |
|
1464 | * ``` php |
|
1465 | * <?php |
|
1466 | * $form = [ |
|
1467 | * 'field1' => 'value', |
|
1468 | * 'field2' => 'another value', |
|
1469 | * 'checkbox1' => true, |
|
1470 | * // ... |
|
1471 | * ]; |
|
1472 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); |
|
1473 | * // $I->amOnPage('/path/to/form-page') may be needed |
|
1474 | * $I->seeInFormFields('//form[@id=my-form]', $form); |
|
1475 | * ?> |
|
1476 | * ``` |
|
1477 | * |
|
1478 | * @param $formSelector |
|
1479 | * @param $params |
|
1480 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields() |
|
1481 | */ |
|
1482 | public function seeInFormFields($formSelector, $params) { |
|
1483 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args())); |
|
1484 | } |
|
1485 | ||
1486 | ||
1487 | /** |
|
1488 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1489 | * |
|
1490 | * Checks if the array of form parameters (name => value) are not set on the form matched with |
|
1491 | * the passed selector. |
|
1492 | * |
|
1493 | * ``` php |
|
1494 | * <?php |
|
1495 | * $I->dontSeeInFormFields('form[name=myform]', [ |
|
1496 | * 'input1' => 'non-existent value', |
|
1497 | * 'input2' => 'other non-existent value', |
|
1498 | * ]); |
|
1499 | * ?> |
|
1500 | * ``` |
|
1501 | * |
|
1502 | * To check that an element hasn't been assigned any one of many values, an array can be passed |
|
1503 | * as the value: |
|
1504 | * |
|
1505 | * ``` php |
|
1506 | * <?php |
|
1507 | * $I->dontSeeInFormFields('.form-class', [ |
|
1508 | * 'fieldName' => [ |
|
1509 | * 'This value shouldn\'t be set', |
|
1510 | * 'And this value shouldn\'t be set', |
|
1511 | * ], |
|
1512 | * ]); |
|
1513 | * ?> |
|
1514 | * ``` |
|
1515 | * |
|
1516 | * Additionally, checkbox values can be checked with a boolean. |
|
1517 | * |
|
1518 | * ``` php |
|
1519 | * <?php |
|
1520 | * $I->dontSeeInFormFields('#form-id', [ |
|
1521 | * 'checkbox1' => true, // fails if checked |
|
1522 | * 'checkbox2' => false, // fails if unchecked |
|
1523 | * ]); |
|
1524 | * ?> |
|
1525 | * ``` |
|
1526 | * |
|
1527 | * @param $formSelector |
|
1528 | * @param $params |
|
1529 | * Conditional Assertion: Test won't be stopped on fail |
|
1530 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() |
|
1531 | */ |
|
1532 | public function cantSeeInFormFields($formSelector, $params) { |
|
1533 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args())); |
|
1534 | } |
|
1535 | /** |
|
1536 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1537 | * |
|
1538 | * Checks if the array of form parameters (name => value) are not set on the form matched with |
|
1539 | * the passed selector. |
|
1540 | * |
|
1541 | * ``` php |
|
1542 | * <?php |
|
1543 | * $I->dontSeeInFormFields('form[name=myform]', [ |
|
1544 | * 'input1' => 'non-existent value', |
|
1545 | * 'input2' => 'other non-existent value', |
|
1546 | * ]); |
|
1547 | * ?> |
|
1548 | * ``` |
|
1549 | * |
|
1550 | * To check that an element hasn't been assigned any one of many values, an array can be passed |
|
1551 | * as the value: |
|
1552 | * |
|
1553 | * ``` php |
|
1554 | * <?php |
|
1555 | * $I->dontSeeInFormFields('.form-class', [ |
|
1556 | * 'fieldName' => [ |
|
1557 | * 'This value shouldn\'t be set', |
|
1558 | * 'And this value shouldn\'t be set', |
|
1559 | * ], |
|
1560 | * ]); |
|
1561 | * ?> |
|
1562 | * ``` |
|
1563 | * |
|
1564 | * Additionally, checkbox values can be checked with a boolean. |
|
1565 | * |
|
1566 | * ``` php |
|
1567 | * <?php |
|
1568 | * $I->dontSeeInFormFields('#form-id', [ |
|
1569 | * 'checkbox1' => true, // fails if checked |
|
1570 | * 'checkbox2' => false, // fails if unchecked |
|
1571 | * ]); |
|
1572 | * ?> |
|
1573 | * ``` |
|
1574 | * |
|
1575 | * @param $formSelector |
|
1576 | * @param $params |
|
1577 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() |
|
1578 | */ |
|
1579 | public function dontSeeInFormFields($formSelector, $params) { |
|
1580 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInFormFields', func_get_args())); |
|
1581 | } |
|
1582 | ||
1583 | ||
1584 | /** |
|
1585 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1586 | * |
|
1587 | * Submits the given form on the page, optionally with the given form |
|
1588 | * values. Pass the form field's values as an array in the second |
|
1589 | * parameter. |
|
1590 | * |
|
1591 | * Although this function can be used as a short-hand version of |
|
1592 | * `fillField()`, `selectOption()`, `click()` etc. it has some important |
|
1593 | * differences: |
|
1594 | * |
|
1595 | * * Only field *names* may be used, not CSS/XPath selectors nor field labels |
|
1596 | * * If a field is sent to this function that does *not* exist on the page, |
|
1597 | * it will silently be added to the HTTP request. This is helpful for testing |
|
1598 | * some types of forms, but be aware that you will *not* get an exception |
|
1599 | * like you would if you called `fillField()` or `selectOption()` with |
|
1600 | * a missing field. |
|
1601 | * |
|
1602 | * Fields that are not provided will be filled by their values from the page, |
|
1603 | * or from any previous calls to `fillField()`, `selectOption()` etc. |
|
1604 | * You don't need to click the 'Submit' button afterwards. |
|
1605 | * This command itself triggers the request to form's action. |
|
1606 | * |
|
1607 | * You can optionally specify which button's value to include |
|
1608 | * in the request with the last parameter (as an alternative to |
|
1609 | * explicitly setting its value in the second parameter), as |
|
1610 | * button values are not otherwise included in the request. |
|
1611 | * |
|
1612 | * Examples: |
|
1613 | * |
|
1614 | * ``` php |
|
1615 | * <?php |
|
1616 | * $I->submitForm('#login', [ |
|
1617 | * 'login' => 'davert', |
|
1618 | * 'password' => '123456' |
|
1619 | * ]); |
|
1620 | * // or |
|
1621 | * $I->submitForm('#login', [ |
|
1622 | * 'login' => 'davert', |
|
1623 | * 'password' => '123456' |
|
1624 | * ], 'submitButtonName'); |
|
1625 | * |
|
1626 | * ``` |
|
1627 | * |
|
1628 | * For example, given this sample "Sign Up" form: |
|
1629 | * |
|
1630 | * ``` html |
|
1631 | * <form action="/sign_up"> |
|
1632 | * Login: |
|
1633 | * <input type="text" name="user[login]" /><br/> |
|
1634 | * Password: |
|
1635 | * <input type="password" name="user[password]" /><br/> |
|
1636 | * Do you agree to our terms? |
|
1637 | * <input type="checkbox" name="user[agree]" /><br/> |
|
1638 | * Select pricing plan: |
|
1639 | * <select name="plan"> |
|
1640 | * <option value="1">Free</option> |
|
1641 | * <option value="2" selected="selected">Paid</option> |
|
1642 | * </select> |
|
1643 | * <input type="submit" name="submitButton" value="Submit" /> |
|
1644 | * </form> |
|
1645 | * ``` |
|
1646 | * |
|
1647 | * You could write the following to submit it: |
|
1648 | * |
|
1649 | * ``` php |
|
1650 | * <?php |
|
1651 | * $I->submitForm( |
|
1652 | * '#userForm', |
|
1653 | * [ |
|
1654 | * 'user' => [ |
|
1655 | * 'login' => 'Davert', |
|
1656 | * 'password' => '123456', |
|
1657 | * 'agree' => true |
|
1658 | * ] |
|
1659 | * ], |
|
1660 | * 'submitButton' |
|
1661 | * ); |
|
1662 | * ``` |
|
1663 | * Note that "2" will be the submitted value for the "plan" field, as it is |
|
1664 | * the selected option. |
|
1665 | * |
|
1666 | * You can also emulate a JavaScript submission by not specifying any |
|
1667 | * buttons in the third parameter to submitForm. |
|
1668 | * |
|
1669 | * ```php |
|
1670 | * <?php |
|
1671 | * $I->submitForm( |
|
1672 | * '#userForm', |
|
1673 | * [ |
|
1674 | * 'user' => [ |
|
1675 | * 'login' => 'Davert', |
|
1676 | * 'password' => '123456', |
|
1677 | * 'agree' => true |
|
1678 | * ] |
|
1679 | * ] |
|
1680 | * ); |
|
1681 | * ``` |
|
1682 | * |
|
1683 | * This function works well when paired with `seeInFormFields()` |
|
1684 | * for quickly testing CRUD interfaces and form validation logic. |
|
1685 | * |
|
1686 | * ``` php |
|
1687 | * <?php |
|
1688 | * $form = [ |
|
1689 | * 'field1' => 'value', |
|
1690 | * 'field2' => 'another value', |
|
1691 | * 'checkbox1' => true, |
|
1692 | * // ... |
|
1693 | * ]; |
|
1694 | * $I->submitForm('#my-form', $form, 'submitButton'); |
|
1695 | * // $I->amOnPage('/path/to/form-page') may be needed |
|
1696 | * $I->seeInFormFields('#my-form', $form); |
|
1697 | * ``` |
|
1698 | * |
|
1699 | * Parameter values can be set to arrays for multiple input fields |
|
1700 | * of the same name, or multi-select combo boxes. For checkboxes, |
|
1701 | * you can use either the string value or boolean `true`/`false` which will |
|
1702 | * be replaced by the checkbox's value in the DOM. |
|
1703 | * |
|
1704 | * ``` php |
|
1705 | * <?php |
|
1706 | * $I->submitForm('#my-form', [ |
|
1707 | * 'field1' => 'value', |
|
1708 | * 'checkbox' => [ |
|
1709 | * 'value of first checkbox', |
|
1710 | * 'value of second checkbox', |
|
1711 | * ], |
|
1712 | * 'otherCheckboxes' => [ |
|
1713 | * true, |
|
1714 | * false, |
|
1715 | * false |
|
1716 | * ], |
|
1717 | * 'multiselect' => [ |
|
1718 | * 'first option value', |
|
1719 | * 'second option value' |
|
1720 | * ] |
|
1721 | * ]); |
|
1722 | * ``` |
|
1723 | * |
|
1724 | * Mixing string and boolean values for a checkbox's value is not supported |
|
1725 | * and may produce unexpected results. |
|
1726 | * |
|
1727 | * Field names ending in `[]` must be passed without the trailing square |
|
1728 | * bracket characters, and must contain an array for its value. This allows |
|
1729 | * submitting multiple values with the same name, consider: |
|
1730 | * |
|
1731 | * ```php |
|
1732 | * <?php |
|
1733 | * // This will NOT work correctly |
|
1734 | * $I->submitForm('#my-form', [ |
|
1735 | * 'field[]' => 'value', |
|
1736 | * 'field[]' => 'another value', // 'field[]' is already a defined key |
|
1737 | * ]); |
|
1738 | * ``` |
|
1739 | * |
|
1740 | * The solution is to pass an array value: |
|
1741 | * |
|
1742 | * ```php |
|
1743 | * <?php |
|
1744 | * // This way both values are submitted |
|
1745 | * $I->submitForm('#my-form', [ |
|
1746 | * 'field' => [ |
|
1747 | * 'value', |
|
1748 | * 'another value', |
|
1749 | * ] |
|
1750 | * ]); |
|
1751 | * ``` |
|
1752 | * |
|
1753 | * @param $selector |
|
1754 | * @param $params |
|
1755 | * @param $button |
|
1756 | * @see \Codeception\Lib\InnerBrowser::submitForm() |
|
1757 | */ |
|
1758 | public function submitForm($selector, $params, $button = null) { |
|
1759 | return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args())); |
|
1760 | } |
|
1761 | ||
1762 | ||
1763 | /** |
|
1764 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1765 | * |
|
1766 | * Fills a text field or textarea with the given string. |
|
1767 | * |
|
1768 | * ``` php |
|
1769 | * <?php |
|
1770 | * $I->fillField("//input[@type='text']", "Hello World!"); |
|
1771 | * $I->fillField(['name' => 'email'], '[email protected]'); |
|
1772 | * ?> |
|
1773 | * ``` |
|
1774 | * |
|
1775 | * @param $field |
|
1776 | * @param $value |
|
1777 | * @see \Codeception\Lib\InnerBrowser::fillField() |
|
1778 | */ |
|
1779 | public function fillField($field, $value) { |
|
1780 | return $this->getScenario()->runStep(new \Codeception\Step\Action('fillField', func_get_args())); |
|
1781 | } |
|
1782 | ||
1783 | ||
1784 | /** |
|
1785 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1786 | * |
|
1787 | * Selects an option in a select tag or in radio button group. |
|
1788 | * |
|
1789 | * ``` php |
|
1790 | * <?php |
|
1791 | * $I->selectOption('form select[name=account]', 'Premium'); |
|
1792 | * $I->selectOption('form input[name=payment]', 'Monthly'); |
|
1793 | * $I->selectOption('//form/select[@name=account]', 'Monthly'); |
|
1794 | * ?> |
|
1795 | * ``` |
|
1796 | * |
|
1797 | * Provide an array for the second argument to select multiple options: |
|
1798 | * |
|
1799 | * ``` php |
|
1800 | * <?php |
|
1801 | * $I->selectOption('Which OS do you use?', array('Windows','Linux')); |
|
1802 | * ?> |
|
1803 | * ``` |
|
1804 | * |
|
1805 | * @param $select |
|
1806 | * @param $option |
|
1807 | * @see \Codeception\Lib\InnerBrowser::selectOption() |
|
1808 | */ |
|
1809 | public function selectOption($select, $option) { |
|
1810 | return $this->getScenario()->runStep(new \Codeception\Step\Action('selectOption', func_get_args())); |
|
1811 | } |
|
1812 | ||
1813 | ||
1814 | /** |
|
1815 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1816 | * |
|
1817 | * Ticks a checkbox. For radio buttons, use the `selectOption` method instead. |
|
1818 | * |
|
1819 | * ``` php |
|
1820 | * <?php |
|
1821 | * $I->checkOption('#agree'); |
|
1822 | * ?> |
|
1823 | * ``` |
|
1824 | * |
|
1825 | * @param $option |
|
1826 | * @see \Codeception\Lib\InnerBrowser::checkOption() |
|
1827 | */ |
|
1828 | public function checkOption($option) { |
|
1829 | return $this->getScenario()->runStep(new \Codeception\Step\Action('checkOption', func_get_args())); |
|
1830 | } |
|
1831 | ||
1832 | ||
1833 | /** |
|
1834 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1835 | * |
|
1836 | * Unticks a checkbox. |
|
1837 | * |
|
1838 | * ``` php |
|
1839 | * <?php |
|
1840 | * $I->uncheckOption('#notify'); |
|
1841 | * ?> |
|
1842 | * ``` |
|
1843 | * |
|
1844 | * @param $option |
|
1845 | * @see \Codeception\Lib\InnerBrowser::uncheckOption() |
|
1846 | */ |
|
1847 | public function uncheckOption($option) { |
|
1848 | return $this->getScenario()->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args())); |
|
1849 | } |
|
1850 | ||
1851 | ||
1852 | /** |
|
1853 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1854 | * |
|
1855 | * Attaches a file relative to the Codeception data directory to the given file upload field. |
|
1856 | * |
|
1857 | * ``` php |
|
1858 | * <?php |
|
1859 | * // file is stored in 'tests/_data/prices.xls' |
|
1860 | * $I->attachFile('input[@type="file"]', 'prices.xls'); |
|
1861 | * ?> |
|
1862 | * ``` |
|
1863 | * |
|
1864 | * @param $field |
|
1865 | * @param $filename |
|
1866 | * @see \Codeception\Lib\InnerBrowser::attachFile() |
|
1867 | */ |
|
1868 | public function attachFile($field, $filename) { |
|
1869 | return $this->getScenario()->runStep(new \Codeception\Step\Action('attachFile', func_get_args())); |
|
1870 | } |
|
1871 | ||
1872 | ||
1873 | /** |
|
1874 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1875 | * |
|
1876 | * If your page triggers an ajax request, you can perform it manually. |
|
1877 | * This action sends a GET ajax request with specified params. |
|
1878 | * |
|
1879 | * See ->sendAjaxPostRequest for examples. |
|
1880 | * |
|
1881 | * @param $uri |
|
1882 | * @param $params |
|
1883 | * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest() |
|
1884 | */ |
|
1885 | public function sendAjaxGetRequest($uri, $params = null) { |
|
1886 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args())); |
|
1887 | } |
|
1888 | ||
1889 | ||
1890 | /** |
|
1891 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1892 | * |
|
1893 | * If your page triggers an ajax request, you can perform it manually. |
|
1894 | * This action sends a POST ajax request with specified params. |
|
1895 | * Additional params can be passed as array. |
|
1896 | * |
|
1897 | * Example: |
|
1898 | * |
|
1899 | * Imagine that by clicking checkbox you trigger ajax request which updates user settings. |
|
1900 | * We emulate that click by running this ajax request manually. |
|
1901 | * |
|
1902 | * ``` php |
|
1903 | * <?php |
|
1904 | * $I->sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST |
|
1905 | * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET |
|
1906 | * |
|
1907 | * ``` |
|
1908 | * |
|
1909 | * @param $uri |
|
1910 | * @param $params |
|
1911 | * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest() |
|
1912 | */ |
|
1913 | public function sendAjaxPostRequest($uri, $params = null) { |
|
1914 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args())); |
|
1915 | } |
|
1916 | ||
1917 | ||
1918 | /** |
|
1919 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1920 | * |
|
1921 | * If your page triggers an ajax request, you can perform it manually. |
|
1922 | * This action sends an ajax request with specified method and params. |
|
1923 | * |
|
1924 | * Example: |
|
1925 | * |
|
1926 | * You need to perform an ajax request specifying the HTTP method. |
|
1927 | * |
|
1928 | * ``` php |
|
1929 | * <?php |
|
1930 | * $I->sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title')); |
|
1931 | * |
|
1932 | * ``` |
|
1933 | * |
|
1934 | * @param $method |
|
1935 | * @param $uri |
|
1936 | * @param $params |
|
1937 | * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest() |
|
1938 | */ |
|
1939 | public function sendAjaxRequest($method, $uri, $params = null) { |
|
1940 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args())); |
|
1941 | } |
|
1942 | ||
1943 | ||
1944 | /** |
|
1945 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1946 | * |
|
1947 | * Finds and returns the text contents of the given element. |
|
1948 | * If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression. |
|
1949 | * |
|
1950 | * ``` php |
|
1951 | * <?php |
|
1952 | * $heading = $I->grabTextFrom('h1'); |
|
1953 | * $heading = $I->grabTextFrom('descendant-or-self::h1'); |
|
1954 | * $value = $I->grabTextFrom('~<input value=(.*?)]~sgi'); // match with a regex |
|
1955 | * ?> |
|
1956 | * ``` |
|
1957 | * |
|
1958 | * @param $cssOrXPathOrRegex |
|
1959 | * |
|
1960 | * @return mixed |
|
1961 | * @see \Codeception\Lib\InnerBrowser::grabTextFrom() |
|
1962 | */ |
|
1963 | public function grabTextFrom($cssOrXPathOrRegex) { |
|
1964 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args())); |
|
1965 | } |
|
1966 | ||
1967 | ||
1968 | /** |
|
1969 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1970 | * |
|
1971 | * Grabs the value of the given attribute value from the given element. |
|
1972 | * Fails if element is not found. |
|
1973 | * |
|
1974 | * ``` php |
|
1975 | * <?php |
|
1976 | * $I->grabAttributeFrom('#tooltip', 'title'); |
|
1977 | * ?> |
|
1978 | * ``` |
|
1979 | * |
|
1980 | * |
|
1981 | * @param $cssOrXpath |
|
1982 | * @param $attribute |
|
1983 | * |
|
1984 | * @return mixed |
|
1985 | * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom() |
|
1986 | */ |
|
1987 | public function grabAttributeFrom($cssOrXpath, $attribute) { |
|
1988 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args())); |
|
1989 | } |
|
1990 | ||
1991 | ||
1992 | /** |
|
1993 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1994 | * |
|
1995 | * Grabs either the text content, or attribute values, of nodes |
|
1996 | * matched by $cssOrXpath and returns them as an array. |
|
1997 | * |
|
1998 | * ```html |
|
1999 | * <a href="#first">First</a> |
|
2000 | * <a href="#second">Second</a> |
|
2001 | * <a href="#third">Third</a> |
|
2002 | * ``` |
|
2003 | * |
|
2004 | * ```php |
|
2005 | * <?php |
|
2006 | * // would return ['First', 'Second', 'Third'] |
|
2007 | * $aLinkText = $I->grabMultiple('a'); |
|
2008 | * |
|
2009 | * // would return ['#first', '#second', '#third'] |
|
2010 | * $aLinks = $I->grabMultiple('a', 'href'); |
|
2011 | * ?> |
|
2012 | * ``` |
|
2013 | * |
|
2014 | * @param $cssOrXpath |
|
2015 | * @param $attribute |
|
2016 | * @return string[] |
|
2017 | * @see \Codeception\Lib\InnerBrowser::grabMultiple() |
|
2018 | */ |
|
2019 | public function grabMultiple($cssOrXpath, $attribute = null) { |
|
2020 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args())); |
|
2021 | } |
|
2022 | ||
2023 | ||
2024 | /** |
|
2025 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2026 | * |
|
2027 | * @param $field |
|
2028 | * |
|
2029 | * @return array|mixed|null|string |
|
2030 | * @see \Codeception\Lib\InnerBrowser::grabValueFrom() |
|
2031 | */ |
|
2032 | public function grabValueFrom($field) { |
|
2033 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args())); |
|
2034 | } |
|
2035 | ||
2036 | ||
2037 | /** |
|
2038 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2039 | * |
|
2040 | * Sets a cookie with the given name and value. |
|
2041 | * You can set additional cookie params like `domain`, `path`, `expires`, `secure` in array passed as last argument. |
|
2042 | * |
|
2043 | * ``` php |
|
2044 | * <?php |
|
2045 | * $I->setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); |
|
2046 | * ?> |
|
2047 | * ``` |
|
2048 | * |
|
2049 | * @param $name |
|
2050 | * @param $val |
|
2051 | * @param array $params |
|
2052 | * |
|
2053 | * @return mixed |
|
2054 | * @see \Codeception\Lib\InnerBrowser::setCookie() |
|
2055 | */ |
|
2056 | public function setCookie($name, $val, $params = null) { |
|
2057 | return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); |
|
2058 | } |
|
2059 | ||
2060 | ||
2061 | /** |
|
2062 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2063 | * |
|
2064 | * Grabs a cookie value. |
|
2065 | * You can set additional cookie params like `domain`, `path` in array passed as last argument. |
|
2066 | * |
|
2067 | * @param $cookie |
|
2068 | * |
|
2069 | * @param array $params |
|
2070 | * @return mixed |
|
2071 | * @see \Codeception\Lib\InnerBrowser::grabCookie() |
|
2072 | */ |
|
2073 | public function grabCookie($cookie, $params = null) { |
|
2074 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args())); |
|
2075 | } |
|
2076 | ||
2077 | ||
2078 | /** |
|
2079 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2080 | * |
|
2081 | * Checks that a cookie with the given name is set. |
|
2082 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
|
2083 | * |
|
2084 | * ``` php |
|
2085 | * <?php |
|
2086 | * $I->seeCookie('PHPSESSID'); |
|
2087 | * ?> |
|
2088 | * ``` |
|
2089 | * |
|
2090 | * @param $cookie |
|
2091 | * @param array $params |
|
2092 | * @return mixed |
|
2093 | * Conditional Assertion: Test won't be stopped on fail |
|
2094 | * @see \Codeception\Lib\InnerBrowser::seeCookie() |
|
2095 | */ |
|
2096 | public function canSeeCookie($cookie, $params = null) { |
|
2097 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); |
|
2098 | } |
|
2099 | /** |
|
2100 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2101 | * |
|
2102 | * Checks that a cookie with the given name is set. |
|
2103 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
|
2104 | * |
|
2105 | * ``` php |
|
2106 | * <?php |
|
2107 | * $I->seeCookie('PHPSESSID'); |
|
2108 | * ?> |
|
2109 | * ``` |
|
2110 | * |
|
2111 | * @param $cookie |
|
2112 | * @param array $params |
|
2113 | * @return mixed |
|
2114 | * @see \Codeception\Lib\InnerBrowser::seeCookie() |
|
2115 | */ |
|
2116 | public function seeCookie($cookie, $params = null) { |
|
2117 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); |
|
2118 | } |
|
2119 | ||
2120 | ||
2121 | /** |
|
2122 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2123 | * |
|
2124 | * Checks that there isn't a cookie with the given name. |
|
2125 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
|
2126 | * |
|
2127 | * @param $cookie |
|
2128 | * |
|
2129 | * @param array $params |
|
2130 | * @return mixed |
|
2131 | * Conditional Assertion: Test won't be stopped on fail |
|
2132 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() |
|
2133 | */ |
|
2134 | public function cantSeeCookie($cookie, $params = null) { |
|
2135 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); |
|
2136 | } |
|
2137 | /** |
|
2138 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2139 | * |
|
2140 | * Checks that there isn't a cookie with the given name. |
|
2141 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
|
2142 | * |
|
2143 | * @param $cookie |
|
2144 | * |
|
2145 | * @param array $params |
|
2146 | * @return mixed |
|
2147 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() |
|
2148 | */ |
|
2149 | public function dontSeeCookie($cookie, $params = null) { |
|
2150 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args())); |
|
2151 | } |
|
2152 | ||
2153 | ||
2154 | /** |
|
2155 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2156 | * |
|
2157 | * Unsets cookie with the given name. |
|
2158 | * You can set additional cookie params like `domain`, `path` in array passed as last argument. |
|
2159 | * |
|
2160 | * @param $cookie |
|
2161 | * |
|
2162 | * @param array $params |
|
2163 | * @return mixed |
|
2164 | * @see \Codeception\Lib\InnerBrowser::resetCookie() |
|
2165 | */ |
|
2166 | public function resetCookie($name, $params = null) { |
|
2167 | return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args())); |
|
2168 | } |
|
2169 | ||
2170 | ||
2171 | /** |
|
2172 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2173 | * |
|
2174 | * Checks that the given element exists on the page and is visible. |
|
2175 | * You can also specify expected attributes of this element. |
|
2176 | * |
|
2177 | * ``` php |
|
2178 | * <?php |
|
2179 | * $I->seeElement('.error'); |
|
2180 | * $I->seeElement('//form/input[1]'); |
|
2181 | * $I->seeElement('input', ['name' => 'login']); |
|
2182 | * $I->seeElement('input', ['value' => '123456']); |
|
2183 | * |
|
2184 | * // strict locator in first arg, attributes in second |
|
2185 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); |
|
2186 | * ?> |
|
2187 | * ``` |
|
2188 | * |
|
2189 | * @param $selector |
|
2190 | * @param array $attributes |
|
2191 | * @return |
|
2192 | * Conditional Assertion: Test won't be stopped on fail |
|
2193 | * @see \Codeception\Lib\InnerBrowser::seeElement() |
|
2194 | */ |
|
2195 | public function canSeeElement($selector, $attributes = null) { |
|
2196 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); |
|
2197 | } |
|
2198 | /** |
|
2199 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2200 | * |
|
2201 | * Checks that the given element exists on the page and is visible. |
|
2202 | * You can also specify expected attributes of this element. |
|
2203 | * |
|
2204 | * ``` php |
|
2205 | * <?php |
|
2206 | * $I->seeElement('.error'); |
|
2207 | * $I->seeElement('//form/input[1]'); |
|
2208 | * $I->seeElement('input', ['name' => 'login']); |
|
2209 | * $I->seeElement('input', ['value' => '123456']); |
|
2210 | * |
|
2211 | * // strict locator in first arg, attributes in second |
|
2212 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); |
|
2213 | * ?> |
|
2214 | * ``` |
|
2215 | * |
|
2216 | * @param $selector |
|
2217 | * @param array $attributes |
|
2218 | * @return |
|
2219 | * @see \Codeception\Lib\InnerBrowser::seeElement() |
|
2220 | */ |
|
2221 | public function seeElement($selector, $attributes = null) { |
|
2222 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); |
|
2223 | } |
|
2224 | ||
2225 | ||
2226 | /** |
|
2227 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2228 | * |
|
2229 | * Checks that the given element is invisible or not present on the page. |
|
2230 | * You can also specify expected attributes of this element. |
|
2231 | * |
|
2232 | * ``` php |
|
2233 | * <?php |
|
2234 | * $I->dontSeeElement('.error'); |
|
2235 | * $I->dontSeeElement('//form/input[1]'); |
|
2236 | * $I->dontSeeElement('input', ['name' => 'login']); |
|
2237 | * $I->dontSeeElement('input', ['value' => '123456']); |
|
2238 | * ?> |
|
2239 | * ``` |
|
2240 | * |
|
2241 | * @param $selector |
|
2242 | * @param array $attributes |
|
2243 | * Conditional Assertion: Test won't be stopped on fail |
|
2244 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() |
|
2245 | */ |
|
2246 | public function cantSeeElement($selector, $attributes = null) { |
|
2247 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); |
|
2248 | } |
|
2249 | /** |
|
2250 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2251 | * |
|
2252 | * Checks that the given element is invisible or not present on the page. |
|
2253 | * You can also specify expected attributes of this element. |
|
2254 | * |
|
2255 | * ``` php |
|
2256 | * <?php |
|
2257 | * $I->dontSeeElement('.error'); |
|
2258 | * $I->dontSeeElement('//form/input[1]'); |
|
2259 | * $I->dontSeeElement('input', ['name' => 'login']); |
|
2260 | * $I->dontSeeElement('input', ['value' => '123456']); |
|
2261 | * ?> |
|
2262 | * ``` |
|
2263 | * |
|
2264 | * @param $selector |
|
2265 | * @param array $attributes |
|
2266 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() |
|
2267 | */ |
|
2268 | public function dontSeeElement($selector, $attributes = null) { |
|
2269 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args())); |
|
2270 | } |
|
2271 | ||
2272 | ||
2273 | /** |
|
2274 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2275 | * |
|
2276 | * Checks that there are a certain number of elements matched by the given locator on the page. |
|
2277 | * |
|
2278 | * ``` php |
|
2279 | * <?php |
|
2280 | * $I->seeNumberOfElements('tr', 10); |
|
2281 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements |
|
2282 | * ?> |
|
2283 | * ``` |
|
2284 | * @param $selector |
|
2285 | * @param mixed $expected : |
|
2286 | * - string: strict number |
|
2287 | * - array: range of numbers [0,10] |
|
2288 | * Conditional Assertion: Test won't be stopped on fail |
|
2289 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() |
|
2290 | */ |
|
2291 | public function canSeeNumberOfElements($selector, $expected) { |
|
2292 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args())); |
|
2293 | } |
|
2294 | /** |
|
2295 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2296 | * |
|
2297 | * Checks that there are a certain number of elements matched by the given locator on the page. |
|
2298 | * |
|
2299 | * ``` php |
|
2300 | * <?php |
|
2301 | * $I->seeNumberOfElements('tr', 10); |
|
2302 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements |
|
2303 | * ?> |
|
2304 | * ``` |
|
2305 | * @param $selector |
|
2306 | * @param mixed $expected : |
|
2307 | * - string: strict number |
|
2308 | * - array: range of numbers [0,10] |
|
2309 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() |
|
2310 | */ |
|
2311 | public function seeNumberOfElements($selector, $expected) { |
|
2312 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args())); |
|
2313 | } |
|
2314 | ||
2315 | ||
2316 | /** |
|
2317 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2318 | * |
|
2319 | * Checks that the given option is selected. |
|
2320 | * |
|
2321 | * ``` php |
|
2322 | * <?php |
|
2323 | * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa'); |
|
2324 | * ?> |
|
2325 | * ``` |
|
2326 | * |
|
2327 | * @param $selector |
|
2328 | * @param $optionText |
|
2329 | * |
|
2330 | * @return mixed |
|
2331 | * Conditional Assertion: Test won't be stopped on fail |
|
2332 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() |
|
2333 | */ |
|
2334 | public function canSeeOptionIsSelected($selector, $optionText) { |
|
2335 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); |
|
2336 | } |
|
2337 | /** |
|
2338 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2339 | * |
|
2340 | * Checks that the given option is selected. |
|
2341 | * |
|
2342 | * ``` php |
|
2343 | * <?php |
|
2344 | * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa'); |
|
2345 | * ?> |
|
2346 | * ``` |
|
2347 | * |
|
2348 | * @param $selector |
|
2349 | * @param $optionText |
|
2350 | * |
|
2351 | * @return mixed |
|
2352 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() |
|
2353 | */ |
|
2354 | public function seeOptionIsSelected($selector, $optionText) { |
|
2355 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); |
|
2356 | } |
|
2357 | ||
2358 | ||
2359 | /** |
|
2360 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2361 | * |
|
2362 | * Checks that the given option is not selected. |
|
2363 | * |
|
2364 | * ``` php |
|
2365 | * <?php |
|
2366 | * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); |
|
2367 | * ?> |
|
2368 | * ``` |
|
2369 | * |
|
2370 | * @param $selector |
|
2371 | * @param $optionText |
|
2372 | * |
|
2373 | * @return mixed |
|
2374 | * Conditional Assertion: Test won't be stopped on fail |
|
2375 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() |
|
2376 | */ |
|
2377 | public function cantSeeOptionIsSelected($selector, $optionText) { |
|
2378 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); |
|
2379 | } |
|
2380 | /** |
|
2381 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2382 | * |
|
2383 | * Checks that the given option is not selected. |
|
2384 | * |
|
2385 | * ``` php |
|
2386 | * <?php |
|
2387 | * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); |
|
2388 | * ?> |
|
2389 | * ``` |
|
2390 | * |
|
2391 | * @param $selector |
|
2392 | * @param $optionText |
|
2393 | * |
|
2394 | * @return mixed |
|
2395 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() |
|
2396 | */ |
|
2397 | public function dontSeeOptionIsSelected($selector, $optionText) { |
|
2398 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args())); |
|
2399 | } |
|
2400 | ||
2401 | ||
2402 | /** |
|
2403 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2404 | * |
|
2405 | * Asserts that current page has 404 response status code. |
|
2406 | * Conditional Assertion: Test won't be stopped on fail |
|
2407 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() |
|
2408 | */ |
|
2409 | public function canSeePageNotFound() { |
|
2410 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args())); |
|
2411 | } |
|
2412 | /** |
|
2413 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2414 | * |
|
2415 | * Asserts that current page has 404 response status code. |
|
2416 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() |
|
2417 | */ |
|
2418 | public function seePageNotFound() { |
|
2419 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args())); |
|
2420 | } |
|
2421 | ||
2422 | ||
2423 | /** |
|
2424 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2425 | * |
|
2426 | * Checks that response code is equal to value provided. |
|
2427 | * |
|
2428 | * @param $code |
|
2429 | * |
|
2430 | * @return mixed |
|
2431 | * Conditional Assertion: Test won't be stopped on fail |
|
2432 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() |
|
2433 | */ |
|
2434 | public function canSeeResponseCodeIs($code) { |
|
2435 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args())); |
|
2436 | } |
|
2437 | /** |
|
2438 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2439 | * |
|
2440 | * Checks that response code is equal to value provided. |
|
2441 | * |
|
2442 | * @param $code |
|
2443 | * |
|
2444 | * @return mixed |
|
2445 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() |
|
2446 | */ |
|
2447 | public function seeResponseCodeIs($code) { |
|
2448 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args())); |
|
2449 | } |
|
2450 | ||
2451 | ||
2452 | /** |
|
2453 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2454 | * |
|
2455 | * Checks that the page title contains the given string. |
|
2456 | * |
|
2457 | * ``` php |
|
2458 | * <?php |
|
2459 | * $I->seeInTitle('Blog - Post #1'); |
|
2460 | * ?> |
|
2461 | * ``` |
|
2462 | * |
|
2463 | * @param $title |
|
2464 | * |
|
2465 | * @return mixed |
|
2466 | * Conditional Assertion: Test won't be stopped on fail |
|
2467 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() |
|
2468 | */ |
|
2469 | public function canSeeInTitle($title) { |
|
2470 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args())); |
|
2471 | } |
|
2472 | /** |
|
2473 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2474 | * |
|
2475 | * Checks that the page title contains the given string. |
|
2476 | * |
|
2477 | * ``` php |
|
2478 | * <?php |
|
2479 | * $I->seeInTitle('Blog - Post #1'); |
|
2480 | * ?> |
|
2481 | * ``` |
|
2482 | * |
|
2483 | * @param $title |
|
2484 | * |
|
2485 | * @return mixed |
|
2486 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() |
|
2487 | */ |
|
2488 | public function seeInTitle($title) { |
|
2489 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args())); |
|
2490 | } |
|
2491 | ||
2492 | ||
2493 | /** |
|
2494 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2495 | * |
|
2496 | * Checks that the page title does not contain the given string. |
|
2497 | * |
|
2498 | * @param $title |
|
2499 | * |
|
2500 | * @return mixed |
|
2501 | * Conditional Assertion: Test won't be stopped on fail |
|
2502 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() |
|
2503 | */ |
|
2504 | public function cantSeeInTitle($title) { |
|
2505 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args())); |
|
2506 | } |
|
2507 | /** |
|
2508 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2509 | * |
|
2510 | * Checks that the page title does not contain the given string. |
|
2511 | * |
|
2512 | * @param $title |
|
2513 | * |
|
2514 | * @return mixed |
|
2515 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() |
|
2516 | */ |
|
2517 | public function dontSeeInTitle($title) { |
|
2518 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args())); |
|
2519 | } |
|
2520 | ||
2521 | ||
2522 | /** |
|
2523 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2524 | * |
|
2525 | * Switch to iframe or frame on the page. |
|
2526 | * |
|
2527 | * Example: |
|
2528 | * ``` html |
|
2529 | * <iframe name="another_frame" src="http://example.com"> |
|
2530 | * ``` |
|
2531 | * |
|
2532 | * ``` php |
|
2533 | * <?php |
|
2534 | * # switch to iframe |
|
2535 | * $I->switchToIframe("another_frame"); |
|
2536 | * ``` |
|
2537 | * |
|
2538 | * @param string $name |
|
2539 | * @see \Codeception\Lib\InnerBrowser::switchToIframe() |
|
2540 | */ |
|
2541 | public function switchToIframe($name) { |
|
2542 | return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToIframe', func_get_args())); |
|
2543 | } |
|
2544 | ||
2545 | ||
2546 | /** |
|
2547 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2548 | * |
|
2549 | * Moves back in history. |
|
2550 | * |
|
2551 | * @param int $numberOfSteps (default value 1) |
|
2552 | * @see \Codeception\Lib\InnerBrowser::moveBack() |
|
2553 | */ |
|
2554 | public function moveBack($numberOfSteps = null) { |
|
2555 | return $this->getScenario()->runStep(new \Codeception\Step\Action('moveBack', func_get_args())); |
|
2556 | } |
|
2557 | ||
2558 | ||
2559 | /** |
|
2560 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2561 | * |
|
2562 | * @inheritdoc |
|
2563 | * @see \tests\codeception\common\_support\FixtureHelper::globalFixtures() |
|
2564 | */ |
|
2565 | public function globalFixtures() { |
|
2566 | return $this->getScenario()->runStep(new \Codeception\Step\Action('globalFixtures', func_get_args())); |
|
2567 | } |
|
2568 | ||
2569 | ||
2570 | /** |
|
2571 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2572 | * |
|
2573 | * @inheritdoc |
|
2574 | * @see \tests\codeception\common\_support\FixtureHelper::fixtures() |
|
2575 | */ |
|
2576 | public function fixtures() { |
|
2577 | return $this->getScenario()->runStep(new \Codeception\Step\Action('fixtures', func_get_args())); |
|
2578 | } |
|
2579 | ||
2580 | ||
2581 | /** |
|
2582 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2583 | * |
|
2584 | * Loads the specified fixtures. |
|
2585 | * This method will call [[Fixture::load()]] for every fixture object. |
|
2586 | * @param Fixture[] $fixtures the fixtures to be loaded. If this parameter is not specified, |
|
2587 | * the return value of [[getFixtures()]] will be used. |
|
2588 | * @see \tests\codeception\common\_support\FixtureHelper::loadFixtures() |
|
2589 | */ |
|
2590 | public function loadFixtures($fixtures = null) { |
|
2591 | return $this->getScenario()->runStep(new \Codeception\Step\Action('loadFixtures', func_get_args())); |
|
2592 | } |
|
2593 | ||
2594 | ||
2595 | /** |
|
2596 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2597 | * |
|
2598 | * Creates the specified fixture instances. |
|
2599 | * All dependent fixtures will also be created. |
|
2600 | * @param array $fixtures the fixtures to be created. You may provide fixture names or fixture configurations. |
|
2601 | * If this parameter is not provided, the fixtures specified in [[globalFixtures()]] and [[fixtures()]] will be created. |
|
2602 | * @return Fixture[] the created fixture instances |
|
2603 | * @throws InvalidConfigException if fixtures are not properly configured or if a circular dependency among |
|
2604 | * the fixtures is detected. |
|
2605 | * @see \tests\codeception\common\_support\FixtureHelper::createFixtures() |
|
2606 | */ |
|
2607 | public function createFixtures($fixtures) { |
|
2608 | return $this->getScenario()->runStep(new \Codeception\Step\Action('createFixtures', func_get_args())); |
|
2609 | } |
|
2610 | } |
|
2611 |
@@ 12-2610 (lines=2599) @@ | ||
9 | use Codeception\Module\Yii2; |
|
10 | use tests\codeception\common\_support\FixtureHelper; |
|
11 | ||
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) { |
|
30 | return $this->getScenario()->runStep(new \Codeception\Step\Condition('amInPath', func_get_args())); |
|
31 | } |
|
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) { |
|
52 | return $this->getScenario()->runStep(new \Codeception\Step\Action('openFile', func_get_args())); |
|
53 | } |
|
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) { |
|
71 | return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteFile', func_get_args())); |
|
72 | } |
|
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) { |
|
90 | return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteDir', func_get_args())); |
|
91 | } |
|
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) { |
|
110 | return $this->getScenario()->runStep(new \Codeception\Step\Action('copyDir', func_get_args())); |
|
111 | } |
|
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) { |
|
133 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args())); |
|
134 | } |
|
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) { |
|
153 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args())); |
|
154 | } |
|
155 | ||
156 | ||
157 | /** |
|
158 | * [!] Method is generated. Documentation taken from corresponding module. |
|
159 | * |
|
160 | * Checks If opened file has the `number` of new lines. |
|
161 | * |
|
162 | * Usage: |
|
163 | * |
|
164 | * ``` php |
|
165 | * <?php |
|
166 | * $I->openFile('composer.json'); |
|
167 | * $I->seeNumberNewLines(5); |
|
168 | * ?> |
|
169 | * ``` |
|
170 | * |
|
171 | * @param int $number New lines |
|
172 | * Conditional Assertion: Test won't be stopped on fail |
|
173 | * @see \Codeception\Module\Filesystem::seeNumberNewLines() |
|
174 | */ |
|
175 | public function canSeeNumberNewLines($number) { |
|
176 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberNewLines', func_get_args())); |
|
177 | } |
|
178 | /** |
|
179 | * [!] Method is generated. Documentation taken from corresponding module. |
|
180 | * |
|
181 | * Checks If opened file has the `number` of new lines. |
|
182 | * |
|
183 | * Usage: |
|
184 | * |
|
185 | * ``` php |
|
186 | * <?php |
|
187 | * $I->openFile('composer.json'); |
|
188 | * $I->seeNumberNewLines(5); |
|
189 | * ?> |
|
190 | * ``` |
|
191 | * |
|
192 | * @param int $number New lines |
|
193 | * @see \Codeception\Module\Filesystem::seeNumberNewLines() |
|
194 | */ |
|
195 | public function seeNumberNewLines($number) { |
|
196 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberNewLines', func_get_args())); |
|
197 | } |
|
198 | ||
199 | ||
200 | /** |
|
201 | * [!] Method is generated. Documentation taken from corresponding module. |
|
202 | * |
|
203 | * Checks the strict matching of file contents. |
|
204 | * Unlike `seeInThisFile` will fail if file has something more than expected lines. |
|
205 | * Better to use with HEREDOC strings. |
|
206 | * Matching is done after removing "\r" chars from file content. |
|
207 | * |
|
208 | * ``` php |
|
209 | * <?php |
|
210 | * $I->openFile('process.pid'); |
|
211 | * $I->seeFileContentsEqual('3192'); |
|
212 | * ?> |
|
213 | * ``` |
|
214 | * |
|
215 | * @param $text |
|
216 | * Conditional Assertion: Test won't be stopped on fail |
|
217 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() |
|
218 | */ |
|
219 | public function canSeeFileContentsEqual($text) { |
|
220 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args())); |
|
221 | } |
|
222 | /** |
|
223 | * [!] Method is generated. Documentation taken from corresponding module. |
|
224 | * |
|
225 | * Checks the strict matching of file contents. |
|
226 | * Unlike `seeInThisFile` will fail if file has something more than expected lines. |
|
227 | * Better to use with HEREDOC strings. |
|
228 | * Matching is done after removing "\r" chars from file content. |
|
229 | * |
|
230 | * ``` php |
|
231 | * <?php |
|
232 | * $I->openFile('process.pid'); |
|
233 | * $I->seeFileContentsEqual('3192'); |
|
234 | * ?> |
|
235 | * ``` |
|
236 | * |
|
237 | * @param $text |
|
238 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() |
|
239 | */ |
|
240 | public function seeFileContentsEqual($text) { |
|
241 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args())); |
|
242 | } |
|
243 | ||
244 | ||
245 | /** |
|
246 | * [!] Method is generated. Documentation taken from corresponding module. |
|
247 | * |
|
248 | * Checks If opened file doesn't contain `text` in it |
|
249 | * |
|
250 | * ``` php |
|
251 | * <?php |
|
252 | * $I->openFile('composer.json'); |
|
253 | * $I->dontSeeInThisFile('codeception/codeception'); |
|
254 | * ?> |
|
255 | * ``` |
|
256 | * |
|
257 | * @param $text |
|
258 | * Conditional Assertion: Test won't be stopped on fail |
|
259 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() |
|
260 | */ |
|
261 | public function cantSeeInThisFile($text) { |
|
262 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args())); |
|
263 | } |
|
264 | /** |
|
265 | * [!] Method is generated. Documentation taken from corresponding module. |
|
266 | * |
|
267 | * Checks If opened file doesn't contain `text` in it |
|
268 | * |
|
269 | * ``` php |
|
270 | * <?php |
|
271 | * $I->openFile('composer.json'); |
|
272 | * $I->dontSeeInThisFile('codeception/codeception'); |
|
273 | * ?> |
|
274 | * ``` |
|
275 | * |
|
276 | * @param $text |
|
277 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() |
|
278 | */ |
|
279 | public function dontSeeInThisFile($text) { |
|
280 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args())); |
|
281 | } |
|
282 | ||
283 | ||
284 | /** |
|
285 | * [!] Method is generated. Documentation taken from corresponding module. |
|
286 | * |
|
287 | * Deletes a file |
|
288 | * @see \Codeception\Module\Filesystem::deleteThisFile() |
|
289 | */ |
|
290 | public function deleteThisFile() { |
|
291 | return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args())); |
|
292 | } |
|
293 | ||
294 | ||
295 | /** |
|
296 | * [!] Method is generated. Documentation taken from corresponding module. |
|
297 | * |
|
298 | * Checks if file exists in path. |
|
299 | * Opens a file when it's exists |
|
300 | * |
|
301 | * ``` php |
|
302 | * <?php |
|
303 | * $I->seeFileFound('UserModel.php','app/models'); |
|
304 | * ?> |
|
305 | * ``` |
|
306 | * |
|
307 | * @param $filename |
|
308 | * @param string $path |
|
309 | * Conditional Assertion: Test won't be stopped on fail |
|
310 | * @see \Codeception\Module\Filesystem::seeFileFound() |
|
311 | */ |
|
312 | public function canSeeFileFound($filename, $path = null) { |
|
313 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args())); |
|
314 | } |
|
315 | /** |
|
316 | * [!] Method is generated. Documentation taken from corresponding module. |
|
317 | * |
|
318 | * Checks if file exists in path. |
|
319 | * Opens a file when it's exists |
|
320 | * |
|
321 | * ``` php |
|
322 | * <?php |
|
323 | * $I->seeFileFound('UserModel.php','app/models'); |
|
324 | * ?> |
|
325 | * ``` |
|
326 | * |
|
327 | * @param $filename |
|
328 | * @param string $path |
|
329 | * @see \Codeception\Module\Filesystem::seeFileFound() |
|
330 | */ |
|
331 | public function seeFileFound($filename, $path = null) { |
|
332 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args())); |
|
333 | } |
|
334 | ||
335 | ||
336 | /** |
|
337 | * [!] Method is generated. Documentation taken from corresponding module. |
|
338 | * |
|
339 | * Checks if file does not exist in path |
|
340 | * |
|
341 | * @param $filename |
|
342 | * @param string $path |
|
343 | * Conditional Assertion: Test won't be stopped on fail |
|
344 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() |
|
345 | */ |
|
346 | public function cantSeeFileFound($filename, $path = null) { |
|
347 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args())); |
|
348 | } |
|
349 | /** |
|
350 | * [!] Method is generated. Documentation taken from corresponding module. |
|
351 | * |
|
352 | * Checks if file does not exist in path |
|
353 | * |
|
354 | * @param $filename |
|
355 | * @param string $path |
|
356 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() |
|
357 | */ |
|
358 | public function dontSeeFileFound($filename, $path = null) { |
|
359 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args())); |
|
360 | } |
|
361 | ||
362 | ||
363 | /** |
|
364 | * [!] Method is generated. Documentation taken from corresponding module. |
|
365 | * |
|
366 | * Erases directory contents |
|
367 | * |
|
368 | * ``` php |
|
369 | * <?php |
|
370 | * $I->cleanDir('logs'); |
|
371 | * ?> |
|
372 | * ``` |
|
373 | * |
|
374 | * @param $dirname |
|
375 | * @see \Codeception\Module\Filesystem::cleanDir() |
|
376 | */ |
|
377 | public function cleanDir($dirname) { |
|
378 | return $this->getScenario()->runStep(new \Codeception\Step\Action('cleanDir', func_get_args())); |
|
379 | } |
|
380 | ||
381 | ||
382 | /** |
|
383 | * [!] Method is generated. Documentation taken from corresponding module. |
|
384 | * |
|
385 | * Saves contents to file |
|
386 | * |
|
387 | * @param $filename |
|
388 | * @param $contents |
|
389 | * @see \Codeception\Module\Filesystem::writeToFile() |
|
390 | */ |
|
391 | public function writeToFile($filename, $contents) { |
|
392 | return $this->getScenario()->runStep(new \Codeception\Step\Action('writeToFile', func_get_args())); |
|
393 | } |
|
394 | ||
395 | ||
396 | /** |
|
397 | * [!] Method is generated. Documentation taken from corresponding module. |
|
398 | * |
|
399 | * Inserts record into the database. |
|
400 | * |
|
401 | * ``` php |
|
402 | * <?php |
|
403 | * $user_id = $I->haveRecord('app\models\User', array('name' => 'Davert')); |
|
404 | * ?> |
|
405 | * ``` |
|
406 | * |
|
407 | * @param $model |
|
408 | * @param array $attributes |
|
409 | * @return mixed |
|
410 | * @part orm |
|
411 | * @see \Codeception\Module\Yii2::haveRecord() |
|
412 | */ |
|
413 | public function haveRecord($model, $attributes = null) { |
|
414 | return $this->getScenario()->runStep(new \Codeception\Step\Action('haveRecord', func_get_args())); |
|
415 | } |
|
416 | ||
417 | ||
418 | /** |
|
419 | * [!] Method is generated. Documentation taken from corresponding module. |
|
420 | * |
|
421 | * Checks that record exists in database. |
|
422 | * |
|
423 | * ``` php |
|
424 | * $I->seeRecord('app\models\User', array('name' => 'davert')); |
|
425 | * ``` |
|
426 | * |
|
427 | * @param $model |
|
428 | * @param array $attributes |
|
429 | * @part orm |
|
430 | * Conditional Assertion: Test won't be stopped on fail |
|
431 | * @see \Codeception\Module\Yii2::seeRecord() |
|
432 | */ |
|
433 | public function canSeeRecord($model, $attributes = null) { |
|
434 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeRecord', func_get_args())); |
|
435 | } |
|
436 | /** |
|
437 | * [!] Method is generated. Documentation taken from corresponding module. |
|
438 | * |
|
439 | * Checks that record exists in database. |
|
440 | * |
|
441 | * ``` php |
|
442 | * $I->seeRecord('app\models\User', array('name' => 'davert')); |
|
443 | * ``` |
|
444 | * |
|
445 | * @param $model |
|
446 | * @param array $attributes |
|
447 | * @part orm |
|
448 | * @see \Codeception\Module\Yii2::seeRecord() |
|
449 | */ |
|
450 | public function seeRecord($model, $attributes = null) { |
|
451 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeRecord', func_get_args())); |
|
452 | } |
|
453 | ||
454 | ||
455 | /** |
|
456 | * [!] Method is generated. Documentation taken from corresponding module. |
|
457 | * |
|
458 | * Checks that record does not exist in database. |
|
459 | * |
|
460 | * ``` php |
|
461 | * $I->dontSeeRecord('app\models\User', array('name' => 'davert')); |
|
462 | * ``` |
|
463 | * |
|
464 | * @param $model |
|
465 | * @param array $attributes |
|
466 | * @part orm |
|
467 | * Conditional Assertion: Test won't be stopped on fail |
|
468 | * @see \Codeception\Module\Yii2::dontSeeRecord() |
|
469 | */ |
|
470 | public function cantSeeRecord($model, $attributes = null) { |
|
471 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeRecord', func_get_args())); |
|
472 | } |
|
473 | /** |
|
474 | * [!] Method is generated. Documentation taken from corresponding module. |
|
475 | * |
|
476 | * Checks that record does not exist in database. |
|
477 | * |
|
478 | * ``` php |
|
479 | * $I->dontSeeRecord('app\models\User', array('name' => 'davert')); |
|
480 | * ``` |
|
481 | * |
|
482 | * @param $model |
|
483 | * @param array $attributes |
|
484 | * @part orm |
|
485 | * @see \Codeception\Module\Yii2::dontSeeRecord() |
|
486 | */ |
|
487 | public function dontSeeRecord($model, $attributes = null) { |
|
488 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeRecord', func_get_args())); |
|
489 | } |
|
490 | ||
491 | ||
492 | /** |
|
493 | * [!] Method is generated. Documentation taken from corresponding module. |
|
494 | * |
|
495 | * Retrieves record from database |
|
496 | * |
|
497 | * ``` php |
|
498 | * $category = $I->grabRecord('app\models\User', array('name' => 'davert')); |
|
499 | * ``` |
|
500 | * |
|
501 | * @param $model |
|
502 | * @param array $attributes |
|
503 | * @return mixed |
|
504 | * @part orm |
|
505 | * @see \Codeception\Module\Yii2::grabRecord() |
|
506 | */ |
|
507 | public function grabRecord($model, $attributes = null) { |
|
508 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabRecord', func_get_args())); |
|
509 | } |
|
510 | ||
511 | ||
512 | /** |
|
513 | * [!] Method is generated. Documentation taken from corresponding module. |
|
514 | * |
|
515 | * Converting $page to valid Yii 2 URL |
|
516 | * |
|
517 | * Allows input like: |
|
518 | * |
|
519 | * ```php |
|
520 | * $I->amOnPage(['site/view','page'=>'about']); |
|
521 | * $I->amOnPage('index-test.php?site/index'); |
|
522 | * $I->amOnPage('http://localhost/index-test.php?site/index'); |
|
523 | * ``` |
|
524 | * |
|
525 | * @param $page string|array parameter for \yii\web\UrlManager::createUrl() |
|
526 | * @see \Codeception\Module\Yii2::amOnPage() |
|
527 | */ |
|
528 | public function amOnPage($page) { |
|
529 | return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); |
|
530 | } |
|
531 | ||
532 | ||
533 | /** |
|
534 | * [!] Method is generated. Documentation taken from corresponding module. |
|
535 | * |
|
536 | * Returns a list of regex patterns for recognized domain names |
|
537 | * |
|
538 | * @return array |
|
539 | * @see \Codeception\Module\Yii2::getInternalDomains() |
|
540 | */ |
|
541 | public function getInternalDomains() { |
|
542 | return $this->getScenario()->runStep(new \Codeception\Step\Action('getInternalDomains', func_get_args())); |
|
543 | } |
|
544 | ||
545 | ||
546 | /** |
|
547 | * [!] Method is generated. Documentation taken from corresponding module. |
|
548 | * |
|
549 | * Authenticates user for HTTP_AUTH |
|
550 | * |
|
551 | * @param $username |
|
552 | * @param $password |
|
553 | * @see \Codeception\Lib\InnerBrowser::amHttpAuthenticated() |
|
554 | */ |
|
555 | public function amHttpAuthenticated($username, $password) { |
|
556 | return $this->getScenario()->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args())); |
|
557 | } |
|
558 | ||
559 | ||
560 | /** |
|
561 | * [!] Method is generated. Documentation taken from corresponding module. |
|
562 | * |
|
563 | * Perform a click on a link or a button, given by a locator. |
|
564 | * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. |
|
565 | * For buttons, the "value" attribute, "name" attribute, and inner text are searched. |
|
566 | * For links, the link text is searched. |
|
567 | * For images, the "alt" attribute and inner text of any parent links are searched. |
|
568 | * |
|
569 | * The second parameter is a context (CSS or XPath locator) to narrow the search. |
|
570 | * |
|
571 | * Note that if the locator matches a button of type `submit`, the form will be submitted. |
|
572 | * |
|
573 | * ``` php |
|
574 | * <?php |
|
575 | * // simple link |
|
576 | * $I->click('Logout'); |
|
577 | * // button of form |
|
578 | * $I->click('Submit'); |
|
579 | * // CSS button |
|
580 | * $I->click('#form input[type=submit]'); |
|
581 | * // XPath |
|
582 | * $I->click('//form/*[@type=submit]'); |
|
583 | * // link in context |
|
584 | * $I->click('Logout', '#nav'); |
|
585 | * // using strict locator |
|
586 | * $I->click(['link' => 'Login']); |
|
587 | * ?> |
|
588 | * ``` |
|
589 | * |
|
590 | * @param $link |
|
591 | * @param $context |
|
592 | * @see \Codeception\Lib\InnerBrowser::click() |
|
593 | */ |
|
594 | public function click($link, $context = null) { |
|
595 | return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args())); |
|
596 | } |
|
597 | ||
598 | ||
599 | /** |
|
600 | * [!] Method is generated. Documentation taken from corresponding module. |
|
601 | * |
|
602 | * Checks that the current page contains the given string (case insensitive). |
|
603 | * |
|
604 | * You can specify a specific HTML element (via CSS or XPath) as the second |
|
605 | * parameter to only search within that element. |
|
606 | * |
|
607 | * ``` php |
|
608 | * <?php |
|
609 | * $I->see('Logout'); // I can suppose user is logged in |
|
610 | * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page |
|
611 | * $I->see('Sign Up', '//body/h1'); // with XPath |
|
612 | * ``` |
|
613 | * |
|
614 | * Note that the search is done after stripping all HTML tags from the body, |
|
615 | * so `$I->see('strong')` will return true for strings like: |
|
616 | * |
|
617 | * - `<p>I am Stronger than thou</p>` |
|
618 | * - `<script>document.createElement('strong');</script>` |
|
619 | * |
|
620 | * But will *not* be true for strings like: |
|
621 | * |
|
622 | * - `<strong>Home</strong>` |
|
623 | * - `<div class="strong">Home</strong>` |
|
624 | * - `<!-- strong -->` |
|
625 | * |
|
626 | * For checking the raw source code, use `seeInSource()`. |
|
627 | * |
|
628 | * @param $text |
|
629 | * @param null $selector |
|
630 | * Conditional Assertion: Test won't be stopped on fail |
|
631 | * @see \Codeception\Lib\InnerBrowser::see() |
|
632 | */ |
|
633 | public function canSee($text, $selector = null) { |
|
634 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args())); |
|
635 | } |
|
636 | /** |
|
637 | * [!] Method is generated. Documentation taken from corresponding module. |
|
638 | * |
|
639 | * Checks that the current page contains the given string (case insensitive). |
|
640 | * |
|
641 | * You can specify a specific HTML element (via CSS or XPath) as the second |
|
642 | * parameter to only search within that element. |
|
643 | * |
|
644 | * ``` php |
|
645 | * <?php |
|
646 | * $I->see('Logout'); // I can suppose user is logged in |
|
647 | * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page |
|
648 | * $I->see('Sign Up', '//body/h1'); // with XPath |
|
649 | * ``` |
|
650 | * |
|
651 | * Note that the search is done after stripping all HTML tags from the body, |
|
652 | * so `$I->see('strong')` will return true for strings like: |
|
653 | * |
|
654 | * - `<p>I am Stronger than thou</p>` |
|
655 | * - `<script>document.createElement('strong');</script>` |
|
656 | * |
|
657 | * But will *not* be true for strings like: |
|
658 | * |
|
659 | * - `<strong>Home</strong>` |
|
660 | * - `<div class="strong">Home</strong>` |
|
661 | * - `<!-- strong -->` |
|
662 | * |
|
663 | * For checking the raw source code, use `seeInSource()`. |
|
664 | * |
|
665 | * @param $text |
|
666 | * @param null $selector |
|
667 | * @see \Codeception\Lib\InnerBrowser::see() |
|
668 | */ |
|
669 | public function see($text, $selector = null) { |
|
670 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args())); |
|
671 | } |
|
672 | ||
673 | ||
674 | /** |
|
675 | * [!] Method is generated. Documentation taken from corresponding module. |
|
676 | * |
|
677 | * Checks that the current page doesn't contain the text specified (case insensitive). |
|
678 | * Give a locator as the second parameter to match a specific region. |
|
679 | * |
|
680 | * ```php |
|
681 | * <?php |
|
682 | * $I->dontSee('Login'); // I can suppose user is already logged in |
|
683 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page |
|
684 | * $I->dontSee('Sign Up','//body/h1'); // with XPath |
|
685 | * ``` |
|
686 | * |
|
687 | * Note that the search is done after stripping all HTML tags from the body, |
|
688 | * so `$I->dontSee('strong')` will fail on strings like: |
|
689 | * |
|
690 | * - `<p>I am Stronger than thou</p>` |
|
691 | * - `<script>document.createElement('strong');</script>` |
|
692 | * |
|
693 | * But will ignore strings like: |
|
694 | * |
|
695 | * - `<strong>Home</strong>` |
|
696 | * - `<div class="strong">Home</strong>` |
|
697 | * - `<!-- strong -->` |
|
698 | * |
|
699 | * For checking the raw source code, use `seeInSource()`. |
|
700 | * |
|
701 | * @param $text |
|
702 | * @param null $selector |
|
703 | * Conditional Assertion: Test won't be stopped on fail |
|
704 | * @see \Codeception\Lib\InnerBrowser::dontSee() |
|
705 | */ |
|
706 | public function cantSee($text, $selector = null) { |
|
707 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args())); |
|
708 | } |
|
709 | /** |
|
710 | * [!] Method is generated. Documentation taken from corresponding module. |
|
711 | * |
|
712 | * Checks that the current page doesn't contain the text specified (case insensitive). |
|
713 | * Give a locator as the second parameter to match a specific region. |
|
714 | * |
|
715 | * ```php |
|
716 | * <?php |
|
717 | * $I->dontSee('Login'); // I can suppose user is already logged in |
|
718 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page |
|
719 | * $I->dontSee('Sign Up','//body/h1'); // with XPath |
|
720 | * ``` |
|
721 | * |
|
722 | * Note that the search is done after stripping all HTML tags from the body, |
|
723 | * so `$I->dontSee('strong')` will fail on strings like: |
|
724 | * |
|
725 | * - `<p>I am Stronger than thou</p>` |
|
726 | * - `<script>document.createElement('strong');</script>` |
|
727 | * |
|
728 | * But will ignore strings like: |
|
729 | * |
|
730 | * - `<strong>Home</strong>` |
|
731 | * - `<div class="strong">Home</strong>` |
|
732 | * - `<!-- strong -->` |
|
733 | * |
|
734 | * For checking the raw source code, use `seeInSource()`. |
|
735 | * |
|
736 | * @param $text |
|
737 | * @param null $selector |
|
738 | * @see \Codeception\Lib\InnerBrowser::dontSee() |
|
739 | */ |
|
740 | public function dontSee($text, $selector = null) { |
|
741 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args())); |
|
742 | } |
|
743 | ||
744 | ||
745 | /** |
|
746 | * [!] Method is generated. Documentation taken from corresponding module. |
|
747 | * |
|
748 | * Checks that the current page contains the given string in its |
|
749 | * raw source code. |
|
750 | * |
|
751 | * ``` php |
|
752 | * <?php |
|
753 | * $I->seeInSource('<h1>Green eggs & ham</h1>'); |
|
754 | * ``` |
|
755 | * |
|
756 | * @param $raw |
|
757 | * Conditional Assertion: Test won't be stopped on fail |
|
758 | * @see \Codeception\Lib\InnerBrowser::seeInSource() |
|
759 | */ |
|
760 | public function canSeeInSource($raw) { |
|
761 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInSource', func_get_args())); |
|
762 | } |
|
763 | /** |
|
764 | * [!] Method is generated. Documentation taken from corresponding module. |
|
765 | * |
|
766 | * Checks that the current page contains the given string in its |
|
767 | * raw source code. |
|
768 | * |
|
769 | * ``` php |
|
770 | * <?php |
|
771 | * $I->seeInSource('<h1>Green eggs & ham</h1>'); |
|
772 | * ``` |
|
773 | * |
|
774 | * @param $raw |
|
775 | * @see \Codeception\Lib\InnerBrowser::seeInSource() |
|
776 | */ |
|
777 | public function seeInSource($raw) { |
|
778 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args())); |
|
779 | } |
|
780 | ||
781 | ||
782 | /** |
|
783 | * [!] Method is generated. Documentation taken from corresponding module. |
|
784 | * |
|
785 | * Checks that the current page contains the given string in its |
|
786 | * raw source code. |
|
787 | * |
|
788 | * ```php |
|
789 | * <?php |
|
790 | * $I->dontSeeInSource('<h1>Green eggs & ham</h1>'); |
|
791 | * ``` |
|
792 | * |
|
793 | * @param $raw |
|
794 | * Conditional Assertion: Test won't be stopped on fail |
|
795 | * @see \Codeception\Lib\InnerBrowser::dontSeeInSource() |
|
796 | */ |
|
797 | public function cantSeeInSource($raw) { |
|
798 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args())); |
|
799 | } |
|
800 | /** |
|
801 | * [!] Method is generated. Documentation taken from corresponding module. |
|
802 | * |
|
803 | * Checks that the current page contains the given string in its |
|
804 | * raw source code. |
|
805 | * |
|
806 | * ```php |
|
807 | * <?php |
|
808 | * $I->dontSeeInSource('<h1>Green eggs & ham</h1>'); |
|
809 | * ``` |
|
810 | * |
|
811 | * @param $raw |
|
812 | * @see \Codeception\Lib\InnerBrowser::dontSeeInSource() |
|
813 | */ |
|
814 | public function dontSeeInSource($raw) { |
|
815 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInSource', func_get_args())); |
|
816 | } |
|
817 | ||
818 | ||
819 | /** |
|
820 | * [!] Method is generated. Documentation taken from corresponding module. |
|
821 | * |
|
822 | * Checks that there's a link with the specified text. |
|
823 | * Give a full URL as the second parameter to match links with that exact URL. |
|
824 | * |
|
825 | * ``` php |
|
826 | * <?php |
|
827 | * $I->seeLink('Logout'); // matches <a href="#">Logout</a> |
|
828 | * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a> |
|
829 | * ?> |
|
830 | * ``` |
|
831 | * |
|
832 | * @param $text |
|
833 | * @param null $url |
|
834 | * Conditional Assertion: Test won't be stopped on fail |
|
835 | * @see \Codeception\Lib\InnerBrowser::seeLink() |
|
836 | */ |
|
837 | public function canSeeLink($text, $url = null) { |
|
838 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args())); |
|
839 | } |
|
840 | /** |
|
841 | * [!] Method is generated. Documentation taken from corresponding module. |
|
842 | * |
|
843 | * Checks that there's a link with the specified text. |
|
844 | * Give a full URL as the second parameter to match links with that exact URL. |
|
845 | * |
|
846 | * ``` php |
|
847 | * <?php |
|
848 | * $I->seeLink('Logout'); // matches <a href="#">Logout</a> |
|
849 | * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a> |
|
850 | * ?> |
|
851 | * ``` |
|
852 | * |
|
853 | * @param $text |
|
854 | * @param null $url |
|
855 | * @see \Codeception\Lib\InnerBrowser::seeLink() |
|
856 | */ |
|
857 | public function seeLink($text, $url = null) { |
|
858 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args())); |
|
859 | } |
|
860 | ||
861 | ||
862 | /** |
|
863 | * [!] Method is generated. Documentation taken from corresponding module. |
|
864 | * |
|
865 | * Checks that the page doesn't contain a link with the given string. |
|
866 | * If the second parameter is given, only links with a matching "href" attribute will be checked. |
|
867 | * |
|
868 | * ``` php |
|
869 | * <?php |
|
870 | * $I->dontSeeLink('Logout'); // I suppose user is not logged in |
|
871 | * $I->dontSeeLink('Checkout now', '/store/cart.php'); |
|
872 | * ?> |
|
873 | * ``` |
|
874 | * |
|
875 | * @param $text |
|
876 | * @param null $url |
|
877 | * Conditional Assertion: Test won't be stopped on fail |
|
878 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() |
|
879 | */ |
|
880 | public function cantSeeLink($text, $url = null) { |
|
881 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args())); |
|
882 | } |
|
883 | /** |
|
884 | * [!] Method is generated. Documentation taken from corresponding module. |
|
885 | * |
|
886 | * Checks that the page doesn't contain a link with the given string. |
|
887 | * If the second parameter is given, only links with a matching "href" attribute will be checked. |
|
888 | * |
|
889 | * ``` php |
|
890 | * <?php |
|
891 | * $I->dontSeeLink('Logout'); // I suppose user is not logged in |
|
892 | * $I->dontSeeLink('Checkout now', '/store/cart.php'); |
|
893 | * ?> |
|
894 | * ``` |
|
895 | * |
|
896 | * @param $text |
|
897 | * @param null $url |
|
898 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() |
|
899 | */ |
|
900 | public function dontSeeLink($text, $url = null) { |
|
901 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args())); |
|
902 | } |
|
903 | ||
904 | ||
905 | /** |
|
906 | * [!] Method is generated. Documentation taken from corresponding module. |
|
907 | * |
|
908 | * Checks that current URI contains the given string. |
|
909 | * |
|
910 | * ``` php |
|
911 | * <?php |
|
912 | * // to match: /home/dashboard |
|
913 | * $I->seeInCurrentUrl('home'); |
|
914 | * // to match: /users/1 |
|
915 | * $I->seeInCurrentUrl('/users/'); |
|
916 | * ?> |
|
917 | * ``` |
|
918 | * |
|
919 | * @param $uri |
|
920 | * Conditional Assertion: Test won't be stopped on fail |
|
921 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() |
|
922 | */ |
|
923 | public function canSeeInCurrentUrl($uri) { |
|
924 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); |
|
925 | } |
|
926 | /** |
|
927 | * [!] Method is generated. Documentation taken from corresponding module. |
|
928 | * |
|
929 | * Checks that current URI contains the given string. |
|
930 | * |
|
931 | * ``` php |
|
932 | * <?php |
|
933 | * // to match: /home/dashboard |
|
934 | * $I->seeInCurrentUrl('home'); |
|
935 | * // to match: /users/1 |
|
936 | * $I->seeInCurrentUrl('/users/'); |
|
937 | * ?> |
|
938 | * ``` |
|
939 | * |
|
940 | * @param $uri |
|
941 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() |
|
942 | */ |
|
943 | public function seeInCurrentUrl($uri) { |
|
944 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args())); |
|
945 | } |
|
946 | ||
947 | ||
948 | /** |
|
949 | * [!] Method is generated. Documentation taken from corresponding module. |
|
950 | * |
|
951 | * Checks that the current URI doesn't contain the given string. |
|
952 | * |
|
953 | * ``` php |
|
954 | * <?php |
|
955 | * $I->dontSeeInCurrentUrl('/users/'); |
|
956 | * ?> |
|
957 | * ``` |
|
958 | * |
|
959 | * @param $uri |
|
960 | * Conditional Assertion: Test won't be stopped on fail |
|
961 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() |
|
962 | */ |
|
963 | public function cantSeeInCurrentUrl($uri) { |
|
964 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); |
|
965 | } |
|
966 | /** |
|
967 | * [!] Method is generated. Documentation taken from corresponding module. |
|
968 | * |
|
969 | * Checks that the current URI doesn't contain the given string. |
|
970 | * |
|
971 | * ``` php |
|
972 | * <?php |
|
973 | * $I->dontSeeInCurrentUrl('/users/'); |
|
974 | * ?> |
|
975 | * ``` |
|
976 | * |
|
977 | * @param $uri |
|
978 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() |
|
979 | */ |
|
980 | public function dontSeeInCurrentUrl($uri) { |
|
981 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args())); |
|
982 | } |
|
983 | ||
984 | ||
985 | /** |
|
986 | * [!] Method is generated. Documentation taken from corresponding module. |
|
987 | * |
|
988 | * Checks that the current URL is equal to the given string. |
|
989 | * Unlike `seeInCurrentUrl`, this only matches the full URL. |
|
990 | * |
|
991 | * ``` php |
|
992 | * <?php |
|
993 | * // to match root url |
|
994 | * $I->seeCurrentUrlEquals('/'); |
|
995 | * ?> |
|
996 | * ``` |
|
997 | * |
|
998 | * @param $uri |
|
999 | * Conditional Assertion: Test won't be stopped on fail |
|
1000 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() |
|
1001 | */ |
|
1002 | public function canSeeCurrentUrlEquals($uri) { |
|
1003 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); |
|
1004 | } |
|
1005 | /** |
|
1006 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1007 | * |
|
1008 | * Checks that the current URL is equal to the given string. |
|
1009 | * Unlike `seeInCurrentUrl`, this only matches the full URL. |
|
1010 | * |
|
1011 | * ``` php |
|
1012 | * <?php |
|
1013 | * // to match root url |
|
1014 | * $I->seeCurrentUrlEquals('/'); |
|
1015 | * ?> |
|
1016 | * ``` |
|
1017 | * |
|
1018 | * @param $uri |
|
1019 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() |
|
1020 | */ |
|
1021 | public function seeCurrentUrlEquals($uri) { |
|
1022 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args())); |
|
1023 | } |
|
1024 | ||
1025 | ||
1026 | /** |
|
1027 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1028 | * |
|
1029 | * Checks that the current URL doesn't equal the given string. |
|
1030 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. |
|
1031 | * |
|
1032 | * ``` php |
|
1033 | * <?php |
|
1034 | * // current url is not root |
|
1035 | * $I->dontSeeCurrentUrlEquals('/'); |
|
1036 | * ?> |
|
1037 | * ``` |
|
1038 | * |
|
1039 | * @param $uri |
|
1040 | * Conditional Assertion: Test won't be stopped on fail |
|
1041 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() |
|
1042 | */ |
|
1043 | public function cantSeeCurrentUrlEquals($uri) { |
|
1044 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); |
|
1045 | } |
|
1046 | /** |
|
1047 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1048 | * |
|
1049 | * Checks that the current URL doesn't equal the given string. |
|
1050 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. |
|
1051 | * |
|
1052 | * ``` php |
|
1053 | * <?php |
|
1054 | * // current url is not root |
|
1055 | * $I->dontSeeCurrentUrlEquals('/'); |
|
1056 | * ?> |
|
1057 | * ``` |
|
1058 | * |
|
1059 | * @param $uri |
|
1060 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() |
|
1061 | */ |
|
1062 | public function dontSeeCurrentUrlEquals($uri) { |
|
1063 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args())); |
|
1064 | } |
|
1065 | ||
1066 | ||
1067 | /** |
|
1068 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1069 | * |
|
1070 | * Checks that the current URL matches the given regular expression. |
|
1071 | * |
|
1072 | * ``` php |
|
1073 | * <?php |
|
1074 | * // to match root url |
|
1075 | * $I->seeCurrentUrlMatches('~$/users/(\d+)~'); |
|
1076 | * ?> |
|
1077 | * ``` |
|
1078 | * |
|
1079 | * @param $uri |
|
1080 | * Conditional Assertion: Test won't be stopped on fail |
|
1081 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() |
|
1082 | */ |
|
1083 | public function canSeeCurrentUrlMatches($uri) { |
|
1084 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); |
|
1085 | } |
|
1086 | /** |
|
1087 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1088 | * |
|
1089 | * Checks that the current URL matches the given regular expression. |
|
1090 | * |
|
1091 | * ``` php |
|
1092 | * <?php |
|
1093 | * // to match root url |
|
1094 | * $I->seeCurrentUrlMatches('~$/users/(\d+)~'); |
|
1095 | * ?> |
|
1096 | * ``` |
|
1097 | * |
|
1098 | * @param $uri |
|
1099 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() |
|
1100 | */ |
|
1101 | public function seeCurrentUrlMatches($uri) { |
|
1102 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args())); |
|
1103 | } |
|
1104 | ||
1105 | ||
1106 | /** |
|
1107 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1108 | * |
|
1109 | * Checks that current url doesn't match the given regular expression. |
|
1110 | * |
|
1111 | * ``` php |
|
1112 | * <?php |
|
1113 | * // to match root url |
|
1114 | * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~'); |
|
1115 | * ?> |
|
1116 | * ``` |
|
1117 | * |
|
1118 | * @param $uri |
|
1119 | * Conditional Assertion: Test won't be stopped on fail |
|
1120 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() |
|
1121 | */ |
|
1122 | public function cantSeeCurrentUrlMatches($uri) { |
|
1123 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); |
|
1124 | } |
|
1125 | /** |
|
1126 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1127 | * |
|
1128 | * Checks that current url doesn't match the given regular expression. |
|
1129 | * |
|
1130 | * ``` php |
|
1131 | * <?php |
|
1132 | * // to match root url |
|
1133 | * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~'); |
|
1134 | * ?> |
|
1135 | * ``` |
|
1136 | * |
|
1137 | * @param $uri |
|
1138 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() |
|
1139 | */ |
|
1140 | public function dontSeeCurrentUrlMatches($uri) { |
|
1141 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args())); |
|
1142 | } |
|
1143 | ||
1144 | ||
1145 | /** |
|
1146 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1147 | * |
|
1148 | * Executes the given regular expression against the current URI and returns the first match. |
|
1149 | * If no parameters are provided, the full URI is returned. |
|
1150 | * |
|
1151 | * ``` php |
|
1152 | * <?php |
|
1153 | * $user_id = $I->grabFromCurrentUrl('~$/user/(\d+)/~'); |
|
1154 | * $uri = $I->grabFromCurrentUrl(); |
|
1155 | * ?> |
|
1156 | * ``` |
|
1157 | * |
|
1158 | * @param null $uri |
|
1159 | * |
|
1160 | * @return mixed |
|
1161 | * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl() |
|
1162 | */ |
|
1163 | public function grabFromCurrentUrl($uri = null) { |
|
1164 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args())); |
|
1165 | } |
|
1166 | ||
1167 | ||
1168 | /** |
|
1169 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1170 | * |
|
1171 | * Checks that the specified checkbox is checked. |
|
1172 | * |
|
1173 | * ``` php |
|
1174 | * <?php |
|
1175 | * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms |
|
1176 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. |
|
1177 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); |
|
1178 | * ?> |
|
1179 | * ``` |
|
1180 | * |
|
1181 | * @param $checkbox |
|
1182 | * Conditional Assertion: Test won't be stopped on fail |
|
1183 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() |
|
1184 | */ |
|
1185 | public function canSeeCheckboxIsChecked($checkbox) { |
|
1186 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); |
|
1187 | } |
|
1188 | /** |
|
1189 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1190 | * |
|
1191 | * Checks that the specified checkbox is checked. |
|
1192 | * |
|
1193 | * ``` php |
|
1194 | * <?php |
|
1195 | * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms |
|
1196 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. |
|
1197 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); |
|
1198 | * ?> |
|
1199 | * ``` |
|
1200 | * |
|
1201 | * @param $checkbox |
|
1202 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() |
|
1203 | */ |
|
1204 | public function seeCheckboxIsChecked($checkbox) { |
|
1205 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args())); |
|
1206 | } |
|
1207 | ||
1208 | ||
1209 | /** |
|
1210 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1211 | * |
|
1212 | * Check that the specified checkbox is unchecked. |
|
1213 | * |
|
1214 | * ``` php |
|
1215 | * <?php |
|
1216 | * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms |
|
1217 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. |
|
1218 | * ?> |
|
1219 | * ``` |
|
1220 | * |
|
1221 | * @param $checkbox |
|
1222 | * Conditional Assertion: Test won't be stopped on fail |
|
1223 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() |
|
1224 | */ |
|
1225 | public function cantSeeCheckboxIsChecked($checkbox) { |
|
1226 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); |
|
1227 | } |
|
1228 | /** |
|
1229 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1230 | * |
|
1231 | * Check that the specified checkbox is unchecked. |
|
1232 | * |
|
1233 | * ``` php |
|
1234 | * <?php |
|
1235 | * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms |
|
1236 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. |
|
1237 | * ?> |
|
1238 | * ``` |
|
1239 | * |
|
1240 | * @param $checkbox |
|
1241 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() |
|
1242 | */ |
|
1243 | public function dontSeeCheckboxIsChecked($checkbox) { |
|
1244 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args())); |
|
1245 | } |
|
1246 | ||
1247 | ||
1248 | /** |
|
1249 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1250 | * |
|
1251 | * Checks that the given input field or textarea contains the given value. |
|
1252 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. |
|
1253 | * |
|
1254 | * ``` php |
|
1255 | * <?php |
|
1256 | * $I->seeInField('Body','Type your comment here'); |
|
1257 | * $I->seeInField('form textarea[name=body]','Type your comment here'); |
|
1258 | * $I->seeInField('form input[type=hidden]','hidden_value'); |
|
1259 | * $I->seeInField('#searchform input','Search'); |
|
1260 | * $I->seeInField('//form/*[@name=search]','Search'); |
|
1261 | * $I->seeInField(['name' => 'search'], 'Search'); |
|
1262 | * ?> |
|
1263 | * ``` |
|
1264 | * |
|
1265 | * @param $field |
|
1266 | * @param $value |
|
1267 | * Conditional Assertion: Test won't be stopped on fail |
|
1268 | * @see \Codeception\Lib\InnerBrowser::seeInField() |
|
1269 | */ |
|
1270 | public function canSeeInField($field, $value) { |
|
1271 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); |
|
1272 | } |
|
1273 | /** |
|
1274 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1275 | * |
|
1276 | * Checks that the given input field or textarea contains the given value. |
|
1277 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. |
|
1278 | * |
|
1279 | * ``` php |
|
1280 | * <?php |
|
1281 | * $I->seeInField('Body','Type your comment here'); |
|
1282 | * $I->seeInField('form textarea[name=body]','Type your comment here'); |
|
1283 | * $I->seeInField('form input[type=hidden]','hidden_value'); |
|
1284 | * $I->seeInField('#searchform input','Search'); |
|
1285 | * $I->seeInField('//form/*[@name=search]','Search'); |
|
1286 | * $I->seeInField(['name' => 'search'], 'Search'); |
|
1287 | * ?> |
|
1288 | * ``` |
|
1289 | * |
|
1290 | * @param $field |
|
1291 | * @param $value |
|
1292 | * @see \Codeception\Lib\InnerBrowser::seeInField() |
|
1293 | */ |
|
1294 | public function seeInField($field, $value) { |
|
1295 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); |
|
1296 | } |
|
1297 | ||
1298 | ||
1299 | /** |
|
1300 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1301 | * |
|
1302 | * Checks that an input field or textarea doesn't contain the given value. |
|
1303 | * For fuzzy locators, the field is matched by label text, CSS and XPath. |
|
1304 | * |
|
1305 | * ``` php |
|
1306 | * <?php |
|
1307 | * $I->dontSeeInField('Body','Type your comment here'); |
|
1308 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); |
|
1309 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); |
|
1310 | * $I->dontSeeInField('#searchform input','Search'); |
|
1311 | * $I->dontSeeInField('//form/*[@name=search]','Search'); |
|
1312 | * $I->dontSeeInField(['name' => 'search'], 'Search'); |
|
1313 | * ?> |
|
1314 | * ``` |
|
1315 | * |
|
1316 | * @param $field |
|
1317 | * @param $value |
|
1318 | * Conditional Assertion: Test won't be stopped on fail |
|
1319 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() |
|
1320 | */ |
|
1321 | public function cantSeeInField($field, $value) { |
|
1322 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); |
|
1323 | } |
|
1324 | /** |
|
1325 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1326 | * |
|
1327 | * Checks that an input field or textarea doesn't contain the given value. |
|
1328 | * For fuzzy locators, the field is matched by label text, CSS and XPath. |
|
1329 | * |
|
1330 | * ``` php |
|
1331 | * <?php |
|
1332 | * $I->dontSeeInField('Body','Type your comment here'); |
|
1333 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); |
|
1334 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); |
|
1335 | * $I->dontSeeInField('#searchform input','Search'); |
|
1336 | * $I->dontSeeInField('//form/*[@name=search]','Search'); |
|
1337 | * $I->dontSeeInField(['name' => 'search'], 'Search'); |
|
1338 | * ?> |
|
1339 | * ``` |
|
1340 | * |
|
1341 | * @param $field |
|
1342 | * @param $value |
|
1343 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() |
|
1344 | */ |
|
1345 | public function dontSeeInField($field, $value) { |
|
1346 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args())); |
|
1347 | } |
|
1348 | ||
1349 | ||
1350 | /** |
|
1351 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1352 | * |
|
1353 | * Checks if the array of form parameters (name => value) are set on the form matched with the |
|
1354 | * passed selector. |
|
1355 | * |
|
1356 | * ``` php |
|
1357 | * <?php |
|
1358 | * $I->seeInFormFields('form[name=myform]', [ |
|
1359 | * 'input1' => 'value', |
|
1360 | * 'input2' => 'other value', |
|
1361 | * ]); |
|
1362 | * ?> |
|
1363 | * ``` |
|
1364 | * |
|
1365 | * For multi-select elements, or to check values of multiple elements with the same name, an |
|
1366 | * array may be passed: |
|
1367 | * |
|
1368 | * ``` php |
|
1369 | * <?php |
|
1370 | * $I->seeInFormFields('.form-class', [ |
|
1371 | * 'multiselect' => [ |
|
1372 | * 'value1', |
|
1373 | * 'value2', |
|
1374 | * ], |
|
1375 | * 'checkbox[]' => [ |
|
1376 | * 'a checked value', |
|
1377 | * 'another checked value', |
|
1378 | * ], |
|
1379 | * ]); |
|
1380 | * ?> |
|
1381 | * ``` |
|
1382 | * |
|
1383 | * Additionally, checkbox values can be checked with a boolean. |
|
1384 | * |
|
1385 | * ``` php |
|
1386 | * <?php |
|
1387 | * $I->seeInFormFields('#form-id', [ |
|
1388 | * 'checkbox1' => true, // passes if checked |
|
1389 | * 'checkbox2' => false, // passes if unchecked |
|
1390 | * ]); |
|
1391 | * ?> |
|
1392 | * ``` |
|
1393 | * |
|
1394 | * Pair this with submitForm for quick testing magic. |
|
1395 | * |
|
1396 | * ``` php |
|
1397 | * <?php |
|
1398 | * $form = [ |
|
1399 | * 'field1' => 'value', |
|
1400 | * 'field2' => 'another value', |
|
1401 | * 'checkbox1' => true, |
|
1402 | * // ... |
|
1403 | * ]; |
|
1404 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); |
|
1405 | * // $I->amOnPage('/path/to/form-page') may be needed |
|
1406 | * $I->seeInFormFields('//form[@id=my-form]', $form); |
|
1407 | * ?> |
|
1408 | * ``` |
|
1409 | * |
|
1410 | * @param $formSelector |
|
1411 | * @param $params |
|
1412 | * Conditional Assertion: Test won't be stopped on fail |
|
1413 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields() |
|
1414 | */ |
|
1415 | public function canSeeInFormFields($formSelector, $params) { |
|
1416 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args())); |
|
1417 | } |
|
1418 | /** |
|
1419 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1420 | * |
|
1421 | * Checks if the array of form parameters (name => value) are set on the form matched with the |
|
1422 | * passed selector. |
|
1423 | * |
|
1424 | * ``` php |
|
1425 | * <?php |
|
1426 | * $I->seeInFormFields('form[name=myform]', [ |
|
1427 | * 'input1' => 'value', |
|
1428 | * 'input2' => 'other value', |
|
1429 | * ]); |
|
1430 | * ?> |
|
1431 | * ``` |
|
1432 | * |
|
1433 | * For multi-select elements, or to check values of multiple elements with the same name, an |
|
1434 | * array may be passed: |
|
1435 | * |
|
1436 | * ``` php |
|
1437 | * <?php |
|
1438 | * $I->seeInFormFields('.form-class', [ |
|
1439 | * 'multiselect' => [ |
|
1440 | * 'value1', |
|
1441 | * 'value2', |
|
1442 | * ], |
|
1443 | * 'checkbox[]' => [ |
|
1444 | * 'a checked value', |
|
1445 | * 'another checked value', |
|
1446 | * ], |
|
1447 | * ]); |
|
1448 | * ?> |
|
1449 | * ``` |
|
1450 | * |
|
1451 | * Additionally, checkbox values can be checked with a boolean. |
|
1452 | * |
|
1453 | * ``` php |
|
1454 | * <?php |
|
1455 | * $I->seeInFormFields('#form-id', [ |
|
1456 | * 'checkbox1' => true, // passes if checked |
|
1457 | * 'checkbox2' => false, // passes if unchecked |
|
1458 | * ]); |
|
1459 | * ?> |
|
1460 | * ``` |
|
1461 | * |
|
1462 | * Pair this with submitForm for quick testing magic. |
|
1463 | * |
|
1464 | * ``` php |
|
1465 | * <?php |
|
1466 | * $form = [ |
|
1467 | * 'field1' => 'value', |
|
1468 | * 'field2' => 'another value', |
|
1469 | * 'checkbox1' => true, |
|
1470 | * // ... |
|
1471 | * ]; |
|
1472 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); |
|
1473 | * // $I->amOnPage('/path/to/form-page') may be needed |
|
1474 | * $I->seeInFormFields('//form[@id=my-form]', $form); |
|
1475 | * ?> |
|
1476 | * ``` |
|
1477 | * |
|
1478 | * @param $formSelector |
|
1479 | * @param $params |
|
1480 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields() |
|
1481 | */ |
|
1482 | public function seeInFormFields($formSelector, $params) { |
|
1483 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args())); |
|
1484 | } |
|
1485 | ||
1486 | ||
1487 | /** |
|
1488 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1489 | * |
|
1490 | * Checks if the array of form parameters (name => value) are not set on the form matched with |
|
1491 | * the passed selector. |
|
1492 | * |
|
1493 | * ``` php |
|
1494 | * <?php |
|
1495 | * $I->dontSeeInFormFields('form[name=myform]', [ |
|
1496 | * 'input1' => 'non-existent value', |
|
1497 | * 'input2' => 'other non-existent value', |
|
1498 | * ]); |
|
1499 | * ?> |
|
1500 | * ``` |
|
1501 | * |
|
1502 | * To check that an element hasn't been assigned any one of many values, an array can be passed |
|
1503 | * as the value: |
|
1504 | * |
|
1505 | * ``` php |
|
1506 | * <?php |
|
1507 | * $I->dontSeeInFormFields('.form-class', [ |
|
1508 | * 'fieldName' => [ |
|
1509 | * 'This value shouldn\'t be set', |
|
1510 | * 'And this value shouldn\'t be set', |
|
1511 | * ], |
|
1512 | * ]); |
|
1513 | * ?> |
|
1514 | * ``` |
|
1515 | * |
|
1516 | * Additionally, checkbox values can be checked with a boolean. |
|
1517 | * |
|
1518 | * ``` php |
|
1519 | * <?php |
|
1520 | * $I->dontSeeInFormFields('#form-id', [ |
|
1521 | * 'checkbox1' => true, // fails if checked |
|
1522 | * 'checkbox2' => false, // fails if unchecked |
|
1523 | * ]); |
|
1524 | * ?> |
|
1525 | * ``` |
|
1526 | * |
|
1527 | * @param $formSelector |
|
1528 | * @param $params |
|
1529 | * Conditional Assertion: Test won't be stopped on fail |
|
1530 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() |
|
1531 | */ |
|
1532 | public function cantSeeInFormFields($formSelector, $params) { |
|
1533 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args())); |
|
1534 | } |
|
1535 | /** |
|
1536 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1537 | * |
|
1538 | * Checks if the array of form parameters (name => value) are not set on the form matched with |
|
1539 | * the passed selector. |
|
1540 | * |
|
1541 | * ``` php |
|
1542 | * <?php |
|
1543 | * $I->dontSeeInFormFields('form[name=myform]', [ |
|
1544 | * 'input1' => 'non-existent value', |
|
1545 | * 'input2' => 'other non-existent value', |
|
1546 | * ]); |
|
1547 | * ?> |
|
1548 | * ``` |
|
1549 | * |
|
1550 | * To check that an element hasn't been assigned any one of many values, an array can be passed |
|
1551 | * as the value: |
|
1552 | * |
|
1553 | * ``` php |
|
1554 | * <?php |
|
1555 | * $I->dontSeeInFormFields('.form-class', [ |
|
1556 | * 'fieldName' => [ |
|
1557 | * 'This value shouldn\'t be set', |
|
1558 | * 'And this value shouldn\'t be set', |
|
1559 | * ], |
|
1560 | * ]); |
|
1561 | * ?> |
|
1562 | * ``` |
|
1563 | * |
|
1564 | * Additionally, checkbox values can be checked with a boolean. |
|
1565 | * |
|
1566 | * ``` php |
|
1567 | * <?php |
|
1568 | * $I->dontSeeInFormFields('#form-id', [ |
|
1569 | * 'checkbox1' => true, // fails if checked |
|
1570 | * 'checkbox2' => false, // fails if unchecked |
|
1571 | * ]); |
|
1572 | * ?> |
|
1573 | * ``` |
|
1574 | * |
|
1575 | * @param $formSelector |
|
1576 | * @param $params |
|
1577 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() |
|
1578 | */ |
|
1579 | public function dontSeeInFormFields($formSelector, $params) { |
|
1580 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInFormFields', func_get_args())); |
|
1581 | } |
|
1582 | ||
1583 | ||
1584 | /** |
|
1585 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1586 | * |
|
1587 | * Submits the given form on the page, optionally with the given form |
|
1588 | * values. Pass the form field's values as an array in the second |
|
1589 | * parameter. |
|
1590 | * |
|
1591 | * Although this function can be used as a short-hand version of |
|
1592 | * `fillField()`, `selectOption()`, `click()` etc. it has some important |
|
1593 | * differences: |
|
1594 | * |
|
1595 | * * Only field *names* may be used, not CSS/XPath selectors nor field labels |
|
1596 | * * If a field is sent to this function that does *not* exist on the page, |
|
1597 | * it will silently be added to the HTTP request. This is helpful for testing |
|
1598 | * some types of forms, but be aware that you will *not* get an exception |
|
1599 | * like you would if you called `fillField()` or `selectOption()` with |
|
1600 | * a missing field. |
|
1601 | * |
|
1602 | * Fields that are not provided will be filled by their values from the page, |
|
1603 | * or from any previous calls to `fillField()`, `selectOption()` etc. |
|
1604 | * You don't need to click the 'Submit' button afterwards. |
|
1605 | * This command itself triggers the request to form's action. |
|
1606 | * |
|
1607 | * You can optionally specify which button's value to include |
|
1608 | * in the request with the last parameter (as an alternative to |
|
1609 | * explicitly setting its value in the second parameter), as |
|
1610 | * button values are not otherwise included in the request. |
|
1611 | * |
|
1612 | * Examples: |
|
1613 | * |
|
1614 | * ``` php |
|
1615 | * <?php |
|
1616 | * $I->submitForm('#login', [ |
|
1617 | * 'login' => 'davert', |
|
1618 | * 'password' => '123456' |
|
1619 | * ]); |
|
1620 | * // or |
|
1621 | * $I->submitForm('#login', [ |
|
1622 | * 'login' => 'davert', |
|
1623 | * 'password' => '123456' |
|
1624 | * ], 'submitButtonName'); |
|
1625 | * |
|
1626 | * ``` |
|
1627 | * |
|
1628 | * For example, given this sample "Sign Up" form: |
|
1629 | * |
|
1630 | * ``` html |
|
1631 | * <form action="/sign_up"> |
|
1632 | * Login: |
|
1633 | * <input type="text" name="user[login]" /><br/> |
|
1634 | * Password: |
|
1635 | * <input type="password" name="user[password]" /><br/> |
|
1636 | * Do you agree to our terms? |
|
1637 | * <input type="checkbox" name="user[agree]" /><br/> |
|
1638 | * Select pricing plan: |
|
1639 | * <select name="plan"> |
|
1640 | * <option value="1">Free</option> |
|
1641 | * <option value="2" selected="selected">Paid</option> |
|
1642 | * </select> |
|
1643 | * <input type="submit" name="submitButton" value="Submit" /> |
|
1644 | * </form> |
|
1645 | * ``` |
|
1646 | * |
|
1647 | * You could write the following to submit it: |
|
1648 | * |
|
1649 | * ``` php |
|
1650 | * <?php |
|
1651 | * $I->submitForm( |
|
1652 | * '#userForm', |
|
1653 | * [ |
|
1654 | * 'user' => [ |
|
1655 | * 'login' => 'Davert', |
|
1656 | * 'password' => '123456', |
|
1657 | * 'agree' => true |
|
1658 | * ] |
|
1659 | * ], |
|
1660 | * 'submitButton' |
|
1661 | * ); |
|
1662 | * ``` |
|
1663 | * Note that "2" will be the submitted value for the "plan" field, as it is |
|
1664 | * the selected option. |
|
1665 | * |
|
1666 | * You can also emulate a JavaScript submission by not specifying any |
|
1667 | * buttons in the third parameter to submitForm. |
|
1668 | * |
|
1669 | * ```php |
|
1670 | * <?php |
|
1671 | * $I->submitForm( |
|
1672 | * '#userForm', |
|
1673 | * [ |
|
1674 | * 'user' => [ |
|
1675 | * 'login' => 'Davert', |
|
1676 | * 'password' => '123456', |
|
1677 | * 'agree' => true |
|
1678 | * ] |
|
1679 | * ] |
|
1680 | * ); |
|
1681 | * ``` |
|
1682 | * |
|
1683 | * This function works well when paired with `seeInFormFields()` |
|
1684 | * for quickly testing CRUD interfaces and form validation logic. |
|
1685 | * |
|
1686 | * ``` php |
|
1687 | * <?php |
|
1688 | * $form = [ |
|
1689 | * 'field1' => 'value', |
|
1690 | * 'field2' => 'another value', |
|
1691 | * 'checkbox1' => true, |
|
1692 | * // ... |
|
1693 | * ]; |
|
1694 | * $I->submitForm('#my-form', $form, 'submitButton'); |
|
1695 | * // $I->amOnPage('/path/to/form-page') may be needed |
|
1696 | * $I->seeInFormFields('#my-form', $form); |
|
1697 | * ``` |
|
1698 | * |
|
1699 | * Parameter values can be set to arrays for multiple input fields |
|
1700 | * of the same name, or multi-select combo boxes. For checkboxes, |
|
1701 | * you can use either the string value or boolean `true`/`false` which will |
|
1702 | * be replaced by the checkbox's value in the DOM. |
|
1703 | * |
|
1704 | * ``` php |
|
1705 | * <?php |
|
1706 | * $I->submitForm('#my-form', [ |
|
1707 | * 'field1' => 'value', |
|
1708 | * 'checkbox' => [ |
|
1709 | * 'value of first checkbox', |
|
1710 | * 'value of second checkbox', |
|
1711 | * ], |
|
1712 | * 'otherCheckboxes' => [ |
|
1713 | * true, |
|
1714 | * false, |
|
1715 | * false |
|
1716 | * ], |
|
1717 | * 'multiselect' => [ |
|
1718 | * 'first option value', |
|
1719 | * 'second option value' |
|
1720 | * ] |
|
1721 | * ]); |
|
1722 | * ``` |
|
1723 | * |
|
1724 | * Mixing string and boolean values for a checkbox's value is not supported |
|
1725 | * and may produce unexpected results. |
|
1726 | * |
|
1727 | * Field names ending in `[]` must be passed without the trailing square |
|
1728 | * bracket characters, and must contain an array for its value. This allows |
|
1729 | * submitting multiple values with the same name, consider: |
|
1730 | * |
|
1731 | * ```php |
|
1732 | * <?php |
|
1733 | * // This will NOT work correctly |
|
1734 | * $I->submitForm('#my-form', [ |
|
1735 | * 'field[]' => 'value', |
|
1736 | * 'field[]' => 'another value', // 'field[]' is already a defined key |
|
1737 | * ]); |
|
1738 | * ``` |
|
1739 | * |
|
1740 | * The solution is to pass an array value: |
|
1741 | * |
|
1742 | * ```php |
|
1743 | * <?php |
|
1744 | * // This way both values are submitted |
|
1745 | * $I->submitForm('#my-form', [ |
|
1746 | * 'field' => [ |
|
1747 | * 'value', |
|
1748 | * 'another value', |
|
1749 | * ] |
|
1750 | * ]); |
|
1751 | * ``` |
|
1752 | * |
|
1753 | * @param $selector |
|
1754 | * @param $params |
|
1755 | * @param $button |
|
1756 | * @see \Codeception\Lib\InnerBrowser::submitForm() |
|
1757 | */ |
|
1758 | public function submitForm($selector, $params, $button = null) { |
|
1759 | return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args())); |
|
1760 | } |
|
1761 | ||
1762 | ||
1763 | /** |
|
1764 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1765 | * |
|
1766 | * Fills a text field or textarea with the given string. |
|
1767 | * |
|
1768 | * ``` php |
|
1769 | * <?php |
|
1770 | * $I->fillField("//input[@type='text']", "Hello World!"); |
|
1771 | * $I->fillField(['name' => 'email'], '[email protected]'); |
|
1772 | * ?> |
|
1773 | * ``` |
|
1774 | * |
|
1775 | * @param $field |
|
1776 | * @param $value |
|
1777 | * @see \Codeception\Lib\InnerBrowser::fillField() |
|
1778 | */ |
|
1779 | public function fillField($field, $value) { |
|
1780 | return $this->getScenario()->runStep(new \Codeception\Step\Action('fillField', func_get_args())); |
|
1781 | } |
|
1782 | ||
1783 | ||
1784 | /** |
|
1785 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1786 | * |
|
1787 | * Selects an option in a select tag or in radio button group. |
|
1788 | * |
|
1789 | * ``` php |
|
1790 | * <?php |
|
1791 | * $I->selectOption('form select[name=account]', 'Premium'); |
|
1792 | * $I->selectOption('form input[name=payment]', 'Monthly'); |
|
1793 | * $I->selectOption('//form/select[@name=account]', 'Monthly'); |
|
1794 | * ?> |
|
1795 | * ``` |
|
1796 | * |
|
1797 | * Provide an array for the second argument to select multiple options: |
|
1798 | * |
|
1799 | * ``` php |
|
1800 | * <?php |
|
1801 | * $I->selectOption('Which OS do you use?', array('Windows','Linux')); |
|
1802 | * ?> |
|
1803 | * ``` |
|
1804 | * |
|
1805 | * @param $select |
|
1806 | * @param $option |
|
1807 | * @see \Codeception\Lib\InnerBrowser::selectOption() |
|
1808 | */ |
|
1809 | public function selectOption($select, $option) { |
|
1810 | return $this->getScenario()->runStep(new \Codeception\Step\Action('selectOption', func_get_args())); |
|
1811 | } |
|
1812 | ||
1813 | ||
1814 | /** |
|
1815 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1816 | * |
|
1817 | * Ticks a checkbox. For radio buttons, use the `selectOption` method instead. |
|
1818 | * |
|
1819 | * ``` php |
|
1820 | * <?php |
|
1821 | * $I->checkOption('#agree'); |
|
1822 | * ?> |
|
1823 | * ``` |
|
1824 | * |
|
1825 | * @param $option |
|
1826 | * @see \Codeception\Lib\InnerBrowser::checkOption() |
|
1827 | */ |
|
1828 | public function checkOption($option) { |
|
1829 | return $this->getScenario()->runStep(new \Codeception\Step\Action('checkOption', func_get_args())); |
|
1830 | } |
|
1831 | ||
1832 | ||
1833 | /** |
|
1834 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1835 | * |
|
1836 | * Unticks a checkbox. |
|
1837 | * |
|
1838 | * ``` php |
|
1839 | * <?php |
|
1840 | * $I->uncheckOption('#notify'); |
|
1841 | * ?> |
|
1842 | * ``` |
|
1843 | * |
|
1844 | * @param $option |
|
1845 | * @see \Codeception\Lib\InnerBrowser::uncheckOption() |
|
1846 | */ |
|
1847 | public function uncheckOption($option) { |
|
1848 | return $this->getScenario()->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args())); |
|
1849 | } |
|
1850 | ||
1851 | ||
1852 | /** |
|
1853 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1854 | * |
|
1855 | * Attaches a file relative to the Codeception data directory to the given file upload field. |
|
1856 | * |
|
1857 | * ``` php |
|
1858 | * <?php |
|
1859 | * // file is stored in 'tests/_data/prices.xls' |
|
1860 | * $I->attachFile('input[@type="file"]', 'prices.xls'); |
|
1861 | * ?> |
|
1862 | * ``` |
|
1863 | * |
|
1864 | * @param $field |
|
1865 | * @param $filename |
|
1866 | * @see \Codeception\Lib\InnerBrowser::attachFile() |
|
1867 | */ |
|
1868 | public function attachFile($field, $filename) { |
|
1869 | return $this->getScenario()->runStep(new \Codeception\Step\Action('attachFile', func_get_args())); |
|
1870 | } |
|
1871 | ||
1872 | ||
1873 | /** |
|
1874 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1875 | * |
|
1876 | * If your page triggers an ajax request, you can perform it manually. |
|
1877 | * This action sends a GET ajax request with specified params. |
|
1878 | * |
|
1879 | * See ->sendAjaxPostRequest for examples. |
|
1880 | * |
|
1881 | * @param $uri |
|
1882 | * @param $params |
|
1883 | * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest() |
|
1884 | */ |
|
1885 | public function sendAjaxGetRequest($uri, $params = null) { |
|
1886 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args())); |
|
1887 | } |
|
1888 | ||
1889 | ||
1890 | /** |
|
1891 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1892 | * |
|
1893 | * If your page triggers an ajax request, you can perform it manually. |
|
1894 | * This action sends a POST ajax request with specified params. |
|
1895 | * Additional params can be passed as array. |
|
1896 | * |
|
1897 | * Example: |
|
1898 | * |
|
1899 | * Imagine that by clicking checkbox you trigger ajax request which updates user settings. |
|
1900 | * We emulate that click by running this ajax request manually. |
|
1901 | * |
|
1902 | * ``` php |
|
1903 | * <?php |
|
1904 | * $I->sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST |
|
1905 | * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET |
|
1906 | * |
|
1907 | * ``` |
|
1908 | * |
|
1909 | * @param $uri |
|
1910 | * @param $params |
|
1911 | * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest() |
|
1912 | */ |
|
1913 | public function sendAjaxPostRequest($uri, $params = null) { |
|
1914 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args())); |
|
1915 | } |
|
1916 | ||
1917 | ||
1918 | /** |
|
1919 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1920 | * |
|
1921 | * If your page triggers an ajax request, you can perform it manually. |
|
1922 | * This action sends an ajax request with specified method and params. |
|
1923 | * |
|
1924 | * Example: |
|
1925 | * |
|
1926 | * You need to perform an ajax request specifying the HTTP method. |
|
1927 | * |
|
1928 | * ``` php |
|
1929 | * <?php |
|
1930 | * $I->sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title')); |
|
1931 | * |
|
1932 | * ``` |
|
1933 | * |
|
1934 | * @param $method |
|
1935 | * @param $uri |
|
1936 | * @param $params |
|
1937 | * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest() |
|
1938 | */ |
|
1939 | public function sendAjaxRequest($method, $uri, $params = null) { |
|
1940 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args())); |
|
1941 | } |
|
1942 | ||
1943 | ||
1944 | /** |
|
1945 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1946 | * |
|
1947 | * Finds and returns the text contents of the given element. |
|
1948 | * If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression. |
|
1949 | * |
|
1950 | * ``` php |
|
1951 | * <?php |
|
1952 | * $heading = $I->grabTextFrom('h1'); |
|
1953 | * $heading = $I->grabTextFrom('descendant-or-self::h1'); |
|
1954 | * $value = $I->grabTextFrom('~<input value=(.*?)]~sgi'); // match with a regex |
|
1955 | * ?> |
|
1956 | * ``` |
|
1957 | * |
|
1958 | * @param $cssOrXPathOrRegex |
|
1959 | * |
|
1960 | * @return mixed |
|
1961 | * @see \Codeception\Lib\InnerBrowser::grabTextFrom() |
|
1962 | */ |
|
1963 | public function grabTextFrom($cssOrXPathOrRegex) { |
|
1964 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args())); |
|
1965 | } |
|
1966 | ||
1967 | ||
1968 | /** |
|
1969 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1970 | * |
|
1971 | * Grabs the value of the given attribute value from the given element. |
|
1972 | * Fails if element is not found. |
|
1973 | * |
|
1974 | * ``` php |
|
1975 | * <?php |
|
1976 | * $I->grabAttributeFrom('#tooltip', 'title'); |
|
1977 | * ?> |
|
1978 | * ``` |
|
1979 | * |
|
1980 | * |
|
1981 | * @param $cssOrXpath |
|
1982 | * @param $attribute |
|
1983 | * |
|
1984 | * @return mixed |
|
1985 | * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom() |
|
1986 | */ |
|
1987 | public function grabAttributeFrom($cssOrXpath, $attribute) { |
|
1988 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args())); |
|
1989 | } |
|
1990 | ||
1991 | ||
1992 | /** |
|
1993 | * [!] Method is generated. Documentation taken from corresponding module. |
|
1994 | * |
|
1995 | * Grabs either the text content, or attribute values, of nodes |
|
1996 | * matched by $cssOrXpath and returns them as an array. |
|
1997 | * |
|
1998 | * ```html |
|
1999 | * <a href="#first">First</a> |
|
2000 | * <a href="#second">Second</a> |
|
2001 | * <a href="#third">Third</a> |
|
2002 | * ``` |
|
2003 | * |
|
2004 | * ```php |
|
2005 | * <?php |
|
2006 | * // would return ['First', 'Second', 'Third'] |
|
2007 | * $aLinkText = $I->grabMultiple('a'); |
|
2008 | * |
|
2009 | * // would return ['#first', '#second', '#third'] |
|
2010 | * $aLinks = $I->grabMultiple('a', 'href'); |
|
2011 | * ?> |
|
2012 | * ``` |
|
2013 | * |
|
2014 | * @param $cssOrXpath |
|
2015 | * @param $attribute |
|
2016 | * @return string[] |
|
2017 | * @see \Codeception\Lib\InnerBrowser::grabMultiple() |
|
2018 | */ |
|
2019 | public function grabMultiple($cssOrXpath, $attribute = null) { |
|
2020 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args())); |
|
2021 | } |
|
2022 | ||
2023 | ||
2024 | /** |
|
2025 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2026 | * |
|
2027 | * @param $field |
|
2028 | * |
|
2029 | * @return array|mixed|null|string |
|
2030 | * @see \Codeception\Lib\InnerBrowser::grabValueFrom() |
|
2031 | */ |
|
2032 | public function grabValueFrom($field) { |
|
2033 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args())); |
|
2034 | } |
|
2035 | ||
2036 | ||
2037 | /** |
|
2038 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2039 | * |
|
2040 | * Sets a cookie with the given name and value. |
|
2041 | * You can set additional cookie params like `domain`, `path`, `expires`, `secure` in array passed as last argument. |
|
2042 | * |
|
2043 | * ``` php |
|
2044 | * <?php |
|
2045 | * $I->setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); |
|
2046 | * ?> |
|
2047 | * ``` |
|
2048 | * |
|
2049 | * @param $name |
|
2050 | * @param $val |
|
2051 | * @param array $params |
|
2052 | * |
|
2053 | * @return mixed |
|
2054 | * @see \Codeception\Lib\InnerBrowser::setCookie() |
|
2055 | */ |
|
2056 | public function setCookie($name, $val, $params = null) { |
|
2057 | return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); |
|
2058 | } |
|
2059 | ||
2060 | ||
2061 | /** |
|
2062 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2063 | * |
|
2064 | * Grabs a cookie value. |
|
2065 | * You can set additional cookie params like `domain`, `path` in array passed as last argument. |
|
2066 | * |
|
2067 | * @param $cookie |
|
2068 | * |
|
2069 | * @param array $params |
|
2070 | * @return mixed |
|
2071 | * @see \Codeception\Lib\InnerBrowser::grabCookie() |
|
2072 | */ |
|
2073 | public function grabCookie($cookie, $params = null) { |
|
2074 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args())); |
|
2075 | } |
|
2076 | ||
2077 | ||
2078 | /** |
|
2079 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2080 | * |
|
2081 | * Checks that a cookie with the given name is set. |
|
2082 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
|
2083 | * |
|
2084 | * ``` php |
|
2085 | * <?php |
|
2086 | * $I->seeCookie('PHPSESSID'); |
|
2087 | * ?> |
|
2088 | * ``` |
|
2089 | * |
|
2090 | * @param $cookie |
|
2091 | * @param array $params |
|
2092 | * @return mixed |
|
2093 | * Conditional Assertion: Test won't be stopped on fail |
|
2094 | * @see \Codeception\Lib\InnerBrowser::seeCookie() |
|
2095 | */ |
|
2096 | public function canSeeCookie($cookie, $params = null) { |
|
2097 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); |
|
2098 | } |
|
2099 | /** |
|
2100 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2101 | * |
|
2102 | * Checks that a cookie with the given name is set. |
|
2103 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
|
2104 | * |
|
2105 | * ``` php |
|
2106 | * <?php |
|
2107 | * $I->seeCookie('PHPSESSID'); |
|
2108 | * ?> |
|
2109 | * ``` |
|
2110 | * |
|
2111 | * @param $cookie |
|
2112 | * @param array $params |
|
2113 | * @return mixed |
|
2114 | * @see \Codeception\Lib\InnerBrowser::seeCookie() |
|
2115 | */ |
|
2116 | public function seeCookie($cookie, $params = null) { |
|
2117 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); |
|
2118 | } |
|
2119 | ||
2120 | ||
2121 | /** |
|
2122 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2123 | * |
|
2124 | * Checks that there isn't a cookie with the given name. |
|
2125 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
|
2126 | * |
|
2127 | * @param $cookie |
|
2128 | * |
|
2129 | * @param array $params |
|
2130 | * @return mixed |
|
2131 | * Conditional Assertion: Test won't be stopped on fail |
|
2132 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() |
|
2133 | */ |
|
2134 | public function cantSeeCookie($cookie, $params = null) { |
|
2135 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); |
|
2136 | } |
|
2137 | /** |
|
2138 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2139 | * |
|
2140 | * Checks that there isn't a cookie with the given name. |
|
2141 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
|
2142 | * |
|
2143 | * @param $cookie |
|
2144 | * |
|
2145 | * @param array $params |
|
2146 | * @return mixed |
|
2147 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() |
|
2148 | */ |
|
2149 | public function dontSeeCookie($cookie, $params = null) { |
|
2150 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args())); |
|
2151 | } |
|
2152 | ||
2153 | ||
2154 | /** |
|
2155 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2156 | * |
|
2157 | * Unsets cookie with the given name. |
|
2158 | * You can set additional cookie params like `domain`, `path` in array passed as last argument. |
|
2159 | * |
|
2160 | * @param $cookie |
|
2161 | * |
|
2162 | * @param array $params |
|
2163 | * @return mixed |
|
2164 | * @see \Codeception\Lib\InnerBrowser::resetCookie() |
|
2165 | */ |
|
2166 | public function resetCookie($name, $params = null) { |
|
2167 | return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args())); |
|
2168 | } |
|
2169 | ||
2170 | ||
2171 | /** |
|
2172 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2173 | * |
|
2174 | * Checks that the given element exists on the page and is visible. |
|
2175 | * You can also specify expected attributes of this element. |
|
2176 | * |
|
2177 | * ``` php |
|
2178 | * <?php |
|
2179 | * $I->seeElement('.error'); |
|
2180 | * $I->seeElement('//form/input[1]'); |
|
2181 | * $I->seeElement('input', ['name' => 'login']); |
|
2182 | * $I->seeElement('input', ['value' => '123456']); |
|
2183 | * |
|
2184 | * // strict locator in first arg, attributes in second |
|
2185 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); |
|
2186 | * ?> |
|
2187 | * ``` |
|
2188 | * |
|
2189 | * @param $selector |
|
2190 | * @param array $attributes |
|
2191 | * @return |
|
2192 | * Conditional Assertion: Test won't be stopped on fail |
|
2193 | * @see \Codeception\Lib\InnerBrowser::seeElement() |
|
2194 | */ |
|
2195 | public function canSeeElement($selector, $attributes = null) { |
|
2196 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); |
|
2197 | } |
|
2198 | /** |
|
2199 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2200 | * |
|
2201 | * Checks that the given element exists on the page and is visible. |
|
2202 | * You can also specify expected attributes of this element. |
|
2203 | * |
|
2204 | * ``` php |
|
2205 | * <?php |
|
2206 | * $I->seeElement('.error'); |
|
2207 | * $I->seeElement('//form/input[1]'); |
|
2208 | * $I->seeElement('input', ['name' => 'login']); |
|
2209 | * $I->seeElement('input', ['value' => '123456']); |
|
2210 | * |
|
2211 | * // strict locator in first arg, attributes in second |
|
2212 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); |
|
2213 | * ?> |
|
2214 | * ``` |
|
2215 | * |
|
2216 | * @param $selector |
|
2217 | * @param array $attributes |
|
2218 | * @return |
|
2219 | * @see \Codeception\Lib\InnerBrowser::seeElement() |
|
2220 | */ |
|
2221 | public function seeElement($selector, $attributes = null) { |
|
2222 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); |
|
2223 | } |
|
2224 | ||
2225 | ||
2226 | /** |
|
2227 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2228 | * |
|
2229 | * Checks that the given element is invisible or not present on the page. |
|
2230 | * You can also specify expected attributes of this element. |
|
2231 | * |
|
2232 | * ``` php |
|
2233 | * <?php |
|
2234 | * $I->dontSeeElement('.error'); |
|
2235 | * $I->dontSeeElement('//form/input[1]'); |
|
2236 | * $I->dontSeeElement('input', ['name' => 'login']); |
|
2237 | * $I->dontSeeElement('input', ['value' => '123456']); |
|
2238 | * ?> |
|
2239 | * ``` |
|
2240 | * |
|
2241 | * @param $selector |
|
2242 | * @param array $attributes |
|
2243 | * Conditional Assertion: Test won't be stopped on fail |
|
2244 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() |
|
2245 | */ |
|
2246 | public function cantSeeElement($selector, $attributes = null) { |
|
2247 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); |
|
2248 | } |
|
2249 | /** |
|
2250 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2251 | * |
|
2252 | * Checks that the given element is invisible or not present on the page. |
|
2253 | * You can also specify expected attributes of this element. |
|
2254 | * |
|
2255 | * ``` php |
|
2256 | * <?php |
|
2257 | * $I->dontSeeElement('.error'); |
|
2258 | * $I->dontSeeElement('//form/input[1]'); |
|
2259 | * $I->dontSeeElement('input', ['name' => 'login']); |
|
2260 | * $I->dontSeeElement('input', ['value' => '123456']); |
|
2261 | * ?> |
|
2262 | * ``` |
|
2263 | * |
|
2264 | * @param $selector |
|
2265 | * @param array $attributes |
|
2266 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() |
|
2267 | */ |
|
2268 | public function dontSeeElement($selector, $attributes = null) { |
|
2269 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args())); |
|
2270 | } |
|
2271 | ||
2272 | ||
2273 | /** |
|
2274 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2275 | * |
|
2276 | * Checks that there are a certain number of elements matched by the given locator on the page. |
|
2277 | * |
|
2278 | * ``` php |
|
2279 | * <?php |
|
2280 | * $I->seeNumberOfElements('tr', 10); |
|
2281 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements |
|
2282 | * ?> |
|
2283 | * ``` |
|
2284 | * @param $selector |
|
2285 | * @param mixed $expected : |
|
2286 | * - string: strict number |
|
2287 | * - array: range of numbers [0,10] |
|
2288 | * Conditional Assertion: Test won't be stopped on fail |
|
2289 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() |
|
2290 | */ |
|
2291 | public function canSeeNumberOfElements($selector, $expected) { |
|
2292 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args())); |
|
2293 | } |
|
2294 | /** |
|
2295 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2296 | * |
|
2297 | * Checks that there are a certain number of elements matched by the given locator on the page. |
|
2298 | * |
|
2299 | * ``` php |
|
2300 | * <?php |
|
2301 | * $I->seeNumberOfElements('tr', 10); |
|
2302 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements |
|
2303 | * ?> |
|
2304 | * ``` |
|
2305 | * @param $selector |
|
2306 | * @param mixed $expected : |
|
2307 | * - string: strict number |
|
2308 | * - array: range of numbers [0,10] |
|
2309 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() |
|
2310 | */ |
|
2311 | public function seeNumberOfElements($selector, $expected) { |
|
2312 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args())); |
|
2313 | } |
|
2314 | ||
2315 | ||
2316 | /** |
|
2317 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2318 | * |
|
2319 | * Checks that the given option is selected. |
|
2320 | * |
|
2321 | * ``` php |
|
2322 | * <?php |
|
2323 | * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa'); |
|
2324 | * ?> |
|
2325 | * ``` |
|
2326 | * |
|
2327 | * @param $selector |
|
2328 | * @param $optionText |
|
2329 | * |
|
2330 | * @return mixed |
|
2331 | * Conditional Assertion: Test won't be stopped on fail |
|
2332 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() |
|
2333 | */ |
|
2334 | public function canSeeOptionIsSelected($selector, $optionText) { |
|
2335 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); |
|
2336 | } |
|
2337 | /** |
|
2338 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2339 | * |
|
2340 | * Checks that the given option is selected. |
|
2341 | * |
|
2342 | * ``` php |
|
2343 | * <?php |
|
2344 | * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa'); |
|
2345 | * ?> |
|
2346 | * ``` |
|
2347 | * |
|
2348 | * @param $selector |
|
2349 | * @param $optionText |
|
2350 | * |
|
2351 | * @return mixed |
|
2352 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() |
|
2353 | */ |
|
2354 | public function seeOptionIsSelected($selector, $optionText) { |
|
2355 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); |
|
2356 | } |
|
2357 | ||
2358 | ||
2359 | /** |
|
2360 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2361 | * |
|
2362 | * Checks that the given option is not selected. |
|
2363 | * |
|
2364 | * ``` php |
|
2365 | * <?php |
|
2366 | * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); |
|
2367 | * ?> |
|
2368 | * ``` |
|
2369 | * |
|
2370 | * @param $selector |
|
2371 | * @param $optionText |
|
2372 | * |
|
2373 | * @return mixed |
|
2374 | * Conditional Assertion: Test won't be stopped on fail |
|
2375 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() |
|
2376 | */ |
|
2377 | public function cantSeeOptionIsSelected($selector, $optionText) { |
|
2378 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); |
|
2379 | } |
|
2380 | /** |
|
2381 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2382 | * |
|
2383 | * Checks that the given option is not selected. |
|
2384 | * |
|
2385 | * ``` php |
|
2386 | * <?php |
|
2387 | * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); |
|
2388 | * ?> |
|
2389 | * ``` |
|
2390 | * |
|
2391 | * @param $selector |
|
2392 | * @param $optionText |
|
2393 | * |
|
2394 | * @return mixed |
|
2395 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() |
|
2396 | */ |
|
2397 | public function dontSeeOptionIsSelected($selector, $optionText) { |
|
2398 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args())); |
|
2399 | } |
|
2400 | ||
2401 | ||
2402 | /** |
|
2403 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2404 | * |
|
2405 | * Asserts that current page has 404 response status code. |
|
2406 | * Conditional Assertion: Test won't be stopped on fail |
|
2407 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() |
|
2408 | */ |
|
2409 | public function canSeePageNotFound() { |
|
2410 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args())); |
|
2411 | } |
|
2412 | /** |
|
2413 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2414 | * |
|
2415 | * Asserts that current page has 404 response status code. |
|
2416 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() |
|
2417 | */ |
|
2418 | public function seePageNotFound() { |
|
2419 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args())); |
|
2420 | } |
|
2421 | ||
2422 | ||
2423 | /** |
|
2424 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2425 | * |
|
2426 | * Checks that response code is equal to value provided. |
|
2427 | * |
|
2428 | * @param $code |
|
2429 | * |
|
2430 | * @return mixed |
|
2431 | * Conditional Assertion: Test won't be stopped on fail |
|
2432 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() |
|
2433 | */ |
|
2434 | public function canSeeResponseCodeIs($code) { |
|
2435 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args())); |
|
2436 | } |
|
2437 | /** |
|
2438 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2439 | * |
|
2440 | * Checks that response code is equal to value provided. |
|
2441 | * |
|
2442 | * @param $code |
|
2443 | * |
|
2444 | * @return mixed |
|
2445 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() |
|
2446 | */ |
|
2447 | public function seeResponseCodeIs($code) { |
|
2448 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args())); |
|
2449 | } |
|
2450 | ||
2451 | ||
2452 | /** |
|
2453 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2454 | * |
|
2455 | * Checks that the page title contains the given string. |
|
2456 | * |
|
2457 | * ``` php |
|
2458 | * <?php |
|
2459 | * $I->seeInTitle('Blog - Post #1'); |
|
2460 | * ?> |
|
2461 | * ``` |
|
2462 | * |
|
2463 | * @param $title |
|
2464 | * |
|
2465 | * @return mixed |
|
2466 | * Conditional Assertion: Test won't be stopped on fail |
|
2467 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() |
|
2468 | */ |
|
2469 | public function canSeeInTitle($title) { |
|
2470 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args())); |
|
2471 | } |
|
2472 | /** |
|
2473 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2474 | * |
|
2475 | * Checks that the page title contains the given string. |
|
2476 | * |
|
2477 | * ``` php |
|
2478 | * <?php |
|
2479 | * $I->seeInTitle('Blog - Post #1'); |
|
2480 | * ?> |
|
2481 | * ``` |
|
2482 | * |
|
2483 | * @param $title |
|
2484 | * |
|
2485 | * @return mixed |
|
2486 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() |
|
2487 | */ |
|
2488 | public function seeInTitle($title) { |
|
2489 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args())); |
|
2490 | } |
|
2491 | ||
2492 | ||
2493 | /** |
|
2494 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2495 | * |
|
2496 | * Checks that the page title does not contain the given string. |
|
2497 | * |
|
2498 | * @param $title |
|
2499 | * |
|
2500 | * @return mixed |
|
2501 | * Conditional Assertion: Test won't be stopped on fail |
|
2502 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() |
|
2503 | */ |
|
2504 | public function cantSeeInTitle($title) { |
|
2505 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args())); |
|
2506 | } |
|
2507 | /** |
|
2508 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2509 | * |
|
2510 | * Checks that the page title does not contain the given string. |
|
2511 | * |
|
2512 | * @param $title |
|
2513 | * |
|
2514 | * @return mixed |
|
2515 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() |
|
2516 | */ |
|
2517 | public function dontSeeInTitle($title) { |
|
2518 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args())); |
|
2519 | } |
|
2520 | ||
2521 | ||
2522 | /** |
|
2523 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2524 | * |
|
2525 | * Switch to iframe or frame on the page. |
|
2526 | * |
|
2527 | * Example: |
|
2528 | * ``` html |
|
2529 | * <iframe name="another_frame" src="http://example.com"> |
|
2530 | * ``` |
|
2531 | * |
|
2532 | * ``` php |
|
2533 | * <?php |
|
2534 | * # switch to iframe |
|
2535 | * $I->switchToIframe("another_frame"); |
|
2536 | * ``` |
|
2537 | * |
|
2538 | * @param string $name |
|
2539 | * @see \Codeception\Lib\InnerBrowser::switchToIframe() |
|
2540 | */ |
|
2541 | public function switchToIframe($name) { |
|
2542 | return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToIframe', func_get_args())); |
|
2543 | } |
|
2544 | ||
2545 | ||
2546 | /** |
|
2547 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2548 | * |
|
2549 | * Moves back in history. |
|
2550 | * |
|
2551 | * @param int $numberOfSteps (default value 1) |
|
2552 | * @see \Codeception\Lib\InnerBrowser::moveBack() |
|
2553 | */ |
|
2554 | public function moveBack($numberOfSteps = null) { |
|
2555 | return $this->getScenario()->runStep(new \Codeception\Step\Action('moveBack', func_get_args())); |
|
2556 | } |
|
2557 | ||
2558 | ||
2559 | /** |
|
2560 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2561 | * |
|
2562 | * @inheritdoc |
|
2563 | * @see \tests\codeception\common\_support\FixtureHelper::globalFixtures() |
|
2564 | */ |
|
2565 | public function globalFixtures() { |
|
2566 | return $this->getScenario()->runStep(new \Codeception\Step\Action('globalFixtures', func_get_args())); |
|
2567 | } |
|
2568 | ||
2569 | ||
2570 | /** |
|
2571 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2572 | * |
|
2573 | * @inheritdoc |
|
2574 | * @see \tests\codeception\common\_support\FixtureHelper::fixtures() |
|
2575 | */ |
|
2576 | public function fixtures() { |
|
2577 | return $this->getScenario()->runStep(new \Codeception\Step\Action('fixtures', func_get_args())); |
|
2578 | } |
|
2579 | ||
2580 | ||
2581 | /** |
|
2582 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2583 | * |
|
2584 | * Loads the specified fixtures. |
|
2585 | * This method will call [[Fixture::load()]] for every fixture object. |
|
2586 | * @param Fixture[] $fixtures the fixtures to be loaded. If this parameter is not specified, |
|
2587 | * the return value of [[getFixtures()]] will be used. |
|
2588 | * @see \tests\codeception\common\_support\FixtureHelper::loadFixtures() |
|
2589 | */ |
|
2590 | public function loadFixtures($fixtures = null) { |
|
2591 | return $this->getScenario()->runStep(new \Codeception\Step\Action('loadFixtures', func_get_args())); |
|
2592 | } |
|
2593 | ||
2594 | ||
2595 | /** |
|
2596 | * [!] Method is generated. Documentation taken from corresponding module. |
|
2597 | * |
|
2598 | * Creates the specified fixture instances. |
|
2599 | * All dependent fixtures will also be created. |
|
2600 | * @param array $fixtures the fixtures to be created. You may provide fixture names or fixture configurations. |
|
2601 | * If this parameter is not provided, the fixtures specified in [[globalFixtures()]] and [[fixtures()]] will be created. |
|
2602 | * @return Fixture[] the created fixture instances |
|
2603 | * @throws InvalidConfigException if fixtures are not properly configured or if a circular dependency among |
|
2604 | * the fixtures is detected. |
|
2605 | * @see \tests\codeception\common\_support\FixtureHelper::createFixtures() |
|
2606 | */ |
|
2607 | public function createFixtures($fixtures) { |
|
2608 | return $this->getScenario()->runStep(new \Codeception\Step\Action('createFixtures', func_get_args())); |
|
2609 | } |
|
2610 | } |
|
2611 |