This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php //[STAMP] b12af0ff33368e935576ea728df60576 |
||
| 2 | |||
| 3 | // This class was automatically generated by build task |
||
| 4 | // You should not change it manually as it will be overwritten on next build |
||
| 5 | // @codingStandardsIgnoreFile |
||
| 6 | |||
| 7 | |||
| 8 | use Codeception\Module\PhpBrowser; |
||
| 9 | use Codeception\Module\AcceptanceHelper; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Inherited Methods |
||
| 13 | * @method void wantToTest($text) |
||
| 14 | * @method void wantTo($text) |
||
| 15 | * @method void execute($callable) |
||
| 16 | * @method void expectTo($prediction) |
||
| 17 | * @method void expect($prediction) |
||
| 18 | * @method void amGoingTo($argumentation) |
||
| 19 | * @method void am($role) |
||
| 20 | * @method void lookForwardTo($achieveValue) |
||
| 21 | * @method void comment($description) |
||
| 22 | * @method void haveFriend($name, $actorClass = null) |
||
| 23 | * |
||
| 24 | * @SuppressWarnings(PHPMD) |
||
| 25 | */ |
||
| 26 | class AcceptanceTester extends \Codeception\Actor |
||
|
0 ignored issues
–
show
|
|||
| 27 | { |
||
| 28 | |||
| 29 | /** |
||
| 30 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 31 | * |
||
| 32 | * Sets the HTTP header to the passed value - which is used on |
||
| 33 | * subsequent HTTP requests through PhpBrowser. |
||
| 34 | * |
||
| 35 | * Example: |
||
| 36 | * ```php |
||
| 37 | * <?php |
||
| 38 | * $I->setHeader('X-Requested-With', 'Codeception'); |
||
| 39 | * $I->amOnPage('test-headers.php'); |
||
| 40 | * ?> |
||
| 41 | * ``` |
||
| 42 | * |
||
| 43 | * @param string $name the name of the request header |
||
| 44 | * @param string $value the value to set it to for subsequent |
||
| 45 | * requests |
||
| 46 | * @see \Codeception\Module\PhpBrowser::setHeader() |
||
| 47 | */ |
||
| 48 | public function setHeader($name, $value) { |
||
| 49 | return $this->scenario->runStep(new \Codeception\Step\Action('setHeader', func_get_args())); |
||
| 50 | } |
||
| 51 | |||
| 52 | |||
| 53 | /** |
||
| 54 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 55 | * |
||
| 56 | * Deletes the header with the passed name. Subsequent requests |
||
| 57 | * will not have the deleted header in its request. |
||
| 58 | * |
||
| 59 | * Example: |
||
| 60 | * ```php |
||
| 61 | * <?php |
||
| 62 | * $I->setHeader('X-Requested-With', 'Codeception'); |
||
| 63 | * $I->amOnPage('test-headers.php'); |
||
| 64 | * // ... |
||
| 65 | * $I->deleteHeader('X-Requested-With'); |
||
| 66 | * $I->amOnPage('some-other-page.php'); |
||
| 67 | * ?> |
||
| 68 | * ``` |
||
| 69 | * |
||
| 70 | * @param string $name the name of the header to delete. |
||
| 71 | * @see \Codeception\Module\PhpBrowser::deleteHeader() |
||
| 72 | */ |
||
| 73 | public function deleteHeader($name) { |
||
| 74 | return $this->scenario->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args())); |
||
| 75 | } |
||
| 76 | |||
| 77 | |||
| 78 | /** |
||
| 79 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 80 | * |
||
| 81 | * Authenticates user for HTTP_AUTH |
||
| 82 | * |
||
| 83 | * @param $username |
||
| 84 | * @param $password |
||
| 85 | * @see \Codeception\Module\PhpBrowser::amHttpAuthenticated() |
||
| 86 | */ |
||
| 87 | public function amHttpAuthenticated($username, $password) { |
||
| 88 | return $this->scenario->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args())); |
||
| 89 | } |
||
| 90 | |||
| 91 | |||
| 92 | /** |
||
| 93 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 94 | * |
||
| 95 | * Opens the page for the given relative URI. |
||
| 96 | * |
||
| 97 | * ``` php |
||
| 98 | * <?php |
||
| 99 | * // opens front page |
||
| 100 | * $I->amOnPage('/'); |
||
| 101 | * // opens /register page |
||
| 102 | * $I->amOnPage('/register'); |
||
| 103 | * ?> |
||
| 104 | * ``` |
||
| 105 | * |
||
| 106 | * @param $page |
||
| 107 | * @see \Codeception\Module\PhpBrowser::amOnPage() |
||
| 108 | */ |
||
| 109 | public function amOnPage($page) { |
||
| 110 | return $this->scenario->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); |
||
| 111 | } |
||
| 112 | |||
| 113 | |||
| 114 | /** |
||
| 115 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 116 | * |
||
| 117 | * Open web page at the given absolute URL and sets its hostname as the base host. |
||
| 118 | * |
||
| 119 | * ``` php |
||
| 120 | * <?php |
||
| 121 | * $I->amOnUrl('http://codeception.com'); |
||
| 122 | * $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart |
||
| 123 | * ?> |
||
| 124 | * ``` |
||
| 125 | * @see \Codeception\Module\PhpBrowser::amOnUrl() |
||
| 126 | */ |
||
| 127 | public function amOnUrl($url) { |
||
| 128 | return $this->scenario->runStep(new \Codeception\Step\Condition('amOnUrl', func_get_args())); |
||
| 129 | } |
||
| 130 | |||
| 131 | |||
| 132 | /** |
||
| 133 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 134 | * |
||
| 135 | * Changes the subdomain for the 'url' configuration parameter. |
||
| 136 | * Does not open a page; use `amOnPage` for that. |
||
| 137 | * |
||
| 138 | * ``` php |
||
| 139 | * <?php |
||
| 140 | * // If config is: 'http://mysite.com' |
||
| 141 | * // or config is: 'http://www.mysite.com' |
||
| 142 | * // or config is: 'http://company.mysite.com' |
||
| 143 | * |
||
| 144 | * $I->amOnSubdomain('user'); |
||
| 145 | * $I->amOnPage('/'); |
||
| 146 | * // moves to http://user.mysite.com/ |
||
| 147 | * ?> |
||
| 148 | * ``` |
||
| 149 | * |
||
| 150 | * @param $subdomain |
||
| 151 | * |
||
| 152 | * @return mixed |
||
| 153 | * @see \Codeception\Module\PhpBrowser::amOnSubdomain() |
||
| 154 | */ |
||
| 155 | public function amOnSubdomain($subdomain) { |
||
| 156 | return $this->scenario->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args())); |
||
| 157 | } |
||
| 158 | |||
| 159 | |||
| 160 | /** |
||
| 161 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 162 | * |
||
| 163 | * Low-level API method. |
||
| 164 | * If Codeception commands are not enough, use [Guzzle HTTP Client](http://guzzlephp.org/) methods directly |
||
| 165 | * |
||
| 166 | * Example: |
||
| 167 | * |
||
| 168 | * ``` php |
||
| 169 | * <?php |
||
| 170 | * $I->executeInGuzzle(function (\GuzzleHttp\Client $client) { |
||
| 171 | * $client->get('/get', ['query' => ['foo' => 'bar']]); |
||
| 172 | * }); |
||
| 173 | * ?> |
||
| 174 | * ``` |
||
| 175 | * |
||
| 176 | * It is not recommended to use this command on a regular basis. |
||
| 177 | * If Codeception lacks important Guzzle Client methods, implement them and submit patches. |
||
| 178 | * |
||
| 179 | * @param callable $function |
||
| 180 | * @see \Codeception\Module\PhpBrowser::executeInGuzzle() |
||
| 181 | */ |
||
| 182 | public function executeInGuzzle($function) { |
||
| 183 | return $this->scenario->runStep(new \Codeception\Step\Action('executeInGuzzle', func_get_args())); |
||
| 184 | } |
||
| 185 | |||
| 186 | |||
| 187 | /** |
||
| 188 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 189 | * |
||
| 190 | * Perform a click on a link or a button, given by a locator. |
||
| 191 | * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. |
||
| 192 | * For buttons, the "value" attribute, "name" attribute, and inner text are searched. |
||
| 193 | * For links, the link text is searched. |
||
| 194 | * For images, the "alt" attribute and inner text of any parent links are searched. |
||
| 195 | * |
||
| 196 | * The second parameter is a context (CSS or XPath locator) to narrow the search. |
||
| 197 | * |
||
| 198 | * Note that if the locator matches a button of type `submit`, the form will be submitted. |
||
| 199 | * |
||
| 200 | * ``` php |
||
| 201 | * <?php |
||
| 202 | * // simple link |
||
| 203 | * $I->click('Logout'); |
||
| 204 | * // button of form |
||
| 205 | * $I->click('Submit'); |
||
| 206 | * // CSS button |
||
| 207 | * $I->click('#form input[type=submit]'); |
||
| 208 | * // XPath |
||
| 209 | * $I->click('//form/*[@type=submit]'); |
||
| 210 | * // link in context |
||
| 211 | * $I->click('Logout', '#nav'); |
||
| 212 | * // using strict locator |
||
| 213 | * $I->click(['link' => 'Login']); |
||
| 214 | * ?> |
||
| 215 | * ``` |
||
| 216 | * |
||
| 217 | * @param $link |
||
| 218 | * @param $context |
||
| 219 | * @see \Codeception\Lib\InnerBrowser::click() |
||
| 220 | */ |
||
| 221 | public function click($link, $context = null) { |
||
| 222 | return $this->scenario->runStep(new \Codeception\Step\Action('click', func_get_args())); |
||
| 223 | } |
||
| 224 | |||
| 225 | |||
| 226 | /** |
||
| 227 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 228 | * |
||
| 229 | * Checks that the current page contains the given string. |
||
| 230 | * Specify a locator as the second parameter to match a specific region. |
||
| 231 | * |
||
| 232 | * ``` php |
||
| 233 | * <?php |
||
| 234 | * $I->see('Logout'); // I can suppose user is logged in |
||
| 235 | * $I->see('Sign Up','h1'); // I can suppose it's a signup page |
||
| 236 | * $I->see('Sign Up','//body/h1'); // with XPath |
||
| 237 | * ?> |
||
| 238 | * ``` |
||
| 239 | * |
||
| 240 | * @param $text |
||
| 241 | * @param null $selector |
||
| 242 | * Conditional Assertion: Test won't be stopped on fail |
||
| 243 | * @see \Codeception\Lib\InnerBrowser::see() |
||
| 244 | */ |
||
| 245 | public function canSee($text, $selector = null) { |
||
| 246 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args())); |
||
| 247 | } |
||
| 248 | /** |
||
| 249 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 250 | * |
||
| 251 | * Checks that the current page contains the given string. |
||
| 252 | * Specify a locator as the second parameter to match a specific region. |
||
| 253 | * |
||
| 254 | * ``` php |
||
| 255 | * <?php |
||
| 256 | * $I->see('Logout'); // I can suppose user is logged in |
||
| 257 | * $I->see('Sign Up','h1'); // I can suppose it's a signup page |
||
| 258 | * $I->see('Sign Up','//body/h1'); // with XPath |
||
| 259 | * ?> |
||
| 260 | * ``` |
||
| 261 | * |
||
| 262 | * @param $text |
||
| 263 | * @param null $selector |
||
| 264 | * @see \Codeception\Lib\InnerBrowser::see() |
||
| 265 | */ |
||
| 266 | public function see($text, $selector = null) { |
||
| 267 | return $this->scenario->runStep(new \Codeception\Step\Assertion('see', func_get_args())); |
||
| 268 | } |
||
| 269 | |||
| 270 | |||
| 271 | /** |
||
| 272 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 273 | * |
||
| 274 | * Checks that the current page doesn't contain the text specified. |
||
| 275 | * Give a locator as the second parameter to match a specific region. |
||
| 276 | * |
||
| 277 | * ```php |
||
| 278 | * <?php |
||
| 279 | * $I->dontSee('Login'); // I can suppose user is already logged in |
||
| 280 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page |
||
| 281 | * $I->dontSee('Sign Up','//body/h1'); // with XPath |
||
| 282 | * ?> |
||
| 283 | * ``` |
||
| 284 | * |
||
| 285 | * @param $text |
||
| 286 | * @param null $selector |
||
| 287 | * Conditional Assertion: Test won't be stopped on fail |
||
| 288 | * @see \Codeception\Lib\InnerBrowser::dontSee() |
||
| 289 | */ |
||
| 290 | public function cantSee($text, $selector = null) { |
||
| 291 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args())); |
||
| 292 | } |
||
| 293 | /** |
||
| 294 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 295 | * |
||
| 296 | * Checks that the current page doesn't contain the text specified. |
||
| 297 | * Give a locator as the second parameter to match a specific region. |
||
| 298 | * |
||
| 299 | * ```php |
||
| 300 | * <?php |
||
| 301 | * $I->dontSee('Login'); // I can suppose user is already logged in |
||
| 302 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page |
||
| 303 | * $I->dontSee('Sign Up','//body/h1'); // with XPath |
||
| 304 | * ?> |
||
| 305 | * ``` |
||
| 306 | * |
||
| 307 | * @param $text |
||
| 308 | * @param null $selector |
||
| 309 | * @see \Codeception\Lib\InnerBrowser::dontSee() |
||
| 310 | */ |
||
| 311 | public function dontSee($text, $selector = null) { |
||
| 312 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args())); |
||
| 313 | } |
||
| 314 | |||
| 315 | |||
| 316 | /** |
||
| 317 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 318 | * |
||
| 319 | * Checks that there's a link with the specified text. |
||
| 320 | * Give a full URL as the second parameter to match links with that exact URL. |
||
| 321 | * |
||
| 322 | * ``` php |
||
| 323 | * <?php |
||
| 324 | * $I->seeLink('Logout'); // matches <a href="#">Logout</a> |
||
| 325 | * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a> |
||
| 326 | * ?> |
||
| 327 | * ``` |
||
| 328 | * |
||
| 329 | * @param $text |
||
| 330 | * @param null $url |
||
| 331 | * Conditional Assertion: Test won't be stopped on fail |
||
| 332 | * @see \Codeception\Lib\InnerBrowser::seeLink() |
||
| 333 | */ |
||
| 334 | public function canSeeLink($text, $url = null) { |
||
| 335 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args())); |
||
| 336 | } |
||
| 337 | /** |
||
| 338 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 339 | * |
||
| 340 | * Checks that there's a link with the specified text. |
||
| 341 | * Give a full URL as the second parameter to match links with that exact URL. |
||
| 342 | * |
||
| 343 | * ``` php |
||
| 344 | * <?php |
||
| 345 | * $I->seeLink('Logout'); // matches <a href="#">Logout</a> |
||
| 346 | * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a> |
||
| 347 | * ?> |
||
| 348 | * ``` |
||
| 349 | * |
||
| 350 | * @param $text |
||
| 351 | * @param null $url |
||
| 352 | * @see \Codeception\Lib\InnerBrowser::seeLink() |
||
| 353 | */ |
||
| 354 | public function seeLink($text, $url = null) { |
||
| 355 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args())); |
||
| 356 | } |
||
| 357 | |||
| 358 | |||
| 359 | /** |
||
| 360 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 361 | * |
||
| 362 | * Checks that the page doesn't contain a link with the given string. |
||
| 363 | * If the second parameter is given, only links with a matching "href" attribute will be checked. |
||
| 364 | * |
||
| 365 | * ``` php |
||
| 366 | * <?php |
||
| 367 | * $I->dontSeeLink('Logout'); // I suppose user is not logged in |
||
| 368 | * $I->dontSeeLink('Checkout now', '/store/cart.php'); |
||
| 369 | * ?> |
||
| 370 | * ``` |
||
| 371 | * |
||
| 372 | * @param $text |
||
| 373 | * @param null $url |
||
| 374 | * Conditional Assertion: Test won't be stopped on fail |
||
| 375 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() |
||
| 376 | */ |
||
| 377 | public function cantSeeLink($text, $url = null) { |
||
| 378 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args())); |
||
| 379 | } |
||
| 380 | /** |
||
| 381 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 382 | * |
||
| 383 | * Checks that the page doesn't contain a link with the given string. |
||
| 384 | * If the second parameter is given, only links with a matching "href" attribute will be checked. |
||
| 385 | * |
||
| 386 | * ``` php |
||
| 387 | * <?php |
||
| 388 | * $I->dontSeeLink('Logout'); // I suppose user is not logged in |
||
| 389 | * $I->dontSeeLink('Checkout now', '/store/cart.php'); |
||
| 390 | * ?> |
||
| 391 | * ``` |
||
| 392 | * |
||
| 393 | * @param $text |
||
| 394 | * @param null $url |
||
| 395 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() |
||
| 396 | */ |
||
| 397 | public function dontSeeLink($text, $url = null) { |
||
| 398 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args())); |
||
| 399 | } |
||
| 400 | |||
| 401 | |||
| 402 | /** |
||
| 403 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 404 | * |
||
| 405 | * Checks that current URI contains the given string. |
||
| 406 | * |
||
| 407 | * ``` php |
||
| 408 | * <?php |
||
| 409 | * // to match: /home/dashboard |
||
| 410 | * $I->seeInCurrentUrl('home'); |
||
| 411 | * // to match: /users/1 |
||
| 412 | * $I->seeInCurrentUrl('/users/'); |
||
| 413 | * ?> |
||
| 414 | * ``` |
||
| 415 | * |
||
| 416 | * @param $uri |
||
| 417 | * Conditional Assertion: Test won't be stopped on fail |
||
| 418 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() |
||
| 419 | */ |
||
| 420 | public function canSeeInCurrentUrl($uri) { |
||
| 421 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); |
||
| 422 | } |
||
| 423 | /** |
||
| 424 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 425 | * |
||
| 426 | * Checks that current URI contains the given string. |
||
| 427 | * |
||
| 428 | * ``` php |
||
| 429 | * <?php |
||
| 430 | * // to match: /home/dashboard |
||
| 431 | * $I->seeInCurrentUrl('home'); |
||
| 432 | * // to match: /users/1 |
||
| 433 | * $I->seeInCurrentUrl('/users/'); |
||
| 434 | * ?> |
||
| 435 | * ``` |
||
| 436 | * |
||
| 437 | * @param $uri |
||
| 438 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() |
||
| 439 | */ |
||
| 440 | public function seeInCurrentUrl($uri) { |
||
| 441 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args())); |
||
| 442 | } |
||
| 443 | |||
| 444 | |||
| 445 | /** |
||
| 446 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 447 | * |
||
| 448 | * Checks that the current URI doesn't contain the given string. |
||
| 449 | * |
||
| 450 | * ``` php |
||
| 451 | * <?php |
||
| 452 | * $I->dontSeeInCurrentUrl('/users/'); |
||
| 453 | * ?> |
||
| 454 | * ``` |
||
| 455 | * |
||
| 456 | * @param $uri |
||
| 457 | * Conditional Assertion: Test won't be stopped on fail |
||
| 458 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() |
||
| 459 | */ |
||
| 460 | public function cantSeeInCurrentUrl($uri) { |
||
| 461 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); |
||
| 462 | } |
||
| 463 | /** |
||
| 464 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 465 | * |
||
| 466 | * Checks that the current URI doesn't contain the given string. |
||
| 467 | * |
||
| 468 | * ``` php |
||
| 469 | * <?php |
||
| 470 | * $I->dontSeeInCurrentUrl('/users/'); |
||
| 471 | * ?> |
||
| 472 | * ``` |
||
| 473 | * |
||
| 474 | * @param $uri |
||
| 475 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() |
||
| 476 | */ |
||
| 477 | public function dontSeeInCurrentUrl($uri) { |
||
| 478 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args())); |
||
| 479 | } |
||
| 480 | |||
| 481 | |||
| 482 | /** |
||
| 483 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 484 | * |
||
| 485 | * Checks that the current URL is equal to the given string. |
||
| 486 | * Unlike `seeInCurrentUrl`, this only matches the full URL. |
||
| 487 | * |
||
| 488 | * ``` php |
||
| 489 | * <?php |
||
| 490 | * // to match root url |
||
| 491 | * $I->seeCurrentUrlEquals('/'); |
||
| 492 | * ?> |
||
| 493 | * ``` |
||
| 494 | * |
||
| 495 | * @param $uri |
||
| 496 | * Conditional Assertion: Test won't be stopped on fail |
||
| 497 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() |
||
| 498 | */ |
||
| 499 | public function canSeeCurrentUrlEquals($uri) { |
||
| 500 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); |
||
| 501 | } |
||
| 502 | /** |
||
| 503 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 504 | * |
||
| 505 | * Checks that the current URL is equal to the given string. |
||
| 506 | * Unlike `seeInCurrentUrl`, this only matches the full URL. |
||
| 507 | * |
||
| 508 | * ``` php |
||
| 509 | * <?php |
||
| 510 | * // to match root url |
||
| 511 | * $I->seeCurrentUrlEquals('/'); |
||
| 512 | * ?> |
||
| 513 | * ``` |
||
| 514 | * |
||
| 515 | * @param $uri |
||
| 516 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() |
||
| 517 | */ |
||
| 518 | public function seeCurrentUrlEquals($uri) { |
||
| 519 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args())); |
||
| 520 | } |
||
| 521 | |||
| 522 | |||
| 523 | /** |
||
| 524 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 525 | * |
||
| 526 | * Checks that the current URL doesn't equal the given string. |
||
| 527 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. |
||
| 528 | * |
||
| 529 | * ``` php |
||
| 530 | * <?php |
||
| 531 | * // current url is not root |
||
| 532 | * $I->dontSeeCurrentUrlEquals('/'); |
||
| 533 | * ?> |
||
| 534 | * ``` |
||
| 535 | * |
||
| 536 | * @param $uri |
||
| 537 | * Conditional Assertion: Test won't be stopped on fail |
||
| 538 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() |
||
| 539 | */ |
||
| 540 | public function cantSeeCurrentUrlEquals($uri) { |
||
| 541 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); |
||
| 542 | } |
||
| 543 | /** |
||
| 544 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 545 | * |
||
| 546 | * Checks that the current URL doesn't equal the given string. |
||
| 547 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. |
||
| 548 | * |
||
| 549 | * ``` php |
||
| 550 | * <?php |
||
| 551 | * // current url is not root |
||
| 552 | * $I->dontSeeCurrentUrlEquals('/'); |
||
| 553 | * ?> |
||
| 554 | * ``` |
||
| 555 | * |
||
| 556 | * @param $uri |
||
| 557 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() |
||
| 558 | */ |
||
| 559 | public function dontSeeCurrentUrlEquals($uri) { |
||
| 560 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args())); |
||
| 561 | } |
||
| 562 | |||
| 563 | |||
| 564 | /** |
||
| 565 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 566 | * |
||
| 567 | * Checks that the current URL matches the given regular expression. |
||
| 568 | * |
||
| 569 | * ``` php |
||
| 570 | * <?php |
||
| 571 | * // to match root url |
||
| 572 | * $I->seeCurrentUrlMatches('~$/users/(\d+)~'); |
||
| 573 | * ?> |
||
| 574 | * ``` |
||
| 575 | * |
||
| 576 | * @param $uri |
||
| 577 | * Conditional Assertion: Test won't be stopped on fail |
||
| 578 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() |
||
| 579 | */ |
||
| 580 | public function canSeeCurrentUrlMatches($uri) { |
||
| 581 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); |
||
| 582 | } |
||
| 583 | /** |
||
| 584 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 585 | * |
||
| 586 | * Checks that the current URL matches the given regular expression. |
||
| 587 | * |
||
| 588 | * ``` php |
||
| 589 | * <?php |
||
| 590 | * // to match root url |
||
| 591 | * $I->seeCurrentUrlMatches('~$/users/(\d+)~'); |
||
| 592 | * ?> |
||
| 593 | * ``` |
||
| 594 | * |
||
| 595 | * @param $uri |
||
| 596 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() |
||
| 597 | */ |
||
| 598 | public function seeCurrentUrlMatches($uri) { |
||
| 599 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args())); |
||
| 600 | } |
||
| 601 | |||
| 602 | |||
| 603 | /** |
||
| 604 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 605 | * |
||
| 606 | * Checks that current url doesn't match the given regular expression. |
||
| 607 | * |
||
| 608 | * ``` php |
||
| 609 | * <?php |
||
| 610 | * // to match root url |
||
| 611 | * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~'); |
||
| 612 | * ?> |
||
| 613 | * ``` |
||
| 614 | * |
||
| 615 | * @param $uri |
||
| 616 | * Conditional Assertion: Test won't be stopped on fail |
||
| 617 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() |
||
| 618 | */ |
||
| 619 | public function cantSeeCurrentUrlMatches($uri) { |
||
| 620 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); |
||
| 621 | } |
||
| 622 | /** |
||
| 623 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 624 | * |
||
| 625 | * Checks that current url doesn't match the given regular expression. |
||
| 626 | * |
||
| 627 | * ``` php |
||
| 628 | * <?php |
||
| 629 | * // to match root url |
||
| 630 | * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~'); |
||
| 631 | * ?> |
||
| 632 | * ``` |
||
| 633 | * |
||
| 634 | * @param $uri |
||
| 635 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() |
||
| 636 | */ |
||
| 637 | public function dontSeeCurrentUrlMatches($uri) { |
||
| 638 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args())); |
||
| 639 | } |
||
| 640 | |||
| 641 | |||
| 642 | /** |
||
| 643 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 644 | * |
||
| 645 | * Executes the given regular expression against the current URI and returns the first match. |
||
| 646 | * If no parameters are provided, the full URI is returned. |
||
| 647 | * |
||
| 648 | * ``` php |
||
| 649 | * <?php |
||
| 650 | * $user_id = $I->grabFromCurrentUrl('~$/user/(\d+)/~'); |
||
| 651 | * $uri = $I->grabFromCurrentUrl(); |
||
| 652 | * ?> |
||
| 653 | * ``` |
||
| 654 | * |
||
| 655 | * @param null $uri |
||
| 656 | * |
||
| 657 | * @internal param $url |
||
| 658 | * @return mixed |
||
| 659 | * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl() |
||
| 660 | */ |
||
| 661 | public function grabFromCurrentUrl($uri = null) { |
||
| 662 | return $this->scenario->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args())); |
||
| 663 | } |
||
| 664 | |||
| 665 | |||
| 666 | /** |
||
| 667 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 668 | * |
||
| 669 | * Checks that the specified checkbox is checked. |
||
| 670 | * |
||
| 671 | * ``` php |
||
| 672 | * <?php |
||
| 673 | * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms |
||
| 674 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. |
||
| 675 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); |
||
| 676 | * ?> |
||
| 677 | * ``` |
||
| 678 | * |
||
| 679 | * @param $checkbox |
||
| 680 | * Conditional Assertion: Test won't be stopped on fail |
||
| 681 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() |
||
| 682 | */ |
||
| 683 | public function canSeeCheckboxIsChecked($checkbox) { |
||
| 684 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); |
||
| 685 | } |
||
| 686 | /** |
||
| 687 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 688 | * |
||
| 689 | * Checks that the specified checkbox is checked. |
||
| 690 | * |
||
| 691 | * ``` php |
||
| 692 | * <?php |
||
| 693 | * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms |
||
| 694 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. |
||
| 695 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); |
||
| 696 | * ?> |
||
| 697 | * ``` |
||
| 698 | * |
||
| 699 | * @param $checkbox |
||
| 700 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() |
||
| 701 | */ |
||
| 702 | public function seeCheckboxIsChecked($checkbox) { |
||
| 703 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args())); |
||
| 704 | } |
||
| 705 | |||
| 706 | |||
| 707 | /** |
||
| 708 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 709 | * |
||
| 710 | * Check that the specified checkbox is unchecked. |
||
| 711 | * |
||
| 712 | * ``` php |
||
| 713 | * <?php |
||
| 714 | * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms |
||
| 715 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. |
||
| 716 | * ?> |
||
| 717 | * ``` |
||
| 718 | * |
||
| 719 | * @param $checkbox |
||
| 720 | * Conditional Assertion: Test won't be stopped on fail |
||
| 721 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() |
||
| 722 | */ |
||
| 723 | public function cantSeeCheckboxIsChecked($checkbox) { |
||
| 724 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); |
||
| 725 | } |
||
| 726 | /** |
||
| 727 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 728 | * |
||
| 729 | * Check that the specified checkbox is unchecked. |
||
| 730 | * |
||
| 731 | * ``` php |
||
| 732 | * <?php |
||
| 733 | * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms |
||
| 734 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. |
||
| 735 | * ?> |
||
| 736 | * ``` |
||
| 737 | * |
||
| 738 | * @param $checkbox |
||
| 739 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() |
||
| 740 | */ |
||
| 741 | public function dontSeeCheckboxIsChecked($checkbox) { |
||
| 742 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args())); |
||
| 743 | } |
||
| 744 | |||
| 745 | |||
| 746 | /** |
||
| 747 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 748 | * |
||
| 749 | * Checks that the given input field or textarea contains the given value. |
||
| 750 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. |
||
| 751 | * |
||
| 752 | * ``` php |
||
| 753 | * <?php |
||
| 754 | * $I->seeInField('Body','Type your comment here'); |
||
| 755 | * $I->seeInField('form textarea[name=body]','Type your comment here'); |
||
| 756 | * $I->seeInField('form input[type=hidden]','hidden_value'); |
||
| 757 | * $I->seeInField('#searchform input','Search'); |
||
| 758 | * $I->seeInField('//form/*[@name=search]','Search'); |
||
| 759 | * $I->seeInField(['name' => 'search'], 'Search'); |
||
| 760 | * ?> |
||
| 761 | * ``` |
||
| 762 | * |
||
| 763 | * @param $field |
||
| 764 | * @param $value |
||
| 765 | * Conditional Assertion: Test won't be stopped on fail |
||
| 766 | * @see \Codeception\Lib\InnerBrowser::seeInField() |
||
| 767 | */ |
||
| 768 | public function canSeeInField($field, $value) { |
||
| 769 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); |
||
| 770 | } |
||
| 771 | /** |
||
| 772 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 773 | * |
||
| 774 | * Checks that the given input field or textarea contains the given value. |
||
| 775 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. |
||
| 776 | * |
||
| 777 | * ``` php |
||
| 778 | * <?php |
||
| 779 | * $I->seeInField('Body','Type your comment here'); |
||
| 780 | * $I->seeInField('form textarea[name=body]','Type your comment here'); |
||
| 781 | * $I->seeInField('form input[type=hidden]','hidden_value'); |
||
| 782 | * $I->seeInField('#searchform input','Search'); |
||
| 783 | * $I->seeInField('//form/*[@name=search]','Search'); |
||
| 784 | * $I->seeInField(['name' => 'search'], 'Search'); |
||
| 785 | * ?> |
||
| 786 | * ``` |
||
| 787 | * |
||
| 788 | * @param $field |
||
| 789 | * @param $value |
||
| 790 | * @see \Codeception\Lib\InnerBrowser::seeInField() |
||
| 791 | */ |
||
| 792 | public function seeInField($field, $value) { |
||
| 793 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); |
||
| 794 | } |
||
| 795 | |||
| 796 | |||
| 797 | /** |
||
| 798 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 799 | * |
||
| 800 | * Checks that an input field or textarea doesn't contain the given value. |
||
| 801 | * For fuzzy locators, the field is matched by label text, CSS and XPath. |
||
| 802 | * |
||
| 803 | * ``` php |
||
| 804 | * <?php |
||
| 805 | * $I->dontSeeInField('Body','Type your comment here'); |
||
| 806 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); |
||
| 807 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); |
||
| 808 | * $I->dontSeeInField('#searchform input','Search'); |
||
| 809 | * $I->dontSeeInField('//form/*[@name=search]','Search'); |
||
| 810 | * $I->dontSeeInField(['name' => 'search'], 'Search'); |
||
| 811 | * ?> |
||
| 812 | * ``` |
||
| 813 | * |
||
| 814 | * @param $field |
||
| 815 | * @param $value |
||
| 816 | * Conditional Assertion: Test won't be stopped on fail |
||
| 817 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() |
||
| 818 | */ |
||
| 819 | public function cantSeeInField($field, $value) { |
||
| 820 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); |
||
| 821 | } |
||
| 822 | /** |
||
| 823 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 824 | * |
||
| 825 | * Checks that an input field or textarea doesn't contain the given value. |
||
| 826 | * For fuzzy locators, the field is matched by label text, CSS and XPath. |
||
| 827 | * |
||
| 828 | * ``` php |
||
| 829 | * <?php |
||
| 830 | * $I->dontSeeInField('Body','Type your comment here'); |
||
| 831 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); |
||
| 832 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); |
||
| 833 | * $I->dontSeeInField('#searchform input','Search'); |
||
| 834 | * $I->dontSeeInField('//form/*[@name=search]','Search'); |
||
| 835 | * $I->dontSeeInField(['name' => 'search'], 'Search'); |
||
| 836 | * ?> |
||
| 837 | * ``` |
||
| 838 | * |
||
| 839 | * @param $field |
||
| 840 | * @param $value |
||
| 841 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() |
||
| 842 | */ |
||
| 843 | public function dontSeeInField($field, $value) { |
||
| 844 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args())); |
||
| 845 | } |
||
| 846 | |||
| 847 | |||
| 848 | /** |
||
| 849 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 850 | * |
||
| 851 | * Checks if the array of form parameters (name => value) are set on the form matched with the |
||
| 852 | * passed selector. |
||
| 853 | * |
||
| 854 | * ``` php |
||
| 855 | * <?php |
||
| 856 | * $I->seeInFormFields('form[name=myform]', [ |
||
| 857 | * 'input1' => 'value', |
||
| 858 | * 'input2' => 'other value', |
||
| 859 | * ]); |
||
| 860 | * ?> |
||
| 861 | * ``` |
||
| 862 | * |
||
| 863 | * For multi-select elements, or to check values of multiple elements with the same name, an |
||
| 864 | * array may be passed: |
||
| 865 | * |
||
| 866 | * ``` php |
||
| 867 | * <?php |
||
| 868 | * $I->seeInFormFields('.form-class', [ |
||
| 869 | * 'multiselect' => [ |
||
| 870 | * 'value1', |
||
| 871 | * 'value2', |
||
| 872 | * ], |
||
| 873 | * 'checkbox[]' => [ |
||
| 874 | * 'a checked value', |
||
| 875 | * 'another checked value', |
||
| 876 | * ], |
||
| 877 | * ]); |
||
| 878 | * ?> |
||
| 879 | * ``` |
||
| 880 | * |
||
| 881 | * Additionally, checkbox values can be checked with a boolean. |
||
| 882 | * |
||
| 883 | * ``` php |
||
| 884 | * <?php |
||
| 885 | * $I->seeInFormFields('#form-id', [ |
||
| 886 | * 'checkbox1' => true, // passes if checked |
||
| 887 | * 'checkbox2' => false, // passes if unchecked |
||
| 888 | * ]); |
||
| 889 | * ?> |
||
| 890 | * ``` |
||
| 891 | * |
||
| 892 | * Pair this with submitForm for quick testing magic. |
||
| 893 | * |
||
| 894 | * ``` php |
||
| 895 | * <?php |
||
| 896 | * $form = [ |
||
| 897 | * 'field1' => 'value', |
||
| 898 | * 'field2' => 'another value', |
||
| 899 | * 'checkbox1' => true, |
||
| 900 | * // ... |
||
| 901 | * ]; |
||
| 902 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); |
||
| 903 | * // $I->amOnPage('/path/to/form-page') may be needed |
||
| 904 | * $I->seeInFormFields('//form[@id=my-form]', $form); |
||
| 905 | * ?> |
||
| 906 | * ``` |
||
| 907 | * |
||
| 908 | * @param $formSelector |
||
| 909 | * @param $params |
||
| 910 | * Conditional Assertion: Test won't be stopped on fail |
||
| 911 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields() |
||
| 912 | */ |
||
| 913 | public function canSeeInFormFields($formSelector, $params) { |
||
| 914 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args())); |
||
| 915 | } |
||
| 916 | /** |
||
| 917 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 918 | * |
||
| 919 | * Checks if the array of form parameters (name => value) are set on the form matched with the |
||
| 920 | * passed selector. |
||
| 921 | * |
||
| 922 | * ``` php |
||
| 923 | * <?php |
||
| 924 | * $I->seeInFormFields('form[name=myform]', [ |
||
| 925 | * 'input1' => 'value', |
||
| 926 | * 'input2' => 'other value', |
||
| 927 | * ]); |
||
| 928 | * ?> |
||
| 929 | * ``` |
||
| 930 | * |
||
| 931 | * For multi-select elements, or to check values of multiple elements with the same name, an |
||
| 932 | * array may be passed: |
||
| 933 | * |
||
| 934 | * ``` php |
||
| 935 | * <?php |
||
| 936 | * $I->seeInFormFields('.form-class', [ |
||
| 937 | * 'multiselect' => [ |
||
| 938 | * 'value1', |
||
| 939 | * 'value2', |
||
| 940 | * ], |
||
| 941 | * 'checkbox[]' => [ |
||
| 942 | * 'a checked value', |
||
| 943 | * 'another checked value', |
||
| 944 | * ], |
||
| 945 | * ]); |
||
| 946 | * ?> |
||
| 947 | * ``` |
||
| 948 | * |
||
| 949 | * Additionally, checkbox values can be checked with a boolean. |
||
| 950 | * |
||
| 951 | * ``` php |
||
| 952 | * <?php |
||
| 953 | * $I->seeInFormFields('#form-id', [ |
||
| 954 | * 'checkbox1' => true, // passes if checked |
||
| 955 | * 'checkbox2' => false, // passes if unchecked |
||
| 956 | * ]); |
||
| 957 | * ?> |
||
| 958 | * ``` |
||
| 959 | * |
||
| 960 | * Pair this with submitForm for quick testing magic. |
||
| 961 | * |
||
| 962 | * ``` php |
||
| 963 | * <?php |
||
| 964 | * $form = [ |
||
| 965 | * 'field1' => 'value', |
||
| 966 | * 'field2' => 'another value', |
||
| 967 | * 'checkbox1' => true, |
||
| 968 | * // ... |
||
| 969 | * ]; |
||
| 970 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); |
||
| 971 | * // $I->amOnPage('/path/to/form-page') may be needed |
||
| 972 | * $I->seeInFormFields('//form[@id=my-form]', $form); |
||
| 973 | * ?> |
||
| 974 | * ``` |
||
| 975 | * |
||
| 976 | * @param $formSelector |
||
| 977 | * @param $params |
||
| 978 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields() |
||
| 979 | */ |
||
| 980 | public function seeInFormFields($formSelector, $params) { |
||
| 981 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args())); |
||
| 982 | } |
||
| 983 | |||
| 984 | |||
| 985 | /** |
||
| 986 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 987 | * |
||
| 988 | * Checks if the array of form parameters (name => value) are not set on the form matched with |
||
| 989 | * the passed selector. |
||
| 990 | * |
||
| 991 | * ``` php |
||
| 992 | * <?php |
||
| 993 | * $I->dontSeeInFormFields('form[name=myform]', [ |
||
| 994 | * 'input1' => 'non-existent value', |
||
| 995 | * 'input2' => 'other non-existent value', |
||
| 996 | * ]); |
||
| 997 | * ?> |
||
| 998 | * ``` |
||
| 999 | * |
||
| 1000 | * To check that an element hasn't been assigned any one of many values, an array can be passed |
||
| 1001 | * as the value: |
||
| 1002 | * |
||
| 1003 | * ``` php |
||
| 1004 | * <?php |
||
| 1005 | * $I->dontSeeInFormFields('.form-class', [ |
||
| 1006 | * 'fieldName' => [ |
||
| 1007 | * 'This value shouldn\'t be set', |
||
| 1008 | * 'And this value shouldn\'t be set', |
||
| 1009 | * ], |
||
| 1010 | * ]); |
||
| 1011 | * ?> |
||
| 1012 | * ``` |
||
| 1013 | * |
||
| 1014 | * Additionally, checkbox values can be checked with a boolean. |
||
| 1015 | * |
||
| 1016 | * ``` php |
||
| 1017 | * <?php |
||
| 1018 | * $I->dontSeeInFormFields('#form-id', [ |
||
| 1019 | * 'checkbox1' => true, // fails if checked |
||
| 1020 | * 'checkbox2' => false, // fails if unchecked |
||
| 1021 | * ]); |
||
| 1022 | * ?> |
||
| 1023 | * ``` |
||
| 1024 | * |
||
| 1025 | * @param $formSelector |
||
| 1026 | * @param $params |
||
| 1027 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1028 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() |
||
| 1029 | */ |
||
| 1030 | public function cantSeeInFormFields($formSelector, $params) { |
||
| 1031 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args())); |
||
| 1032 | } |
||
| 1033 | /** |
||
| 1034 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1035 | * |
||
| 1036 | * Checks if the array of form parameters (name => value) are not set on the form matched with |
||
| 1037 | * the passed selector. |
||
| 1038 | * |
||
| 1039 | * ``` php |
||
| 1040 | * <?php |
||
| 1041 | * $I->dontSeeInFormFields('form[name=myform]', [ |
||
| 1042 | * 'input1' => 'non-existent value', |
||
| 1043 | * 'input2' => 'other non-existent value', |
||
| 1044 | * ]); |
||
| 1045 | * ?> |
||
| 1046 | * ``` |
||
| 1047 | * |
||
| 1048 | * To check that an element hasn't been assigned any one of many values, an array can be passed |
||
| 1049 | * as the value: |
||
| 1050 | * |
||
| 1051 | * ``` php |
||
| 1052 | * <?php |
||
| 1053 | * $I->dontSeeInFormFields('.form-class', [ |
||
| 1054 | * 'fieldName' => [ |
||
| 1055 | * 'This value shouldn\'t be set', |
||
| 1056 | * 'And this value shouldn\'t be set', |
||
| 1057 | * ], |
||
| 1058 | * ]); |
||
| 1059 | * ?> |
||
| 1060 | * ``` |
||
| 1061 | * |
||
| 1062 | * Additionally, checkbox values can be checked with a boolean. |
||
| 1063 | * |
||
| 1064 | * ``` php |
||
| 1065 | * <?php |
||
| 1066 | * $I->dontSeeInFormFields('#form-id', [ |
||
| 1067 | * 'checkbox1' => true, // fails if checked |
||
| 1068 | * 'checkbox2' => false, // fails if unchecked |
||
| 1069 | * ]); |
||
| 1070 | * ?> |
||
| 1071 | * ``` |
||
| 1072 | * |
||
| 1073 | * @param $formSelector |
||
| 1074 | * @param $params |
||
| 1075 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() |
||
| 1076 | */ |
||
| 1077 | public function dontSeeInFormFields($formSelector, $params) { |
||
| 1078 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInFormFields', func_get_args())); |
||
| 1079 | } |
||
| 1080 | |||
| 1081 | |||
| 1082 | /** |
||
| 1083 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1084 | * |
||
| 1085 | * Submits the given form on the page, optionally with the given form values. |
||
| 1086 | * Give the form fields values as an array. |
||
| 1087 | * |
||
| 1088 | * Skipped fields will be filled by their values from the page. |
||
| 1089 | * You don't need to click the 'Submit' button afterwards. |
||
| 1090 | * This command itself triggers the request to form's action. |
||
| 1091 | * |
||
| 1092 | * You can optionally specify what button's value to include |
||
| 1093 | * in the request with the last parameter as an alternative to |
||
| 1094 | * explicitly setting its value in the second parameter, as |
||
| 1095 | * button values are not otherwise included in the request. |
||
| 1096 | * |
||
| 1097 | * Examples: |
||
| 1098 | * |
||
| 1099 | * ``` php |
||
| 1100 | * <?php |
||
| 1101 | * $I->submitForm('#login', array('login' => 'davert', 'password' => '123456')); |
||
| 1102 | * // or |
||
| 1103 | * $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'), 'submitButtonName'); |
||
| 1104 | * |
||
| 1105 | * ``` |
||
| 1106 | * |
||
| 1107 | * For example, given this sample "Sign Up" form: |
||
| 1108 | * |
||
| 1109 | * ``` html |
||
| 1110 | * <form action="/sign_up"> |
||
| 1111 | * Login: <input type="text" name="user[login]" /><br/> |
||
| 1112 | * Password: <input type="password" name="user[password]" /><br/> |
||
| 1113 | * Do you agree to out terms? <input type="checkbox" name="user[agree]" /><br/> |
||
| 1114 | * Select pricing plan <select name="plan"><option value="1">Free</option><option value="2" selected="selected">Paid</option></select> |
||
| 1115 | * <input type="submit" name="submitButton" value="Submit" /> |
||
| 1116 | * </form> |
||
| 1117 | * ``` |
||
| 1118 | * |
||
| 1119 | * You could write the following to submit it: |
||
| 1120 | * |
||
| 1121 | * ``` php |
||
| 1122 | * <?php |
||
| 1123 | * $I->submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)), 'submitButton'); |
||
| 1124 | * |
||
| 1125 | * ``` |
||
| 1126 | * Note that "2" will be the submitted value for the "plan" field, as it is the selected option. |
||
| 1127 | * |
||
| 1128 | * You can also emulate a JavaScript submission by not specifying any buttons in the third parameter to submitForm. |
||
| 1129 | * |
||
| 1130 | * ```php |
||
| 1131 | * <?php |
||
| 1132 | * $I->submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true))); |
||
| 1133 | * |
||
| 1134 | * ``` |
||
| 1135 | * |
||
| 1136 | * Pair this with seeInFormFields for quick testing magic. |
||
| 1137 | * |
||
| 1138 | * ``` php |
||
| 1139 | * <?php |
||
| 1140 | * $form = [ |
||
| 1141 | * 'field1' => 'value', |
||
| 1142 | * 'field2' => 'another value', |
||
| 1143 | * 'checkbox1' => true, |
||
| 1144 | * // ... |
||
| 1145 | * ]; |
||
| 1146 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); |
||
| 1147 | * // $I->amOnPage('/path/to/form-page') may be needed |
||
| 1148 | * $I->seeInFormFields('//form[@id=my-form]', $form); |
||
| 1149 | * ?> |
||
| 1150 | * ``` |
||
| 1151 | * |
||
| 1152 | * Parameter values can be set to arrays for multiple input fields |
||
| 1153 | * of the same name, or multi-select combo boxes. For checkboxes, |
||
| 1154 | * either the string value can be used, or boolean values which will |
||
| 1155 | * be replaced by the checkbox's value in the DOM. |
||
| 1156 | * |
||
| 1157 | * ``` php |
||
| 1158 | * <?php |
||
| 1159 | * $I->submitForm('#my-form', [ |
||
| 1160 | * 'field1' => 'value', |
||
| 1161 | * 'checkbox' => [ |
||
| 1162 | * 'value of first checkbox', |
||
| 1163 | * 'value of second checkbox, |
||
| 1164 | * ], |
||
| 1165 | * 'otherCheckboxes' => [ |
||
| 1166 | * true, |
||
| 1167 | * false, |
||
| 1168 | * false |
||
| 1169 | * ], |
||
| 1170 | * 'multiselect' => [ |
||
| 1171 | * 'first option value', |
||
| 1172 | * 'second option value' |
||
| 1173 | * ] |
||
| 1174 | * ]); |
||
| 1175 | * ?> |
||
| 1176 | * ``` |
||
| 1177 | * |
||
| 1178 | * Mixing string and boolean values for a checkbox's value is not |
||
| 1179 | * supported and may produce unexpected results. |
||
| 1180 | * |
||
| 1181 | * @param $selector |
||
| 1182 | * @param $params |
||
| 1183 | * @param $button |
||
| 1184 | * @see \Codeception\Lib\InnerBrowser::submitForm() |
||
| 1185 | */ |
||
| 1186 | public function submitForm($selector, $params, $button = null) { |
||
| 1187 | return $this->scenario->runStep(new \Codeception\Step\Action('submitForm', func_get_args())); |
||
| 1188 | } |
||
| 1189 | |||
| 1190 | |||
| 1191 | /** |
||
| 1192 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1193 | * |
||
| 1194 | * Fills a text field or textarea with the given string. |
||
| 1195 | * |
||
| 1196 | * ``` php |
||
| 1197 | * <?php |
||
| 1198 | * $I->fillField("//input[@type='text']", "Hello World!"); |
||
| 1199 | * $I->fillField(['name' => 'email'], '[email protected]'); |
||
| 1200 | * ?> |
||
| 1201 | * ``` |
||
| 1202 | * |
||
| 1203 | * @param $field |
||
| 1204 | * @param $value |
||
| 1205 | * @see \Codeception\Lib\InnerBrowser::fillField() |
||
| 1206 | */ |
||
| 1207 | public function fillField($field, $value) { |
||
| 1208 | return $this->scenario->runStep(new \Codeception\Step\Action('fillField', func_get_args())); |
||
| 1209 | } |
||
| 1210 | |||
| 1211 | |||
| 1212 | /** |
||
| 1213 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1214 | * |
||
| 1215 | * Selects an option in a select tag or in radio button group. |
||
| 1216 | * |
||
| 1217 | * ``` php |
||
| 1218 | * <?php |
||
| 1219 | * $I->selectOption('form select[name=account]', 'Premium'); |
||
| 1220 | * $I->selectOption('form input[name=payment]', 'Monthly'); |
||
| 1221 | * $I->selectOption('//form/select[@name=account]', 'Monthly'); |
||
| 1222 | * ?> |
||
| 1223 | * ``` |
||
| 1224 | * |
||
| 1225 | * Provide an array for the second argument to select multiple options: |
||
| 1226 | * |
||
| 1227 | * ``` php |
||
| 1228 | * <?php |
||
| 1229 | * $I->selectOption('Which OS do you use?', array('Windows','Linux')); |
||
| 1230 | * ?> |
||
| 1231 | * ``` |
||
| 1232 | * |
||
| 1233 | * @param $select |
||
| 1234 | * @param $option |
||
| 1235 | * @see \Codeception\Lib\InnerBrowser::selectOption() |
||
| 1236 | */ |
||
| 1237 | public function selectOption($select, $option) { |
||
| 1238 | return $this->scenario->runStep(new \Codeception\Step\Action('selectOption', func_get_args())); |
||
| 1239 | } |
||
| 1240 | |||
| 1241 | |||
| 1242 | /** |
||
| 1243 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1244 | * |
||
| 1245 | * Ticks a checkbox. For radio buttons, use the `selectOption` method instead. |
||
| 1246 | * |
||
| 1247 | * ``` php |
||
| 1248 | * <?php |
||
| 1249 | * $I->checkOption('#agree'); |
||
| 1250 | * ?> |
||
| 1251 | * ``` |
||
| 1252 | * |
||
| 1253 | * @param $option |
||
| 1254 | * @see \Codeception\Lib\InnerBrowser::checkOption() |
||
| 1255 | */ |
||
| 1256 | public function checkOption($option) { |
||
| 1257 | return $this->scenario->runStep(new \Codeception\Step\Action('checkOption', func_get_args())); |
||
| 1258 | } |
||
| 1259 | |||
| 1260 | |||
| 1261 | /** |
||
| 1262 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1263 | * |
||
| 1264 | * Unticks a checkbox. |
||
| 1265 | * |
||
| 1266 | * ``` php |
||
| 1267 | * <?php |
||
| 1268 | * $I->uncheckOption('#notify'); |
||
| 1269 | * ?> |
||
| 1270 | * ``` |
||
| 1271 | * |
||
| 1272 | * @param $option |
||
| 1273 | * @see \Codeception\Lib\InnerBrowser::uncheckOption() |
||
| 1274 | */ |
||
| 1275 | public function uncheckOption($option) { |
||
| 1276 | return $this->scenario->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args())); |
||
| 1277 | } |
||
| 1278 | |||
| 1279 | |||
| 1280 | /** |
||
| 1281 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1282 | * |
||
| 1283 | * Attaches a file relative to the Codeception data directory to the given file upload field. |
||
| 1284 | * |
||
| 1285 | * ``` php |
||
| 1286 | * <?php |
||
| 1287 | * // file is stored in 'tests/_data/prices.xls' |
||
| 1288 | * $I->attachFile('input[@type="file"]', 'prices.xls'); |
||
| 1289 | * ?> |
||
| 1290 | * ``` |
||
| 1291 | * |
||
| 1292 | * @param $field |
||
| 1293 | * @param $filename |
||
| 1294 | * @see \Codeception\Lib\InnerBrowser::attachFile() |
||
| 1295 | */ |
||
| 1296 | public function attachFile($field, $filename) { |
||
| 1297 | return $this->scenario->runStep(new \Codeception\Step\Action('attachFile', func_get_args())); |
||
| 1298 | } |
||
| 1299 | |||
| 1300 | |||
| 1301 | /** |
||
| 1302 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1303 | * |
||
| 1304 | * If your page triggers an ajax request, you can perform it manually. |
||
| 1305 | * This action sends a GET ajax request with specified params. |
||
| 1306 | * |
||
| 1307 | * See ->sendAjaxPostRequest for examples. |
||
| 1308 | * |
||
| 1309 | * @param $uri |
||
| 1310 | * @param $params |
||
| 1311 | * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest() |
||
| 1312 | */ |
||
| 1313 | public function sendAjaxGetRequest($uri, $params = null) { |
||
| 1314 | return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args())); |
||
| 1315 | } |
||
| 1316 | |||
| 1317 | |||
| 1318 | /** |
||
| 1319 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1320 | * |
||
| 1321 | * If your page triggers an ajax request, you can perform it manually. |
||
| 1322 | * This action sends a POST ajax request with specified params. |
||
| 1323 | * Additional params can be passed as array. |
||
| 1324 | * |
||
| 1325 | * Example: |
||
| 1326 | * |
||
| 1327 | * Imagine that by clicking checkbox you trigger ajax request which updates user settings. |
||
| 1328 | * We emulate that click by running this ajax request manually. |
||
| 1329 | * |
||
| 1330 | * ``` php |
||
| 1331 | * <?php |
||
| 1332 | * $I->sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST |
||
| 1333 | * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET |
||
| 1334 | * |
||
| 1335 | * ``` |
||
| 1336 | * |
||
| 1337 | * @param $uri |
||
| 1338 | * @param $params |
||
| 1339 | * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest() |
||
| 1340 | */ |
||
| 1341 | public function sendAjaxPostRequest($uri, $params = null) { |
||
| 1342 | return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args())); |
||
| 1343 | } |
||
| 1344 | |||
| 1345 | |||
| 1346 | /** |
||
| 1347 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1348 | * |
||
| 1349 | * If your page triggers an ajax request, you can perform it manually. |
||
| 1350 | * This action sends an ajax request with specified method and params. |
||
| 1351 | * |
||
| 1352 | * Example: |
||
| 1353 | * |
||
| 1354 | * You need to perform an ajax request specifying the HTTP method. |
||
| 1355 | * |
||
| 1356 | * ``` php |
||
| 1357 | * <?php |
||
| 1358 | * $I->sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title')); |
||
| 1359 | * |
||
| 1360 | * ``` |
||
| 1361 | * |
||
| 1362 | * @param $method |
||
| 1363 | * @param $uri |
||
| 1364 | * @param $params |
||
| 1365 | * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest() |
||
| 1366 | */ |
||
| 1367 | public function sendAjaxRequest($method, $uri, $params = null) { |
||
| 1368 | return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args())); |
||
| 1369 | } |
||
| 1370 | |||
| 1371 | |||
| 1372 | /** |
||
| 1373 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1374 | * |
||
| 1375 | * Finds and returns the text contents of the given element. |
||
| 1376 | * If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression. |
||
| 1377 | * |
||
| 1378 | * ``` php |
||
| 1379 | * <?php |
||
| 1380 | * $heading = $I->grabTextFrom('h1'); |
||
| 1381 | * $heading = $I->grabTextFrom('descendant-or-self::h1'); |
||
| 1382 | * $value = $I->grabTextFrom('~<input value=(.*?)]~sgi'); // match with a regex |
||
| 1383 | * ?> |
||
| 1384 | * ``` |
||
| 1385 | * |
||
| 1386 | * @param $cssOrXPathOrRegex |
||
| 1387 | * |
||
| 1388 | * @return mixed |
||
| 1389 | * @see \Codeception\Lib\InnerBrowser::grabTextFrom() |
||
| 1390 | */ |
||
| 1391 | public function grabTextFrom($cssOrXPathOrRegex) { |
||
| 1392 | return $this->scenario->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args())); |
||
| 1393 | } |
||
| 1394 | |||
| 1395 | |||
| 1396 | /** |
||
| 1397 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1398 | * |
||
| 1399 | * Grabs the value of the given attribute value from the given element. |
||
| 1400 | * Fails if element is not found. |
||
| 1401 | * |
||
| 1402 | * ``` php |
||
| 1403 | * <?php |
||
| 1404 | * $I->grabAttributeFrom('#tooltip', 'title'); |
||
| 1405 | * ?> |
||
| 1406 | * ``` |
||
| 1407 | * |
||
| 1408 | * |
||
| 1409 | * @param $cssOrXpath |
||
| 1410 | * @param $attribute |
||
| 1411 | * @internal param $element |
||
| 1412 | * @return mixed |
||
| 1413 | * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom() |
||
| 1414 | */ |
||
| 1415 | public function grabAttributeFrom($cssOrXpath, $attribute) { |
||
| 1416 | return $this->scenario->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args())); |
||
| 1417 | } |
||
| 1418 | |||
| 1419 | |||
| 1420 | /** |
||
| 1421 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1422 | * |
||
| 1423 | * @param $field |
||
| 1424 | * |
||
| 1425 | * @return array|mixed|null|string |
||
| 1426 | * @see \Codeception\Lib\InnerBrowser::grabValueFrom() |
||
| 1427 | */ |
||
| 1428 | public function grabValueFrom($field) { |
||
| 1429 | return $this->scenario->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args())); |
||
| 1430 | } |
||
| 1431 | |||
| 1432 | |||
| 1433 | /** |
||
| 1434 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1435 | * |
||
| 1436 | * Sets a cookie with the given name and value. |
||
| 1437 | * You can set additional cookie params like `domain`, `path`, `expire`, `secure` in array passed as last argument. |
||
| 1438 | * |
||
| 1439 | * ``` php |
||
| 1440 | * <?php |
||
| 1441 | * $I->setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); |
||
| 1442 | * ?> |
||
| 1443 | * ``` |
||
| 1444 | * |
||
| 1445 | * @param $name |
||
| 1446 | * @param $val |
||
| 1447 | * @param array $params |
||
| 1448 | * @internal param $cookie |
||
| 1449 | * @internal param $value |
||
| 1450 | * |
||
| 1451 | * @return mixed |
||
| 1452 | * @see \Codeception\Lib\InnerBrowser::setCookie() |
||
| 1453 | */ |
||
| 1454 | public function setCookie($name, $val, $params = null) { |
||
| 1455 | return $this->scenario->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); |
||
| 1456 | } |
||
| 1457 | |||
| 1458 | |||
| 1459 | /** |
||
| 1460 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1461 | * |
||
| 1462 | * Grabs a cookie value. |
||
| 1463 | * You can set additional cookie params like `domain`, `path` in array passed as last argument. |
||
| 1464 | * |
||
| 1465 | * @param $cookie |
||
| 1466 | * |
||
| 1467 | * @param array $params |
||
| 1468 | * @return mixed |
||
| 1469 | * @see \Codeception\Lib\InnerBrowser::grabCookie() |
||
| 1470 | */ |
||
| 1471 | public function grabCookie($name, $params = null) { |
||
| 1472 | return $this->scenario->runStep(new \Codeception\Step\Action('grabCookie', func_get_args())); |
||
| 1473 | } |
||
| 1474 | |||
| 1475 | |||
| 1476 | /** |
||
| 1477 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1478 | * |
||
| 1479 | * Checks that a cookie with the given name is set. |
||
| 1480 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
||
| 1481 | * |
||
| 1482 | * ``` php |
||
| 1483 | * <?php |
||
| 1484 | * $I->seeCookie('PHPSESSID'); |
||
| 1485 | * ?> |
||
| 1486 | * ``` |
||
| 1487 | * |
||
| 1488 | * @param $cookie |
||
| 1489 | * @param array $params |
||
| 1490 | * @return mixed |
||
| 1491 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1492 | * @see \Codeception\Lib\InnerBrowser::seeCookie() |
||
| 1493 | */ |
||
| 1494 | public function canSeeCookie($name, $params = null) { |
||
| 1495 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); |
||
| 1496 | } |
||
| 1497 | /** |
||
| 1498 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1499 | * |
||
| 1500 | * Checks that a cookie with the given name is set. |
||
| 1501 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
||
| 1502 | * |
||
| 1503 | * ``` php |
||
| 1504 | * <?php |
||
| 1505 | * $I->seeCookie('PHPSESSID'); |
||
| 1506 | * ?> |
||
| 1507 | * ``` |
||
| 1508 | * |
||
| 1509 | * @param $cookie |
||
| 1510 | * @param array $params |
||
| 1511 | * @return mixed |
||
| 1512 | * @see \Codeception\Lib\InnerBrowser::seeCookie() |
||
| 1513 | */ |
||
| 1514 | public function seeCookie($name, $params = null) { |
||
| 1515 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); |
||
| 1516 | } |
||
| 1517 | |||
| 1518 | |||
| 1519 | /** |
||
| 1520 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1521 | * |
||
| 1522 | * Checks that there isn't a cookie with the given name. |
||
| 1523 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
||
| 1524 | * |
||
| 1525 | * @param $cookie |
||
| 1526 | * |
||
| 1527 | * @param array $params |
||
| 1528 | * @return mixed |
||
| 1529 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1530 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() |
||
| 1531 | */ |
||
| 1532 | public function cantSeeCookie($name, $params = null) { |
||
| 1533 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); |
||
| 1534 | } |
||
| 1535 | /** |
||
| 1536 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1537 | * |
||
| 1538 | * Checks that there isn't a cookie with the given name. |
||
| 1539 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. |
||
| 1540 | * |
||
| 1541 | * @param $cookie |
||
| 1542 | * |
||
| 1543 | * @param array $params |
||
| 1544 | * @return mixed |
||
| 1545 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() |
||
| 1546 | */ |
||
| 1547 | public function dontSeeCookie($name, $params = null) { |
||
| 1548 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args())); |
||
| 1549 | } |
||
| 1550 | |||
| 1551 | |||
| 1552 | /** |
||
| 1553 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1554 | * |
||
| 1555 | * Unsets cookie with the given name. |
||
| 1556 | * You can set additional cookie params like `domain`, `path` in array passed as last argument. |
||
| 1557 | * |
||
| 1558 | * @param $cookie |
||
| 1559 | * |
||
| 1560 | * @param array $params |
||
| 1561 | * @return mixed |
||
| 1562 | * @see \Codeception\Lib\InnerBrowser::resetCookie() |
||
| 1563 | */ |
||
| 1564 | public function resetCookie($name, $params = null) { |
||
| 1565 | return $this->scenario->runStep(new \Codeception\Step\Action('resetCookie', func_get_args())); |
||
| 1566 | } |
||
| 1567 | |||
| 1568 | |||
| 1569 | /** |
||
| 1570 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1571 | * |
||
| 1572 | * Checks that the given element exists on the page and is visible. |
||
| 1573 | * You can also specify expected attributes of this element. |
||
| 1574 | * |
||
| 1575 | * ``` php |
||
| 1576 | * <?php |
||
| 1577 | * $I->seeElement('.error'); |
||
| 1578 | * $I->seeElement('//form/input[1]'); |
||
| 1579 | * $I->seeElement('input', ['name' => 'login']); |
||
| 1580 | * $I->seeElement('input', ['value' => '123456']); |
||
| 1581 | * |
||
| 1582 | * // strict locator in first arg, attributes in second |
||
| 1583 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); |
||
| 1584 | * ?> |
||
| 1585 | * ``` |
||
| 1586 | * |
||
| 1587 | * @param $selector |
||
| 1588 | * @param array $attributes |
||
| 1589 | * @return |
||
| 1590 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1591 | * @see \Codeception\Lib\InnerBrowser::seeElement() |
||
| 1592 | */ |
||
| 1593 | public function canSeeElement($selector, $attributes = null) { |
||
| 1594 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); |
||
| 1595 | } |
||
| 1596 | /** |
||
| 1597 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1598 | * |
||
| 1599 | * Checks that the given element exists on the page and is visible. |
||
| 1600 | * You can also specify expected attributes of this element. |
||
| 1601 | * |
||
| 1602 | * ``` php |
||
| 1603 | * <?php |
||
| 1604 | * $I->seeElement('.error'); |
||
| 1605 | * $I->seeElement('//form/input[1]'); |
||
| 1606 | * $I->seeElement('input', ['name' => 'login']); |
||
| 1607 | * $I->seeElement('input', ['value' => '123456']); |
||
| 1608 | * |
||
| 1609 | * // strict locator in first arg, attributes in second |
||
| 1610 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); |
||
| 1611 | * ?> |
||
| 1612 | * ``` |
||
| 1613 | * |
||
| 1614 | * @param $selector |
||
| 1615 | * @param array $attributes |
||
| 1616 | * @return |
||
| 1617 | * @see \Codeception\Lib\InnerBrowser::seeElement() |
||
| 1618 | */ |
||
| 1619 | public function seeElement($selector, $attributes = null) { |
||
| 1620 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); |
||
| 1621 | } |
||
| 1622 | |||
| 1623 | |||
| 1624 | /** |
||
| 1625 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1626 | * |
||
| 1627 | * Checks that the given element is invisible or not present on the page. |
||
| 1628 | * You can also specify expected attributes of this element. |
||
| 1629 | * |
||
| 1630 | * ``` php |
||
| 1631 | * <?php |
||
| 1632 | * $I->dontSeeElement('.error'); |
||
| 1633 | * $I->dontSeeElement('//form/input[1]'); |
||
| 1634 | * $I->dontSeeElement('input', ['name' => 'login']); |
||
| 1635 | * $I->dontSeeElement('input', ['value' => '123456']); |
||
| 1636 | * ?> |
||
| 1637 | * ``` |
||
| 1638 | * |
||
| 1639 | * @param $selector |
||
| 1640 | * @param array $attributes |
||
| 1641 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1642 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() |
||
| 1643 | */ |
||
| 1644 | public function cantSeeElement($selector, $attributes = null) { |
||
| 1645 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); |
||
| 1646 | } |
||
| 1647 | /** |
||
| 1648 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1649 | * |
||
| 1650 | * Checks that the given element is invisible or not present on the page. |
||
| 1651 | * You can also specify expected attributes of this element. |
||
| 1652 | * |
||
| 1653 | * ``` php |
||
| 1654 | * <?php |
||
| 1655 | * $I->dontSeeElement('.error'); |
||
| 1656 | * $I->dontSeeElement('//form/input[1]'); |
||
| 1657 | * $I->dontSeeElement('input', ['name' => 'login']); |
||
| 1658 | * $I->dontSeeElement('input', ['value' => '123456']); |
||
| 1659 | * ?> |
||
| 1660 | * ``` |
||
| 1661 | * |
||
| 1662 | * @param $selector |
||
| 1663 | * @param array $attributes |
||
| 1664 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() |
||
| 1665 | */ |
||
| 1666 | public function dontSeeElement($selector, $attributes = null) { |
||
| 1667 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args())); |
||
| 1668 | } |
||
| 1669 | |||
| 1670 | |||
| 1671 | /** |
||
| 1672 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1673 | * |
||
| 1674 | * Checks that there are a certain number of elements matched by the given locator on the page. |
||
| 1675 | * |
||
| 1676 | * ``` php |
||
| 1677 | * <?php |
||
| 1678 | * $I->seeNumberOfElements('tr', 10); |
||
| 1679 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements |
||
| 1680 | * ?> |
||
| 1681 | * ``` |
||
| 1682 | * @param $selector |
||
| 1683 | * @param mixed $expected: |
||
|
0 ignored issues
–
show
There is no parameter named
$expected:. Did you maybe mean $expected?
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit. Consider the following example. The parameter /**
* @param array $germany
* @param array $ireland
*/
function finale($germany, $island) {
return "2:1";
}
The most likely cause is that the parameter was changed, but the annotation was not. Loading history...
|
|||
| 1684 | * - string: strict number |
||
| 1685 | * - array: range of numbers [0,10] |
||
| 1686 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1687 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() |
||
| 1688 | */ |
||
| 1689 | public function canSeeNumberOfElements($selector, $expected) { |
||
| 1690 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args())); |
||
| 1691 | } |
||
| 1692 | /** |
||
| 1693 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1694 | * |
||
| 1695 | * Checks that there are a certain number of elements matched by the given locator on the page. |
||
| 1696 | * |
||
| 1697 | * ``` php |
||
| 1698 | * <?php |
||
| 1699 | * $I->seeNumberOfElements('tr', 10); |
||
| 1700 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements |
||
| 1701 | * ?> |
||
| 1702 | * ``` |
||
| 1703 | * @param $selector |
||
| 1704 | * @param mixed $expected: |
||
|
0 ignored issues
–
show
There is no parameter named
$expected:. Did you maybe mean $expected?
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit. Consider the following example. The parameter /**
* @param array $germany
* @param array $ireland
*/
function finale($germany, $island) {
return "2:1";
}
The most likely cause is that the parameter was changed, but the annotation was not. Loading history...
|
|||
| 1705 | * - string: strict number |
||
| 1706 | * - array: range of numbers [0,10] |
||
| 1707 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() |
||
| 1708 | */ |
||
| 1709 | public function seeNumberOfElements($selector, $expected) { |
||
| 1710 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args())); |
||
| 1711 | } |
||
| 1712 | |||
| 1713 | |||
| 1714 | /** |
||
| 1715 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1716 | * |
||
| 1717 | * Checks that the given option is selected. |
||
| 1718 | * |
||
| 1719 | * ``` php |
||
| 1720 | * <?php |
||
| 1721 | * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa'); |
||
| 1722 | * ?> |
||
| 1723 | * ``` |
||
| 1724 | * |
||
| 1725 | * @param $selector |
||
| 1726 | * @param $optionText |
||
| 1727 | * |
||
| 1728 | * @return mixed |
||
| 1729 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1730 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() |
||
| 1731 | */ |
||
| 1732 | public function canSeeOptionIsSelected($select, $optionText) { |
||
| 1733 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); |
||
| 1734 | } |
||
| 1735 | /** |
||
| 1736 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1737 | * |
||
| 1738 | * Checks that the given option is selected. |
||
| 1739 | * |
||
| 1740 | * ``` php |
||
| 1741 | * <?php |
||
| 1742 | * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa'); |
||
| 1743 | * ?> |
||
| 1744 | * ``` |
||
| 1745 | * |
||
| 1746 | * @param $selector |
||
| 1747 | * @param $optionText |
||
| 1748 | * |
||
| 1749 | * @return mixed |
||
| 1750 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() |
||
| 1751 | */ |
||
| 1752 | public function seeOptionIsSelected($select, $optionText) { |
||
| 1753 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); |
||
| 1754 | } |
||
| 1755 | |||
| 1756 | |||
| 1757 | /** |
||
| 1758 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1759 | * |
||
| 1760 | * Checks that the given option is not selected. |
||
| 1761 | * |
||
| 1762 | * ``` php |
||
| 1763 | * <?php |
||
| 1764 | * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); |
||
| 1765 | * ?> |
||
| 1766 | * ``` |
||
| 1767 | * |
||
| 1768 | * @param $selector |
||
| 1769 | * @param $optionText |
||
| 1770 | * |
||
| 1771 | * @return mixed |
||
| 1772 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1773 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() |
||
| 1774 | */ |
||
| 1775 | public function cantSeeOptionIsSelected($select, $optionText) { |
||
| 1776 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); |
||
| 1777 | } |
||
| 1778 | /** |
||
| 1779 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1780 | * |
||
| 1781 | * Checks that the given option is not selected. |
||
| 1782 | * |
||
| 1783 | * ``` php |
||
| 1784 | * <?php |
||
| 1785 | * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); |
||
| 1786 | * ?> |
||
| 1787 | * ``` |
||
| 1788 | * |
||
| 1789 | * @param $selector |
||
| 1790 | * @param $optionText |
||
| 1791 | * |
||
| 1792 | * @return mixed |
||
| 1793 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() |
||
| 1794 | */ |
||
| 1795 | public function dontSeeOptionIsSelected($select, $optionText) { |
||
| 1796 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args())); |
||
| 1797 | } |
||
| 1798 | |||
| 1799 | |||
| 1800 | /** |
||
| 1801 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1802 | * |
||
| 1803 | * Asserts that current page has 404 response status code. |
||
| 1804 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1805 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() |
||
| 1806 | */ |
||
| 1807 | public function canSeePageNotFound() { |
||
| 1808 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args())); |
||
| 1809 | } |
||
| 1810 | /** |
||
| 1811 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1812 | * |
||
| 1813 | * Asserts that current page has 404 response status code. |
||
| 1814 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() |
||
| 1815 | */ |
||
| 1816 | public function seePageNotFound() { |
||
| 1817 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args())); |
||
| 1818 | } |
||
| 1819 | |||
| 1820 | |||
| 1821 | /** |
||
| 1822 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1823 | * |
||
| 1824 | * Checks that response code is equal to value provided. |
||
| 1825 | * |
||
| 1826 | * @param $code |
||
| 1827 | * |
||
| 1828 | * @return mixed |
||
| 1829 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1830 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() |
||
| 1831 | */ |
||
| 1832 | public function canSeeResponseCodeIs($code) { |
||
| 1833 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args())); |
||
| 1834 | } |
||
| 1835 | /** |
||
| 1836 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1837 | * |
||
| 1838 | * Checks that response code is equal to value provided. |
||
| 1839 | * |
||
| 1840 | * @param $code |
||
| 1841 | * |
||
| 1842 | * @return mixed |
||
| 1843 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() |
||
| 1844 | */ |
||
| 1845 | public function seeResponseCodeIs($code) { |
||
| 1846 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args())); |
||
| 1847 | } |
||
| 1848 | |||
| 1849 | |||
| 1850 | /** |
||
| 1851 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1852 | * |
||
| 1853 | * Checks that the page title contains the given string. |
||
| 1854 | * |
||
| 1855 | * ``` php |
||
| 1856 | * <?php |
||
| 1857 | * $I->seeInTitle('Blog - Post #1'); |
||
| 1858 | * ?> |
||
| 1859 | * ``` |
||
| 1860 | * |
||
| 1861 | * @param $title |
||
| 1862 | * |
||
| 1863 | * @return mixed |
||
| 1864 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1865 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() |
||
| 1866 | */ |
||
| 1867 | public function canSeeInTitle($title) { |
||
| 1868 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args())); |
||
| 1869 | } |
||
| 1870 | /** |
||
| 1871 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1872 | * |
||
| 1873 | * Checks that the page title contains the given string. |
||
| 1874 | * |
||
| 1875 | * ``` php |
||
| 1876 | * <?php |
||
| 1877 | * $I->seeInTitle('Blog - Post #1'); |
||
| 1878 | * ?> |
||
| 1879 | * ``` |
||
| 1880 | * |
||
| 1881 | * @param $title |
||
| 1882 | * |
||
| 1883 | * @return mixed |
||
| 1884 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() |
||
| 1885 | */ |
||
| 1886 | public function seeInTitle($title) { |
||
| 1887 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args())); |
||
| 1888 | } |
||
| 1889 | |||
| 1890 | |||
| 1891 | /** |
||
| 1892 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1893 | * |
||
| 1894 | * Checks that the page title does not contain the given string. |
||
| 1895 | * |
||
| 1896 | * @param $title |
||
| 1897 | * |
||
| 1898 | * @return mixed |
||
| 1899 | * Conditional Assertion: Test won't be stopped on fail |
||
| 1900 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() |
||
| 1901 | */ |
||
| 1902 | public function cantSeeInTitle($title) { |
||
| 1903 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args())); |
||
| 1904 | } |
||
| 1905 | /** |
||
| 1906 | * [!] Method is generated. Documentation taken from corresponding module. |
||
| 1907 | * |
||
| 1908 | * Checks that the page title does not contain the given string. |
||
| 1909 | * |
||
| 1910 | * @param $title |
||
| 1911 | * |
||
| 1912 | * @return mixed |
||
| 1913 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() |
||
| 1914 | */ |
||
| 1915 | public function dontSeeInTitle($title) { |
||
| 1916 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args())); |
||
| 1917 | } |
||
| 1918 | } |
||
| 1919 |
This check looks for classes that have been defined more than once.
If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.
This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.