EPESI BIM • Business Information Manager • Cloud CRM/ERP http://epe.si/
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

2253 рядки
73 KiB

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