TestGuy.php 66 KB

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