AcceptanceTesterActions.php 73 KB

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