TestGuy.php 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188
  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. *
  422. * @see Codeception\Module::getName()
  423. * @return \Codeception\Maybe
  424. */
  425. public function getName() {
  426. $this->scenario->addStep(new \Codeception\Step\Action('getName', func_get_args()));
  427. if ($this->scenario->running()) {
  428. $result = $this->scenario->runStep();
  429. return new Maybe($result);
  430. }
  431. return new Maybe();
  432. }
  433. /**
  434. * This method is generated.
  435. * Documentation taken from corresponding module.
  436. * ----------------------------------------------
  437. *
  438. * Authenticates user for HTTP_AUTH
  439. *
  440. * @param $username
  441. * @param $password
  442. * @see Codeception\Util\Framework::amHttpAuthenticated()
  443. * @return \Codeception\Maybe
  444. */
  445. public function amHttpAuthenticated($username, $password) {
  446. $this->scenario->addStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args()));
  447. if ($this->scenario->running()) {
  448. $result = $this->scenario->runStep();
  449. return new Maybe($result);
  450. }
  451. return new Maybe();
  452. }
  453. /**
  454. * This method is generated.
  455. * Documentation taken from corresponding module.
  456. * ----------------------------------------------
  457. *
  458. * Opens the page.
  459. * Requires relative uri as parameter
  460. *
  461. * Example:
  462. *
  463. * ``` php
  464. * <?php
  465. * // opens front page
  466. * $I->amOnPage('/');
  467. * // opens /register page
  468. * $I->amOnPage('/register');
  469. * ?>
  470. * ```
  471. *
  472. * @param $page
  473. * @see Codeception\Util\Framework::amOnPage()
  474. * @return \Codeception\Maybe
  475. */
  476. public function amOnPage($page) {
  477. $this->scenario->addStep(new \Codeception\Step\Condition('amOnPage', func_get_args()));
  478. if ($this->scenario->running()) {
  479. $result = $this->scenario->runStep();
  480. return new Maybe($result);
  481. }
  482. return new Maybe();
  483. }
  484. /**
  485. * This method is generated.
  486. * Documentation taken from corresponding module.
  487. * ----------------------------------------------
  488. *
  489. * Perform a click on link or button.
  490. * Link or button are found by their names or CSS selector.
  491. * Submits a form if button is a submit type.
  492. *
  493. * If link is an image it's found by alt attribute value of image.
  494. * If button is image button is found by it's value
  495. * If link or button can't be found by name they are searched by CSS selector.
  496. *
  497. * The second parameter is a context: CSS or XPath locator to narrow the search.
  498. *
  499. * Examples:
  500. *
  501. * ``` php
  502. * <?php
  503. * // simple link
  504. * $I->click('Logout');
  505. * // button of form
  506. * $I->click('Submit');
  507. * // CSS button
  508. * $I->click('#form input[type=submit]');
  509. * // XPath
  510. * $I->click('//form/*[@type=submit]')
  511. * // link in context
  512. * $I->click('Logout', '#nav');
  513. * ?>
  514. * ```
  515. * @param $link
  516. * @param $context
  517. * @see Codeception\Util\Framework::click()
  518. * @return \Codeception\Maybe
  519. */
  520. public function click($link, $context = null) {
  521. $this->scenario->addStep(new \Codeception\Step\Action('click', func_get_args()));
  522. if ($this->scenario->running()) {
  523. $result = $this->scenario->runStep();
  524. return new Maybe($result);
  525. }
  526. return new Maybe();
  527. }
  528. /**
  529. * This method is generated.
  530. * Documentation taken from corresponding module.
  531. * ----------------------------------------------
  532. *
  533. * Check if current page contains the text specified.
  534. * Specify the css selector to match only specific region.
  535. *
  536. * Examples:
  537. *
  538. * ``` php
  539. * <?php
  540. * $I->see('Logout'); // I can suppose user is logged in
  541. * $I->see('Sign Up','h1'); // I can suppose it's a signup page
  542. * $I->see('Sign Up','//body/h1'); // with XPath
  543. * ?>
  544. * ```
  545. *
  546. * @param $text
  547. * @param null $selector
  548. * Conditional Assertion: Test won't be stopped on fail
  549. * @see Codeception\Util\Framework::see()
  550. * @return \Codeception\Maybe
  551. */
  552. public function canSee($text, $selector = null) {
  553. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args()));
  554. if ($this->scenario->running()) {
  555. $result = $this->scenario->runStep();
  556. return new Maybe($result);
  557. }
  558. return new Maybe();
  559. }
  560. /**
  561. * This method is generated.
  562. * Documentation taken from corresponding module.
  563. * ----------------------------------------------
  564. *
  565. * Check if current page contains the text specified.
  566. * Specify the css selector to match only specific region.
  567. *
  568. * Examples:
  569. *
  570. * ``` php
  571. * <?php
  572. * $I->see('Logout'); // I can suppose user is logged in
  573. * $I->see('Sign Up','h1'); // I can suppose it's a signup page
  574. * $I->see('Sign Up','//body/h1'); // with XPath
  575. * ?>
  576. * ```
  577. *
  578. * @param $text
  579. * @param null $selector
  580. * @see Codeception\Util\Framework::see()
  581. * @return \Codeception\Maybe
  582. */
  583. public function see($text, $selector = null) {
  584. $this->scenario->addStep(new \Codeception\Step\Assertion('see', func_get_args()));
  585. if ($this->scenario->running()) {
  586. $result = $this->scenario->runStep();
  587. return new Maybe($result);
  588. }
  589. return new Maybe();
  590. }
  591. /**
  592. * This method is generated.
  593. * Documentation taken from corresponding module.
  594. * ----------------------------------------------
  595. *
  596. * Check if current page doesn't contain the text specified.
  597. * Specify the css selector to match only specific region.
  598. *
  599. * Examples:
  600. *
  601. * ```php
  602. * <?php
  603. * $I->dontSee('Login'); // I can suppose user is already logged in
  604. * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
  605. * $I->dontSee('Sign Up','//body/h1'); // with XPath
  606. * ?>
  607. * ```
  608. *
  609. * @param $text
  610. * @param null $selector
  611. * Conditional Assertion: Test won't be stopped on fail
  612. * @see Codeception\Util\Framework::dontSee()
  613. * @return \Codeception\Maybe
  614. */
  615. public function cantSee($text, $selector = null) {
  616. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args()));
  617. if ($this->scenario->running()) {
  618. $result = $this->scenario->runStep();
  619. return new Maybe($result);
  620. }
  621. return new Maybe();
  622. }
  623. /**
  624. * This method is generated.
  625. * Documentation taken from corresponding module.
  626. * ----------------------------------------------
  627. *
  628. * Check if current page doesn't contain the text specified.
  629. * Specify the css selector to match only specific region.
  630. *
  631. * Examples:
  632. *
  633. * ```php
  634. * <?php
  635. * $I->dontSee('Login'); // I can suppose user is already logged in
  636. * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
  637. * $I->dontSee('Sign Up','//body/h1'); // with XPath
  638. * ?>
  639. * ```
  640. *
  641. * @param $text
  642. * @param null $selector
  643. * @see Codeception\Util\Framework::dontSee()
  644. * @return \Codeception\Maybe
  645. */
  646. public function dontSee($text, $selector = null) {
  647. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSee', func_get_args()));
  648. if ($this->scenario->running()) {
  649. $result = $this->scenario->runStep();
  650. return new Maybe($result);
  651. }
  652. return new Maybe();
  653. }
  654. /**
  655. * This method is generated.
  656. * Documentation taken from corresponding module.
  657. * ----------------------------------------------
  658. *
  659. * Checks if there is a link with text specified.
  660. * Specify url to match link with exact this url.
  661. *
  662. * Examples:
  663. *
  664. * ``` php
  665. * <?php
  666. * $I->seeLink('Logout'); // matches <a href="#">Logout</a>
  667. * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
  668. * ?>
  669. * ```
  670. *
  671. * @param $text
  672. * @param null $url
  673. * Conditional Assertion: Test won't be stopped on fail
  674. * @see Codeception\Util\Framework::seeLink()
  675. * @return \Codeception\Maybe
  676. */
  677. public function canSeeLink($text, $url = null) {
  678. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args()));
  679. if ($this->scenario->running()) {
  680. $result = $this->scenario->runStep();
  681. return new Maybe($result);
  682. }
  683. return new Maybe();
  684. }
  685. /**
  686. * This method is generated.
  687. * Documentation taken from corresponding module.
  688. * ----------------------------------------------
  689. *
  690. * Checks if there is a link with text specified.
  691. * Specify url to match link with exact this url.
  692. *
  693. * Examples:
  694. *
  695. * ``` php
  696. * <?php
  697. * $I->seeLink('Logout'); // matches <a href="#">Logout</a>
  698. * $I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
  699. * ?>
  700. * ```
  701. *
  702. * @param $text
  703. * @param null $url
  704. * @see Codeception\Util\Framework::seeLink()
  705. * @return \Codeception\Maybe
  706. */
  707. public function seeLink($text, $url = null) {
  708. $this->scenario->addStep(new \Codeception\Step\Assertion('seeLink', func_get_args()));
  709. if ($this->scenario->running()) {
  710. $result = $this->scenario->runStep();
  711. return new Maybe($result);
  712. }
  713. return new Maybe();
  714. }
  715. /**
  716. * This method is generated.
  717. * Documentation taken from corresponding module.
  718. * ----------------------------------------------
  719. *
  720. * Checks if page doesn't contain the link with text specified.
  721. * Specify url to narrow the results.
  722. *
  723. * Examples:
  724. *
  725. * ``` php
  726. * <?php
  727. * $I->dontSeeLink('Logout'); // I suppose user is not logged in
  728. * ?>
  729. * ```
  730. *
  731. * @param $text
  732. * @param null $url
  733. * Conditional Assertion: Test won't be stopped on fail
  734. * @see Codeception\Util\Framework::dontSeeLink()
  735. * @return \Codeception\Maybe
  736. */
  737. public function cantSeeLink($text, $url = null) {
  738. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args()));
  739. if ($this->scenario->running()) {
  740. $result = $this->scenario->runStep();
  741. return new Maybe($result);
  742. }
  743. return new Maybe();
  744. }
  745. /**
  746. * This method is generated.
  747. * Documentation taken from corresponding module.
  748. * ----------------------------------------------
  749. *
  750. * Checks if page doesn't contain the link with text specified.
  751. * Specify url to narrow the results.
  752. *
  753. * Examples:
  754. *
  755. * ``` php
  756. * <?php
  757. * $I->dontSeeLink('Logout'); // I suppose user is not logged in
  758. * ?>
  759. * ```
  760. *
  761. * @param $text
  762. * @param null $url
  763. * @see Codeception\Util\Framework::dontSeeLink()
  764. * @return \Codeception\Maybe
  765. */
  766. public function dontSeeLink($text, $url = null) {
  767. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args()));
  768. if ($this->scenario->running()) {
  769. $result = $this->scenario->runStep();
  770. return new Maybe($result);
  771. }
  772. return new Maybe();
  773. }
  774. /**
  775. * This method is generated.
  776. * Documentation taken from corresponding module.
  777. * ----------------------------------------------
  778. *
  779. * Checks that current uri contains a value
  780. *
  781. * ``` php
  782. * <?php
  783. * // to match: /home/dashboard
  784. * $I->seeInCurrentUrl('home');
  785. * // to match: /users/1
  786. * $I->seeInCurrentUrl('/users/');
  787. * ?>
  788. * ```
  789. *
  790. * @param $uri
  791. * Conditional Assertion: Test won't be stopped on fail
  792. * @see Codeception\Util\Framework::seeInCurrentUrl()
  793. * @return \Codeception\Maybe
  794. */
  795. public function canSeeInCurrentUrl($uri) {
  796. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args()));
  797. if ($this->scenario->running()) {
  798. $result = $this->scenario->runStep();
  799. return new Maybe($result);
  800. }
  801. return new Maybe();
  802. }
  803. /**
  804. * This method is generated.
  805. * Documentation taken from corresponding module.
  806. * ----------------------------------------------
  807. *
  808. * Checks that current uri contains a value
  809. *
  810. * ``` php
  811. * <?php
  812. * // to match: /home/dashboard
  813. * $I->seeInCurrentUrl('home');
  814. * // to match: /users/1
  815. * $I->seeInCurrentUrl('/users/');
  816. * ?>
  817. * ```
  818. *
  819. * @param $uri
  820. * @see Codeception\Util\Framework::seeInCurrentUrl()
  821. * @return \Codeception\Maybe
  822. */
  823. public function seeInCurrentUrl($uri) {
  824. $this->scenario->addStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args()));
  825. if ($this->scenario->running()) {
  826. $result = $this->scenario->runStep();
  827. return new Maybe($result);
  828. }
  829. return new Maybe();
  830. }
  831. /**
  832. * This method is generated.
  833. * Documentation taken from corresponding module.
  834. * ----------------------------------------------
  835. *
  836. * Checks that current uri does not contain a value
  837. *
  838. * ``` php
  839. * <?php
  840. * $I->dontSeeInCurrentUrl('/users/');
  841. * ?>
  842. * ```
  843. *
  844. * @param $uri
  845. * Conditional Assertion: Test won't be stopped on fail
  846. * @see Codeception\Util\Framework::dontSeeInCurrentUrl()
  847. * @return \Codeception\Maybe
  848. */
  849. public function cantSeeInCurrentUrl($uri) {
  850. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args()));
  851. if ($this->scenario->running()) {
  852. $result = $this->scenario->runStep();
  853. return new Maybe($result);
  854. }
  855. return new Maybe();
  856. }
  857. /**
  858. * This method is generated.
  859. * Documentation taken from corresponding module.
  860. * ----------------------------------------------
  861. *
  862. * Checks that current uri does not contain a value
  863. *
  864. * ``` php
  865. * <?php
  866. * $I->dontSeeInCurrentUrl('/users/');
  867. * ?>
  868. * ```
  869. *
  870. * @param $uri
  871. * @see Codeception\Util\Framework::dontSeeInCurrentUrl()
  872. * @return \Codeception\Maybe
  873. */
  874. public function dontSeeInCurrentUrl($uri) {
  875. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args()));
  876. if ($this->scenario->running()) {
  877. $result = $this->scenario->runStep();
  878. return new Maybe($result);
  879. }
  880. return new Maybe();
  881. }
  882. /**
  883. * This method is generated.
  884. * Documentation taken from corresponding module.
  885. * ----------------------------------------------
  886. *
  887. * Checks that current url is equal to value.
  888. * Unlike `seeInCurrentUrl` performs a strict check.
  889. *
  890. * ``` php
  891. * <?php
  892. * // to match root url
  893. * $I->seeCurrentUrlEquals('/');
  894. * ?>
  895. * ```
  896. *
  897. * @param $uri
  898. * Conditional Assertion: Test won't be stopped on fail
  899. * @see Codeception\Util\Framework::seeCurrentUrlEquals()
  900. * @return \Codeception\Maybe
  901. */
  902. public function canSeeCurrentUrlEquals($uri) {
  903. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args()));
  904. if ($this->scenario->running()) {
  905. $result = $this->scenario->runStep();
  906. return new Maybe($result);
  907. }
  908. return new Maybe();
  909. }
  910. /**
  911. * This method is generated.
  912. * Documentation taken from corresponding module.
  913. * ----------------------------------------------
  914. *
  915. * Checks that current url is equal to value.
  916. * Unlike `seeInCurrentUrl` performs a strict check.
  917. *
  918. * ``` php
  919. * <?php
  920. * // to match root url
  921. * $I->seeCurrentUrlEquals('/');
  922. * ?>
  923. * ```
  924. *
  925. * @param $uri
  926. * @see Codeception\Util\Framework::seeCurrentUrlEquals()
  927. * @return \Codeception\Maybe
  928. */
  929. public function seeCurrentUrlEquals($uri) {
  930. $this->scenario->addStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args()));
  931. if ($this->scenario->running()) {
  932. $result = $this->scenario->runStep();
  933. return new Maybe($result);
  934. }
  935. return new Maybe();
  936. }
  937. /**
  938. * This method is generated.
  939. * Documentation taken from corresponding module.
  940. * ----------------------------------------------
  941. *
  942. * Checks that current url is not equal to value.
  943. * Unlike `dontSeeInCurrentUrl` performs a strict check.
  944. *
  945. * ``` php
  946. * <?php
  947. * // current url is not root
  948. * $I->dontSeeCurrentUrlEquals('/');
  949. * ?>
  950. * ```
  951. *
  952. * @param $uri
  953. * Conditional Assertion: Test won't be stopped on fail
  954. * @see Codeception\Util\Framework::dontSeeCurrentUrlEquals()
  955. * @return \Codeception\Maybe
  956. */
  957. public function cantSeeCurrentUrlEquals($uri) {
  958. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args()));
  959. if ($this->scenario->running()) {
  960. $result = $this->scenario->runStep();
  961. return new Maybe($result);
  962. }
  963. return new Maybe();
  964. }
  965. /**
  966. * This method is generated.
  967. * Documentation taken from corresponding module.
  968. * ----------------------------------------------
  969. *
  970. * Checks that current url is not equal to value.
  971. * Unlike `dontSeeInCurrentUrl` performs a strict check.
  972. *
  973. * ``` php
  974. * <?php
  975. * // current url is not root
  976. * $I->dontSeeCurrentUrlEquals('/');
  977. * ?>
  978. * ```
  979. *
  980. * @param $uri
  981. * @see Codeception\Util\Framework::dontSeeCurrentUrlEquals()
  982. * @return \Codeception\Maybe
  983. */
  984. public function dontSeeCurrentUrlEquals($uri) {
  985. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args()));
  986. if ($this->scenario->running()) {
  987. $result = $this->scenario->runStep();
  988. return new Maybe($result);
  989. }
  990. return new Maybe();
  991. }
  992. /**
  993. * This method is generated.
  994. * Documentation taken from corresponding module.
  995. * ----------------------------------------------
  996. *
  997. * Checks that current url is matches a RegEx value
  998. *
  999. * ``` php
  1000. * <?php
  1001. * // to match root url
  1002. * $I->seeCurrentUrlMatches('~$/users/(\d+)~');
  1003. * ?>
  1004. * ```
  1005. *
  1006. * @param $uri
  1007. * Conditional Assertion: Test won't be stopped on fail
  1008. * @see Codeception\Util\Framework::seeCurrentUrlMatches()
  1009. * @return \Codeception\Maybe
  1010. */
  1011. public function canSeeCurrentUrlMatches($uri) {
  1012. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args()));
  1013. if ($this->scenario->running()) {
  1014. $result = $this->scenario->runStep();
  1015. return new Maybe($result);
  1016. }
  1017. return new Maybe();
  1018. }
  1019. /**
  1020. * This method is generated.
  1021. * Documentation taken from corresponding module.
  1022. * ----------------------------------------------
  1023. *
  1024. * Checks that current url is matches a RegEx value
  1025. *
  1026. * ``` php
  1027. * <?php
  1028. * // to match root url
  1029. * $I->seeCurrentUrlMatches('~$/users/(\d+)~');
  1030. * ?>
  1031. * ```
  1032. *
  1033. * @param $uri
  1034. * @see Codeception\Util\Framework::seeCurrentUrlMatches()
  1035. * @return \Codeception\Maybe
  1036. */
  1037. public function seeCurrentUrlMatches($uri) {
  1038. $this->scenario->addStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args()));
  1039. if ($this->scenario->running()) {
  1040. $result = $this->scenario->runStep();
  1041. return new Maybe($result);
  1042. }
  1043. return new Maybe();
  1044. }
  1045. /**
  1046. * This method is generated.
  1047. * Documentation taken from corresponding module.
  1048. * ----------------------------------------------
  1049. *
  1050. * Checks that current url does not match a RegEx value
  1051. *
  1052. * ``` php
  1053. * <?php
  1054. * // to match root url
  1055. * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~');
  1056. * ?>
  1057. * ```
  1058. *
  1059. * @param $uri
  1060. * Conditional Assertion: Test won't be stopped on fail
  1061. * @see Codeception\Util\Framework::dontSeeCurrentUrlMatches()
  1062. * @return \Codeception\Maybe
  1063. */
  1064. public function cantSeeCurrentUrlMatches($uri) {
  1065. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args()));
  1066. if ($this->scenario->running()) {
  1067. $result = $this->scenario->runStep();
  1068. return new Maybe($result);
  1069. }
  1070. return new Maybe();
  1071. }
  1072. /**
  1073. * This method is generated.
  1074. * Documentation taken from corresponding module.
  1075. * ----------------------------------------------
  1076. *
  1077. * Checks that current url does not match a RegEx value
  1078. *
  1079. * ``` php
  1080. * <?php
  1081. * // to match root url
  1082. * $I->dontSeeCurrentUrlMatches('~$/users/(\d+)~');
  1083. * ?>
  1084. * ```
  1085. *
  1086. * @param $uri
  1087. * @see Codeception\Util\Framework::dontSeeCurrentUrlMatches()
  1088. * @return \Codeception\Maybe
  1089. */
  1090. public function dontSeeCurrentUrlMatches($uri) {
  1091. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args()));
  1092. if ($this->scenario->running()) {
  1093. $result = $this->scenario->runStep();
  1094. return new Maybe($result);
  1095. }
  1096. return new Maybe();
  1097. }
  1098. /**
  1099. * This method is generated.
  1100. * Documentation taken from corresponding module.
  1101. * ----------------------------------------------
  1102. *
  1103. * Takes a parameters from current URI by RegEx.
  1104. * If no url provided returns full URI.
  1105. *
  1106. * ``` php
  1107. * <?php
  1108. * $user_id = $I->grabFromCurrentUrl('~$/user/(\d+)/~');
  1109. * $uri = $I->grabFromCurrentUrl();
  1110. * ?>
  1111. * ```
  1112. *
  1113. * @param null $uri
  1114. * @internal param $url
  1115. * @return mixed
  1116. * @see Codeception\Util\Framework::grabFromCurrentUrl()
  1117. * @return \Codeception\Maybe
  1118. */
  1119. public function grabFromCurrentUrl($uri = null) {
  1120. $this->scenario->addStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args()));
  1121. if ($this->scenario->running()) {
  1122. $result = $this->scenario->runStep();
  1123. return new Maybe($result);
  1124. }
  1125. return new Maybe();
  1126. }
  1127. /**
  1128. * This method is generated.
  1129. * Documentation taken from corresponding module.
  1130. * ----------------------------------------------
  1131. *
  1132. * Assert if the specified checkbox is checked.
  1133. * Use css selector or xpath to match.
  1134. *
  1135. * Example:
  1136. *
  1137. * ``` php
  1138. * <?php
  1139. * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
  1140. * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
  1141. * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
  1142. * ?>
  1143. * ```
  1144. *
  1145. * @param $checkbox
  1146. * Conditional Assertion: Test won't be stopped on fail
  1147. * @see Codeception\Util\Framework::seeCheckboxIsChecked()
  1148. * @return \Codeception\Maybe
  1149. */
  1150. public function canSeeCheckboxIsChecked($checkbox) {
  1151. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args()));
  1152. if ($this->scenario->running()) {
  1153. $result = $this->scenario->runStep();
  1154. return new Maybe($result);
  1155. }
  1156. return new Maybe();
  1157. }
  1158. /**
  1159. * This method is generated.
  1160. * Documentation taken from corresponding module.
  1161. * ----------------------------------------------
  1162. *
  1163. * Assert if the specified checkbox is checked.
  1164. * Use css selector or xpath to match.
  1165. *
  1166. * Example:
  1167. *
  1168. * ``` php
  1169. * <?php
  1170. * $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
  1171. * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
  1172. * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
  1173. * ?>
  1174. * ```
  1175. *
  1176. * @param $checkbox
  1177. * @see Codeception\Util\Framework::seeCheckboxIsChecked()
  1178. * @return \Codeception\Maybe
  1179. */
  1180. public function seeCheckboxIsChecked($checkbox) {
  1181. $this->scenario->addStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args()));
  1182. if ($this->scenario->running()) {
  1183. $result = $this->scenario->runStep();
  1184. return new Maybe($result);
  1185. }
  1186. return new Maybe();
  1187. }
  1188. /**
  1189. * This method is generated.
  1190. * Documentation taken from corresponding module.
  1191. * ----------------------------------------------
  1192. *
  1193. * Assert if the specified checkbox is unchecked.
  1194. * Use css selector or xpath to match.
  1195. *
  1196. * Example:
  1197. *
  1198. * ``` php
  1199. * <?php
  1200. * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
  1201. * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
  1202. * ?>
  1203. * ```
  1204. *
  1205. * @param $checkbox
  1206. * Conditional Assertion: Test won't be stopped on fail
  1207. * @see Codeception\Util\Framework::dontSeeCheckboxIsChecked()
  1208. * @return \Codeception\Maybe
  1209. */
  1210. public function cantSeeCheckboxIsChecked($checkbox) {
  1211. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args()));
  1212. if ($this->scenario->running()) {
  1213. $result = $this->scenario->runStep();
  1214. return new Maybe($result);
  1215. }
  1216. return new Maybe();
  1217. }
  1218. /**
  1219. * This method is generated.
  1220. * Documentation taken from corresponding module.
  1221. * ----------------------------------------------
  1222. *
  1223. * Assert if the specified checkbox is unchecked.
  1224. * Use css selector or xpath to match.
  1225. *
  1226. * Example:
  1227. *
  1228. * ``` php
  1229. * <?php
  1230. * $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
  1231. * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
  1232. * ?>
  1233. * ```
  1234. *
  1235. * @param $checkbox
  1236. * @see Codeception\Util\Framework::dontSeeCheckboxIsChecked()
  1237. * @return \Codeception\Maybe
  1238. */
  1239. public function dontSeeCheckboxIsChecked($checkbox) {
  1240. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args()));
  1241. if ($this->scenario->running()) {
  1242. $result = $this->scenario->runStep();
  1243. return new Maybe($result);
  1244. }
  1245. return new Maybe();
  1246. }
  1247. /**
  1248. * This method is generated.
  1249. * Documentation taken from corresponding module.
  1250. * ----------------------------------------------
  1251. *
  1252. * Checks that an input field or textarea contains value.
  1253. * Field is matched either by label or CSS or Xpath
  1254. *
  1255. * Example:
  1256. *
  1257. * ``` php
  1258. * <?php
  1259. * $I->seeInField('Body','Type your comment here');
  1260. * $I->seeInField('form textarea[name=body]','Type your comment here');
  1261. * $I->seeInField('form input[type=hidden]','hidden_value');
  1262. * $I->seeInField('#searchform input','Search');
  1263. * $I->seeInField('//form/*[@name=search]','Search');
  1264. * ?>
  1265. * ```
  1266. *
  1267. * @param $field
  1268. * @param $value
  1269. * Conditional Assertion: Test won't be stopped on fail
  1270. * @see Codeception\Util\Framework::seeInField()
  1271. * @return \Codeception\Maybe
  1272. */
  1273. public function canSeeInField($field, $value) {
  1274. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args()));
  1275. if ($this->scenario->running()) {
  1276. $result = $this->scenario->runStep();
  1277. return new Maybe($result);
  1278. }
  1279. return new Maybe();
  1280. }
  1281. /**
  1282. * This method is generated.
  1283. * Documentation taken from corresponding module.
  1284. * ----------------------------------------------
  1285. *
  1286. * Checks that an input field or textarea contains value.
  1287. * Field is matched either by label or CSS or Xpath
  1288. *
  1289. * Example:
  1290. *
  1291. * ``` php
  1292. * <?php
  1293. * $I->seeInField('Body','Type your comment here');
  1294. * $I->seeInField('form textarea[name=body]','Type your comment here');
  1295. * $I->seeInField('form input[type=hidden]','hidden_value');
  1296. * $I->seeInField('#searchform input','Search');
  1297. * $I->seeInField('//form/*[@name=search]','Search');
  1298. * ?>
  1299. * ```
  1300. *
  1301. * @param $field
  1302. * @param $value
  1303. * @see Codeception\Util\Framework::seeInField()
  1304. * @return \Codeception\Maybe
  1305. */
  1306. public function seeInField($field, $value) {
  1307. $this->scenario->addStep(new \Codeception\Step\Assertion('seeInField', func_get_args()));
  1308. if ($this->scenario->running()) {
  1309. $result = $this->scenario->runStep();
  1310. return new Maybe($result);
  1311. }
  1312. return new Maybe();
  1313. }
  1314. /**
  1315. * This method is generated.
  1316. * Documentation taken from corresponding module.
  1317. * ----------------------------------------------
  1318. *
  1319. * Checks that an input field or textarea doesn't contain value.
  1320. * Field is matched either by label or CSS or Xpath
  1321. * Example:
  1322. *
  1323. * ``` php
  1324. * <?php
  1325. * $I->dontSeeInField('Body','Type your comment here');
  1326. * $I->dontSeeInField('form textarea[name=body]','Type your comment here');
  1327. * $I->dontSeeInField('form input[type=hidden]','hidden_value');
  1328. * $I->dontSeeInField('#searchform input','Search');
  1329. * $I->dontSeeInField('//form/*[@name=search]','Search');
  1330. * ?>
  1331. * ```
  1332. *
  1333. * @param $field
  1334. * @param $value
  1335. * Conditional Assertion: Test won't be stopped on fail
  1336. * @see Codeception\Util\Framework::dontSeeInField()
  1337. * @return \Codeception\Maybe
  1338. */
  1339. public function cantSeeInField($field, $value) {
  1340. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args()));
  1341. if ($this->scenario->running()) {
  1342. $result = $this->scenario->runStep();
  1343. return new Maybe($result);
  1344. }
  1345. return new Maybe();
  1346. }
  1347. /**
  1348. * This method is generated.
  1349. * Documentation taken from corresponding module.
  1350. * ----------------------------------------------
  1351. *
  1352. * Checks that an input field or textarea doesn't contain value.
  1353. * Field is matched either by label or CSS or Xpath
  1354. * Example:
  1355. *
  1356. * ``` php
  1357. * <?php
  1358. * $I->dontSeeInField('Body','Type your comment here');
  1359. * $I->dontSeeInField('form textarea[name=body]','Type your comment here');
  1360. * $I->dontSeeInField('form input[type=hidden]','hidden_value');
  1361. * $I->dontSeeInField('#searchform input','Search');
  1362. * $I->dontSeeInField('//form/*[@name=search]','Search');
  1363. * ?>
  1364. * ```
  1365. *
  1366. * @param $field
  1367. * @param $value
  1368. * @see Codeception\Util\Framework::dontSeeInField()
  1369. * @return \Codeception\Maybe
  1370. */
  1371. public function dontSeeInField($field, $value) {
  1372. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args()));
  1373. if ($this->scenario->running()) {
  1374. $result = $this->scenario->runStep();
  1375. return new Maybe($result);
  1376. }
  1377. return new Maybe();
  1378. }
  1379. /**
  1380. * This method is generated.
  1381. * Documentation taken from corresponding module.
  1382. * ----------------------------------------------
  1383. *
  1384. * Submits a form located on page.
  1385. * Specify the form by it's css or xpath selector.
  1386. * Fill the form fields values as array.
  1387. *
  1388. * Skipped fields will be filled by their values from page.
  1389. * You don't need to click the 'Submit' button afterwards.
  1390. * This command itself triggers the request to form's action.
  1391. *
  1392. * Examples:
  1393. *
  1394. * ``` php
  1395. * <?php
  1396. * $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'));
  1397. *
  1398. * ```
  1399. *
  1400. * For sample Sign Up form:
  1401. *
  1402. * ``` html
  1403. * <form action="/sign_up">
  1404. * Login: <input type="text" name="user[login]" /><br/>
  1405. * Password: <input type="password" name="user[password]" /><br/>
  1406. * Do you agree to out terms? <input type="checkbox" name="user[agree]" /><br/>
  1407. * Select pricing plan <select name="plan"><option value="1">Free</option><option value="2" selected="selected">Paid</option></select>
  1408. * <input type="submit" value="Submit" />
  1409. * </form>
  1410. * ```
  1411. * I can write this:
  1412. *
  1413. * ``` php
  1414. * <?php
  1415. * $I->submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)));
  1416. *
  1417. * ```
  1418. * Note, that pricing plan will be set to Paid, as it's selected on page.
  1419. *
  1420. * @param $selector
  1421. * @param $params
  1422. * @see Codeception\Util\Framework::submitForm()
  1423. * @return \Codeception\Maybe
  1424. */
  1425. public function submitForm($selector, $params) {
  1426. $this->scenario->addStep(new \Codeception\Step\Action('submitForm', func_get_args()));
  1427. if ($this->scenario->running()) {
  1428. $result = $this->scenario->runStep();
  1429. return new Maybe($result);
  1430. }
  1431. return new Maybe();
  1432. }
  1433. /**
  1434. * This method is generated.
  1435. * Documentation taken from corresponding module.
  1436. * ----------------------------------------------
  1437. *
  1438. * Fills a text field or textarea with value.
  1439. *
  1440. * Example:
  1441. *
  1442. * ``` php
  1443. * <?php
  1444. * $I->fillField("//input[@type='text']", "Hello World!");
  1445. * ?>
  1446. * ```
  1447. *
  1448. * @param $field
  1449. * @param $value
  1450. * @see Codeception\Util\Framework::fillField()
  1451. * @return \Codeception\Maybe
  1452. */
  1453. public function fillField($field, $value) {
  1454. $this->scenario->addStep(new \Codeception\Step\Action('fillField', func_get_args()));
  1455. if ($this->scenario->running()) {
  1456. $result = $this->scenario->runStep();
  1457. return new Maybe($result);
  1458. }
  1459. return new Maybe();
  1460. }
  1461. /**
  1462. * This method is generated.
  1463. * Documentation taken from corresponding module.
  1464. * ----------------------------------------------
  1465. *
  1466. * Selects an option in select tag or in radio button group.
  1467. *
  1468. * Example:
  1469. *
  1470. * ``` php
  1471. * <?php
  1472. * $I->selectOption('form select[name=account]', 'Premium');
  1473. * $I->selectOption('form input[name=payment]', 'Monthly');
  1474. * $I->selectOption('//form/select[@name=account]', 'Monthly');
  1475. * ?>
  1476. * ```
  1477. *
  1478. * Can select multiple options if second argument is array:
  1479. *
  1480. * ``` php
  1481. * <?php
  1482. * $I->selectOption('Which OS do you use?', array('Windows','Linux'));
  1483. * ?>
  1484. * ```
  1485. *
  1486. * @param $select
  1487. * @param $option
  1488. * @see Codeception\Util\Framework::selectOption()
  1489. * @return \Codeception\Maybe
  1490. */
  1491. public function selectOption($select, $option) {
  1492. $this->scenario->addStep(new \Codeception\Step\Action('selectOption', func_get_args()));
  1493. if ($this->scenario->running()) {
  1494. $result = $this->scenario->runStep();
  1495. return new Maybe($result);
  1496. }
  1497. return new Maybe();
  1498. }
  1499. /**
  1500. * This method is generated.
  1501. * Documentation taken from corresponding module.
  1502. * ----------------------------------------------
  1503. *
  1504. * Ticks a checkbox.
  1505. * For radio buttons use `selectOption` method.
  1506. *
  1507. * Example:
  1508. *
  1509. * ``` php
  1510. * <?php
  1511. * $I->checkOption('#agree');
  1512. * ?>
  1513. * ```
  1514. *
  1515. * @param $option
  1516. * @see Codeception\Util\Framework::checkOption()
  1517. * @return \Codeception\Maybe
  1518. */
  1519. public function checkOption($option) {
  1520. $this->scenario->addStep(new \Codeception\Step\Action('checkOption', func_get_args()));
  1521. if ($this->scenario->running()) {
  1522. $result = $this->scenario->runStep();
  1523. return new Maybe($result);
  1524. }
  1525. return new Maybe();
  1526. }
  1527. /**
  1528. * This method is generated.
  1529. * Documentation taken from corresponding module.
  1530. * ----------------------------------------------
  1531. *
  1532. * Unticks a checkbox.
  1533. *
  1534. * Example:
  1535. *
  1536. * ``` php
  1537. * <?php
  1538. * $I->uncheckOption('#notify');
  1539. * ?>
  1540. * ```
  1541. *
  1542. * @param $option
  1543. * @see Codeception\Util\Framework::uncheckOption()
  1544. * @return \Codeception\Maybe
  1545. */
  1546. public function uncheckOption($option) {
  1547. $this->scenario->addStep(new \Codeception\Step\Action('uncheckOption', func_get_args()));
  1548. if ($this->scenario->running()) {
  1549. $result = $this->scenario->runStep();
  1550. return new Maybe($result);
  1551. }
  1552. return new Maybe();
  1553. }
  1554. /**
  1555. * This method is generated.
  1556. * Documentation taken from corresponding module.
  1557. * ----------------------------------------------
  1558. *
  1559. * Attaches file from Codeception data directory to upload field.
  1560. *
  1561. * Example:
  1562. *
  1563. * ``` php
  1564. * <?php
  1565. * // file is stored in 'tests/_data/prices.xls'
  1566. * $I->attachFile('input[@type="file"]', 'prices.xls');
  1567. * ?>
  1568. * ```
  1569. *
  1570. * @param $field
  1571. * @param $filename
  1572. * @see Codeception\Util\Framework::attachFile()
  1573. * @return \Codeception\Maybe
  1574. */
  1575. public function attachFile($field, $filename) {
  1576. $this->scenario->addStep(new \Codeception\Step\Action('attachFile', func_get_args()));
  1577. if ($this->scenario->running()) {
  1578. $result = $this->scenario->runStep();
  1579. return new Maybe($result);
  1580. }
  1581. return new Maybe();
  1582. }
  1583. /**
  1584. * This method is generated.
  1585. * Documentation taken from corresponding module.
  1586. * ----------------------------------------------
  1587. *
  1588. * If your page triggers an ajax request, you can perform it manually.
  1589. * This action sends a GET ajax request with specified params.
  1590. *
  1591. * See ->sendAjaxPostRequest for examples.
  1592. *
  1593. * @param $uri
  1594. * @param $params
  1595. * @see Codeception\Util\Framework::sendAjaxGetRequest()
  1596. * @return \Codeception\Maybe
  1597. */
  1598. public function sendAjaxGetRequest($uri, $params = null) {
  1599. $this->scenario->addStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args()));
  1600. if ($this->scenario->running()) {
  1601. $result = $this->scenario->runStep();
  1602. return new Maybe($result);
  1603. }
  1604. return new Maybe();
  1605. }
  1606. /**
  1607. * This method is generated.
  1608. * Documentation taken from corresponding module.
  1609. * ----------------------------------------------
  1610. *
  1611. * If your page triggers an ajax request, you can perform it manually.
  1612. * This action sends a POST ajax request with specified params.
  1613. * Additional params can be passed as array.
  1614. *
  1615. * Example:
  1616. *
  1617. * Imagine that by clicking checkbox you trigger ajax request which updates user settings.
  1618. * We emulate that click by running this ajax request manually.
  1619. *
  1620. * ``` php
  1621. * <?php
  1622. * $I->sendAjaxPostRequest('/updateSettings', array('notifications' => true); // POST
  1623. * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true); // GET
  1624. *
  1625. * ```
  1626. *
  1627. * @param $uri
  1628. * @param $params
  1629. * @see Codeception\Util\Framework::sendAjaxPostRequest()
  1630. * @return \Codeception\Maybe
  1631. */
  1632. public function sendAjaxPostRequest($uri, $params = null) {
  1633. $this->scenario->addStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args()));
  1634. if ($this->scenario->running()) {
  1635. $result = $this->scenario->runStep();
  1636. return new Maybe($result);
  1637. }
  1638. return new Maybe();
  1639. }
  1640. /**
  1641. * This method is generated.
  1642. * Documentation taken from corresponding module.
  1643. * ----------------------------------------------
  1644. *
  1645. * Finds and returns text contents of element.
  1646. * Element is searched by CSS selector, XPath or matcher by regex.
  1647. *
  1648. * Example:
  1649. *
  1650. * ``` php
  1651. * <?php
  1652. * $heading = $I->grabTextFrom('h1');
  1653. * $heading = $I->grabTextFrom('descendant-or-self::h1');
  1654. * $value = $I->grabTextFrom('~<input value=(.*?)]~sgi');
  1655. * ?>
  1656. * ```
  1657. *
  1658. * @param $cssOrXPathOrRegex
  1659. * @return mixed
  1660. * @see Codeception\Util\Framework::grabTextFrom()
  1661. * @return \Codeception\Maybe
  1662. */
  1663. public function grabTextFrom($cssOrXPathOrRegex) {
  1664. $this->scenario->addStep(new \Codeception\Step\Action('grabTextFrom', func_get_args()));
  1665. if ($this->scenario->running()) {
  1666. $result = $this->scenario->runStep();
  1667. return new Maybe($result);
  1668. }
  1669. return new Maybe();
  1670. }
  1671. /**
  1672. * This method is generated.
  1673. * Documentation taken from corresponding module.
  1674. * ----------------------------------------------
  1675. *
  1676. * Finds and returns field and returns it's value.
  1677. * Searches by field name, then by CSS, then by XPath
  1678. *
  1679. * Example:
  1680. *
  1681. * ``` php
  1682. * <?php
  1683. * $name = $I->grabValueFrom('Name');
  1684. * $name = $I->grabValueFrom('input[name=username]');
  1685. * $name = $I->grabValueFrom('descendant-or-self::form/descendant::input[@name = 'username']');
  1686. * ?>
  1687. * ```
  1688. *
  1689. * @param $field
  1690. * @return mixed
  1691. * @see Codeception\Util\Framework::grabValueFrom()
  1692. * @return \Codeception\Maybe
  1693. */
  1694. public function grabValueFrom($field) {
  1695. $this->scenario->addStep(new \Codeception\Step\Action('grabValueFrom', func_get_args()));
  1696. if ($this->scenario->running()) {
  1697. $result = $this->scenario->runStep();
  1698. return new Maybe($result);
  1699. }
  1700. return new Maybe();
  1701. }
  1702. /**
  1703. * This method is generated.
  1704. * Documentation taken from corresponding module.
  1705. * ----------------------------------------------
  1706. *
  1707. * Checks if element exists on a page, matching it by CSS or XPath
  1708. *
  1709. * ``` php
  1710. * <?php
  1711. * $I->seeElement('.error');
  1712. * $I->seeElement('//form/input[1]');
  1713. * ?>
  1714. * ```
  1715. * @param $selector
  1716. * Conditional Assertion: Test won't be stopped on fail
  1717. * @see Codeception\Util\Framework::seeElement()
  1718. * @return \Codeception\Maybe
  1719. */
  1720. public function canSeeElement($selector) {
  1721. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
  1722. if ($this->scenario->running()) {
  1723. $result = $this->scenario->runStep();
  1724. return new Maybe($result);
  1725. }
  1726. return new Maybe();
  1727. }
  1728. /**
  1729. * This method is generated.
  1730. * Documentation taken from corresponding module.
  1731. * ----------------------------------------------
  1732. *
  1733. * Checks if element exists on a page, matching it by CSS or XPath
  1734. *
  1735. * ``` php
  1736. * <?php
  1737. * $I->seeElement('.error');
  1738. * $I->seeElement('//form/input[1]');
  1739. * ?>
  1740. * ```
  1741. * @param $selector
  1742. * @see Codeception\Util\Framework::seeElement()
  1743. * @return \Codeception\Maybe
  1744. */
  1745. public function seeElement($selector) {
  1746. $this->scenario->addStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
  1747. if ($this->scenario->running()) {
  1748. $result = $this->scenario->runStep();
  1749. return new Maybe($result);
  1750. }
  1751. return new Maybe();
  1752. }
  1753. /**
  1754. * This method is generated.
  1755. * Documentation taken from corresponding module.
  1756. * ----------------------------------------------
  1757. *
  1758. * Checks if element does not exist (or is visible) on a page, matching it by CSS or XPath
  1759. *
  1760. * Example:
  1761. *
  1762. * ``` php
  1763. * <?php
  1764. * $I->dontSeeElement('.error');
  1765. * $I->dontSeeElement('//form/input[1]');
  1766. * ?>
  1767. * ```
  1768. * @param $selector
  1769. * Conditional Assertion: Test won't be stopped on fail
  1770. * @see Codeception\Util\Framework::dontSeeElement()
  1771. * @return \Codeception\Maybe
  1772. */
  1773. public function cantSeeElement($selector) {
  1774. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
  1775. if ($this->scenario->running()) {
  1776. $result = $this->scenario->runStep();
  1777. return new Maybe($result);
  1778. }
  1779. return new Maybe();
  1780. }
  1781. /**
  1782. * This method is generated.
  1783. * Documentation taken from corresponding module.
  1784. * ----------------------------------------------
  1785. *
  1786. * Checks if element does not exist (or is visible) on a page, matching it by CSS or XPath
  1787. *
  1788. * Example:
  1789. *
  1790. * ``` php
  1791. * <?php
  1792. * $I->dontSeeElement('.error');
  1793. * $I->dontSeeElement('//form/input[1]');
  1794. * ?>
  1795. * ```
  1796. * @param $selector
  1797. * @see Codeception\Util\Framework::dontSeeElement()
  1798. * @return \Codeception\Maybe
  1799. */
  1800. public function dontSeeElement($selector) {
  1801. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args()));
  1802. if ($this->scenario->running()) {
  1803. $result = $this->scenario->runStep();
  1804. return new Maybe($result);
  1805. }
  1806. return new Maybe();
  1807. }
  1808. /**
  1809. * This method is generated.
  1810. * Documentation taken from corresponding module.
  1811. * ----------------------------------------------
  1812. *
  1813. * Checks if option is selected in select field.
  1814. *
  1815. * ``` php
  1816. * <?php
  1817. * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
  1818. * ?>
  1819. * ```
  1820. *
  1821. * @param $selector
  1822. * @param $optionText
  1823. * @return mixed
  1824. * Conditional Assertion: Test won't be stopped on fail
  1825. * @see Codeception\Util\Framework::seeOptionIsSelected()
  1826. * @return \Codeception\Maybe
  1827. */
  1828. public function canSeeOptionIsSelected($select, $optionText) {
  1829. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args()));
  1830. if ($this->scenario->running()) {
  1831. $result = $this->scenario->runStep();
  1832. return new Maybe($result);
  1833. }
  1834. return new Maybe();
  1835. }
  1836. /**
  1837. * This method is generated.
  1838. * Documentation taken from corresponding module.
  1839. * ----------------------------------------------
  1840. *
  1841. * Checks if option is selected in select field.
  1842. *
  1843. * ``` php
  1844. * <?php
  1845. * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
  1846. * ?>
  1847. * ```
  1848. *
  1849. * @param $selector
  1850. * @param $optionText
  1851. * @return mixed
  1852. * @see Codeception\Util\Framework::seeOptionIsSelected()
  1853. * @return \Codeception\Maybe
  1854. */
  1855. public function seeOptionIsSelected($select, $optionText) {
  1856. $this->scenario->addStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args()));
  1857. if ($this->scenario->running()) {
  1858. $result = $this->scenario->runStep();
  1859. return new Maybe($result);
  1860. }
  1861. return new Maybe();
  1862. }
  1863. /**
  1864. * This method is generated.
  1865. * Documentation taken from corresponding module.
  1866. * ----------------------------------------------
  1867. *
  1868. * Checks if option is not selected in select field.
  1869. *
  1870. * ``` php
  1871. * <?php
  1872. * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
  1873. * ?>
  1874. * ```
  1875. *
  1876. * @param $selector
  1877. * @param $optionText
  1878. * @return mixed
  1879. * Conditional Assertion: Test won't be stopped on fail
  1880. * @see Codeception\Util\Framework::dontSeeOptionIsSelected()
  1881. * @return \Codeception\Maybe
  1882. */
  1883. public function cantSeeOptionIsSelected($select, $optionText) {
  1884. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args()));
  1885. if ($this->scenario->running()) {
  1886. $result = $this->scenario->runStep();
  1887. return new Maybe($result);
  1888. }
  1889. return new Maybe();
  1890. }
  1891. /**
  1892. * This method is generated.
  1893. * Documentation taken from corresponding module.
  1894. * ----------------------------------------------
  1895. *
  1896. * Checks if option is not selected in select field.
  1897. *
  1898. * ``` php
  1899. * <?php
  1900. * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
  1901. * ?>
  1902. * ```
  1903. *
  1904. * @param $selector
  1905. * @param $optionText
  1906. * @return mixed
  1907. * @see Codeception\Util\Framework::dontSeeOptionIsSelected()
  1908. * @return \Codeception\Maybe
  1909. */
  1910. public function dontSeeOptionIsSelected($select, $optionText) {
  1911. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args()));
  1912. if ($this->scenario->running()) {
  1913. $result = $this->scenario->runStep();
  1914. return new Maybe($result);
  1915. }
  1916. return new Maybe();
  1917. }
  1918. /**
  1919. * This method is generated.
  1920. * Documentation taken from corresponding module.
  1921. * ----------------------------------------------
  1922. *
  1923. * Asserts that current page has 404 response status code.
  1924. * Conditional Assertion: Test won't be stopped on fail
  1925. * @see Codeception\Util\Framework::seePageNotFound()
  1926. * @return \Codeception\Maybe
  1927. */
  1928. public function canSeePageNotFound() {
  1929. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('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. * Asserts that current page has 404 response status code.
  1942. * @see Codeception\Util\Framework::seePageNotFound()
  1943. * @return \Codeception\Maybe
  1944. */
  1945. public function seePageNotFound() {
  1946. $this->scenario->addStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args()));
  1947. if ($this->scenario->running()) {
  1948. $result = $this->scenario->runStep();
  1949. return new Maybe($result);
  1950. }
  1951. return new Maybe();
  1952. }
  1953. /**
  1954. * This method is generated.
  1955. * Documentation taken from corresponding module.
  1956. * ----------------------------------------------
  1957. *
  1958. * Checks that response code is equal to value provided.
  1959. *
  1960. * @param $code
  1961. * @return mixed
  1962. * Conditional Assertion: Test won't be stopped on fail
  1963. * @see Codeception\Util\Framework::seeResponseCodeIs()
  1964. * @return \Codeception\Maybe
  1965. */
  1966. public function canSeeResponseCodeIs($code) {
  1967. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args()));
  1968. if ($this->scenario->running()) {
  1969. $result = $this->scenario->runStep();
  1970. return new Maybe($result);
  1971. }
  1972. return new Maybe();
  1973. }
  1974. /**
  1975. * This method is generated.
  1976. * Documentation taken from corresponding module.
  1977. * ----------------------------------------------
  1978. *
  1979. * Checks that response code is equal to value provided.
  1980. *
  1981. * @param $code
  1982. * @return mixed
  1983. * @see Codeception\Util\Framework::seeResponseCodeIs()
  1984. * @return \Codeception\Maybe
  1985. */
  1986. public function seeResponseCodeIs($code) {
  1987. $this->scenario->addStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args()));
  1988. if ($this->scenario->running()) {
  1989. $result = $this->scenario->runStep();
  1990. return new Maybe($result);
  1991. }
  1992. return new Maybe();
  1993. }
  1994. /**
  1995. * This method is generated.
  1996. * Documentation taken from corresponding module.
  1997. * ----------------------------------------------
  1998. *
  1999. * Checks that page title contains text.
  2000. *
  2001. * ``` php
  2002. * <?php
  2003. * $I->seeInTitle('Blog - Post #1');
  2004. * ?>
  2005. * ```
  2006. *
  2007. * @param $title
  2008. * @return mixed
  2009. * Conditional Assertion: Test won't be stopped on fail
  2010. * @see Codeception\Util\Framework::seeInTitle()
  2011. * @return \Codeception\Maybe
  2012. */
  2013. public function canSeeInTitle($title) {
  2014. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args()));
  2015. if ($this->scenario->running()) {
  2016. $result = $this->scenario->runStep();
  2017. return new Maybe($result);
  2018. }
  2019. return new Maybe();
  2020. }
  2021. /**
  2022. * This method is generated.
  2023. * Documentation taken from corresponding module.
  2024. * ----------------------------------------------
  2025. *
  2026. * Checks that page title contains text.
  2027. *
  2028. * ``` php
  2029. * <?php
  2030. * $I->seeInTitle('Blog - Post #1');
  2031. * ?>
  2032. * ```
  2033. *
  2034. * @param $title
  2035. * @return mixed
  2036. * @see Codeception\Util\Framework::seeInTitle()
  2037. * @return \Codeception\Maybe
  2038. */
  2039. public function seeInTitle($title) {
  2040. $this->scenario->addStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args()));
  2041. if ($this->scenario->running()) {
  2042. $result = $this->scenario->runStep();
  2043. return new Maybe($result);
  2044. }
  2045. return new Maybe();
  2046. }
  2047. /**
  2048. * This method is generated.
  2049. * Documentation taken from corresponding module.
  2050. * ----------------------------------------------
  2051. *
  2052. * Checks that page title does not contain text.
  2053. *
  2054. * @param $title
  2055. * @return mixed
  2056. * Conditional Assertion: Test won't be stopped on fail
  2057. * @see Codeception\Util\Framework::dontSeeInTitle()
  2058. * @return \Codeception\Maybe
  2059. */
  2060. public function cantSeeInTitle($title) {
  2061. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args()));
  2062. if ($this->scenario->running()) {
  2063. $result = $this->scenario->runStep();
  2064. return new Maybe($result);
  2065. }
  2066. return new Maybe();
  2067. }
  2068. /**
  2069. * This method is generated.
  2070. * Documentation taken from corresponding module.
  2071. * ----------------------------------------------
  2072. *
  2073. * Checks that page title does not contain text.
  2074. *
  2075. * @param $title
  2076. * @return mixed
  2077. * @see Codeception\Util\Framework::dontSeeInTitle()
  2078. * @return \Codeception\Maybe
  2079. */
  2080. public function dontSeeInTitle($title) {
  2081. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
  2082. if ($this->scenario->running()) {
  2083. $result = $this->scenario->runStep();
  2084. return new Maybe($result);
  2085. }
  2086. return new Maybe();
  2087. }
  2088. }