TestGuy.php 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222
  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. * If your page triggers an ajax request, you can perform it manually.
  1646. * This action sends an ajax request with specified method and params.
  1647. *
  1648. * Example:
  1649. *
  1650. * You need to perform an ajax request specifying the HTTP method.
  1651. *
  1652. * ``` php
  1653. * <?php
  1654. * $I->sendAjaxRequest('PUT', /posts/7', array('title' => 'new title');
  1655. *
  1656. * ```
  1657. *
  1658. * @param $method
  1659. * @param $uri
  1660. * @param $params
  1661. * @see Codeception\Util\Framework::sendAjaxRequest()
  1662. * @return \Codeception\Maybe
  1663. */
  1664. public function sendAjaxRequest($method, $uri, $params = null) {
  1665. $this->scenario->addStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args()));
  1666. if ($this->scenario->running()) {
  1667. $result = $this->scenario->runStep();
  1668. return new Maybe($result);
  1669. }
  1670. return new Maybe();
  1671. }
  1672. /**
  1673. * This method is generated.
  1674. * Documentation taken from corresponding module.
  1675. * ----------------------------------------------
  1676. *
  1677. * Finds and returns text contents of element.
  1678. * Element is searched by CSS selector, XPath or matcher by regex.
  1679. *
  1680. * Example:
  1681. *
  1682. * ``` php
  1683. * <?php
  1684. * $heading = $I->grabTextFrom('h1');
  1685. * $heading = $I->grabTextFrom('descendant-or-self::h1');
  1686. * $value = $I->grabTextFrom('~<input value=(.*?)]~sgi');
  1687. * ?>
  1688. * ```
  1689. *
  1690. * @param $cssOrXPathOrRegex
  1691. * @return mixed
  1692. * @see Codeception\Util\Framework::grabTextFrom()
  1693. * @return \Codeception\Maybe
  1694. */
  1695. public function grabTextFrom($cssOrXPathOrRegex) {
  1696. $this->scenario->addStep(new \Codeception\Step\Action('grabTextFrom', func_get_args()));
  1697. if ($this->scenario->running()) {
  1698. $result = $this->scenario->runStep();
  1699. return new Maybe($result);
  1700. }
  1701. return new Maybe();
  1702. }
  1703. /**
  1704. * This method is generated.
  1705. * Documentation taken from corresponding module.
  1706. * ----------------------------------------------
  1707. *
  1708. * Finds and returns field and returns it's value.
  1709. * Searches by field name, then by CSS, then by XPath
  1710. *
  1711. * Example:
  1712. *
  1713. * ``` php
  1714. * <?php
  1715. * $name = $I->grabValueFrom('Name');
  1716. * $name = $I->grabValueFrom('input[name=username]');
  1717. * $name = $I->grabValueFrom('descendant-or-self::form/descendant::input[@name = 'username']');
  1718. * ?>
  1719. * ```
  1720. *
  1721. * @param $field
  1722. * @return mixed
  1723. * @see Codeception\Util\Framework::grabValueFrom()
  1724. * @return \Codeception\Maybe
  1725. */
  1726. public function grabValueFrom($field) {
  1727. $this->scenario->addStep(new \Codeception\Step\Action('grabValueFrom', func_get_args()));
  1728. if ($this->scenario->running()) {
  1729. $result = $this->scenario->runStep();
  1730. return new Maybe($result);
  1731. }
  1732. return new Maybe();
  1733. }
  1734. /**
  1735. * This method is generated.
  1736. * Documentation taken from corresponding module.
  1737. * ----------------------------------------------
  1738. *
  1739. * Checks if element exists on a page, matching it by CSS or XPath
  1740. *
  1741. * ``` php
  1742. * <?php
  1743. * $I->seeElement('.error');
  1744. * $I->seeElement('//form/input[1]');
  1745. * ?>
  1746. * ```
  1747. * @param $selector
  1748. * Conditional Assertion: Test won't be stopped on fail
  1749. * @see Codeception\Util\Framework::seeElement()
  1750. * @return \Codeception\Maybe
  1751. */
  1752. public function canSeeElement($selector) {
  1753. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
  1754. if ($this->scenario->running()) {
  1755. $result = $this->scenario->runStep();
  1756. return new Maybe($result);
  1757. }
  1758. return new Maybe();
  1759. }
  1760. /**
  1761. * This method is generated.
  1762. * Documentation taken from corresponding module.
  1763. * ----------------------------------------------
  1764. *
  1765. * Checks if element exists on a page, matching it by CSS or XPath
  1766. *
  1767. * ``` php
  1768. * <?php
  1769. * $I->seeElement('.error');
  1770. * $I->seeElement('//form/input[1]');
  1771. * ?>
  1772. * ```
  1773. * @param $selector
  1774. * @see Codeception\Util\Framework::seeElement()
  1775. * @return \Codeception\Maybe
  1776. */
  1777. public function seeElement($selector) {
  1778. $this->scenario->addStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
  1779. if ($this->scenario->running()) {
  1780. $result = $this->scenario->runStep();
  1781. return new Maybe($result);
  1782. }
  1783. return new Maybe();
  1784. }
  1785. /**
  1786. * This method is generated.
  1787. * Documentation taken from corresponding module.
  1788. * ----------------------------------------------
  1789. *
  1790. * Checks if element does not exist (or is visible) on a page, matching it by CSS or XPath
  1791. *
  1792. * Example:
  1793. *
  1794. * ``` php
  1795. * <?php
  1796. * $I->dontSeeElement('.error');
  1797. * $I->dontSeeElement('//form/input[1]');
  1798. * ?>
  1799. * ```
  1800. * @param $selector
  1801. * Conditional Assertion: Test won't be stopped on fail
  1802. * @see Codeception\Util\Framework::dontSeeElement()
  1803. * @return \Codeception\Maybe
  1804. */
  1805. public function cantSeeElement($selector) {
  1806. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
  1807. if ($this->scenario->running()) {
  1808. $result = $this->scenario->runStep();
  1809. return new Maybe($result);
  1810. }
  1811. return new Maybe();
  1812. }
  1813. /**
  1814. * This method is generated.
  1815. * Documentation taken from corresponding module.
  1816. * ----------------------------------------------
  1817. *
  1818. * Checks if element does not exist (or is visible) on a page, matching it by CSS or XPath
  1819. *
  1820. * Example:
  1821. *
  1822. * ``` php
  1823. * <?php
  1824. * $I->dontSeeElement('.error');
  1825. * $I->dontSeeElement('//form/input[1]');
  1826. * ?>
  1827. * ```
  1828. * @param $selector
  1829. * @see Codeception\Util\Framework::dontSeeElement()
  1830. * @return \Codeception\Maybe
  1831. */
  1832. public function dontSeeElement($selector) {
  1833. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args()));
  1834. if ($this->scenario->running()) {
  1835. $result = $this->scenario->runStep();
  1836. return new Maybe($result);
  1837. }
  1838. return new Maybe();
  1839. }
  1840. /**
  1841. * This method is generated.
  1842. * Documentation taken from corresponding module.
  1843. * ----------------------------------------------
  1844. *
  1845. * Checks if option is selected in select field.
  1846. *
  1847. * ``` php
  1848. * <?php
  1849. * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
  1850. * ?>
  1851. * ```
  1852. *
  1853. * @param $selector
  1854. * @param $optionText
  1855. * @return mixed
  1856. * Conditional Assertion: Test won't be stopped on fail
  1857. * @see Codeception\Util\Framework::seeOptionIsSelected()
  1858. * @return \Codeception\Maybe
  1859. */
  1860. public function canSeeOptionIsSelected($select, $optionText) {
  1861. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args()));
  1862. if ($this->scenario->running()) {
  1863. $result = $this->scenario->runStep();
  1864. return new Maybe($result);
  1865. }
  1866. return new Maybe();
  1867. }
  1868. /**
  1869. * This method is generated.
  1870. * Documentation taken from corresponding module.
  1871. * ----------------------------------------------
  1872. *
  1873. * Checks if option is selected in select field.
  1874. *
  1875. * ``` php
  1876. * <?php
  1877. * $I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
  1878. * ?>
  1879. * ```
  1880. *
  1881. * @param $selector
  1882. * @param $optionText
  1883. * @return mixed
  1884. * @see Codeception\Util\Framework::seeOptionIsSelected()
  1885. * @return \Codeception\Maybe
  1886. */
  1887. public function seeOptionIsSelected($select, $optionText) {
  1888. $this->scenario->addStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args()));
  1889. if ($this->scenario->running()) {
  1890. $result = $this->scenario->runStep();
  1891. return new Maybe($result);
  1892. }
  1893. return new Maybe();
  1894. }
  1895. /**
  1896. * This method is generated.
  1897. * Documentation taken from corresponding module.
  1898. * ----------------------------------------------
  1899. *
  1900. * Checks if option is not selected in select field.
  1901. *
  1902. * ``` php
  1903. * <?php
  1904. * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
  1905. * ?>
  1906. * ```
  1907. *
  1908. * @param $selector
  1909. * @param $optionText
  1910. * @return mixed
  1911. * Conditional Assertion: Test won't be stopped on fail
  1912. * @see Codeception\Util\Framework::dontSeeOptionIsSelected()
  1913. * @return \Codeception\Maybe
  1914. */
  1915. public function cantSeeOptionIsSelected($select, $optionText) {
  1916. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args()));
  1917. if ($this->scenario->running()) {
  1918. $result = $this->scenario->runStep();
  1919. return new Maybe($result);
  1920. }
  1921. return new Maybe();
  1922. }
  1923. /**
  1924. * This method is generated.
  1925. * Documentation taken from corresponding module.
  1926. * ----------------------------------------------
  1927. *
  1928. * Checks if option is not selected in select field.
  1929. *
  1930. * ``` php
  1931. * <?php
  1932. * $I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
  1933. * ?>
  1934. * ```
  1935. *
  1936. * @param $selector
  1937. * @param $optionText
  1938. * @return mixed
  1939. * @see Codeception\Util\Framework::dontSeeOptionIsSelected()
  1940. * @return \Codeception\Maybe
  1941. */
  1942. public function dontSeeOptionIsSelected($select, $optionText) {
  1943. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args()));
  1944. if ($this->scenario->running()) {
  1945. $result = $this->scenario->runStep();
  1946. return new Maybe($result);
  1947. }
  1948. return new Maybe();
  1949. }
  1950. /**
  1951. * This method is generated.
  1952. * Documentation taken from corresponding module.
  1953. * ----------------------------------------------
  1954. *
  1955. * Asserts that current page has 404 response status code.
  1956. * Conditional Assertion: Test won't be stopped on fail
  1957. * @see Codeception\Util\Framework::seePageNotFound()
  1958. * @return \Codeception\Maybe
  1959. */
  1960. public function canSeePageNotFound() {
  1961. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args()));
  1962. if ($this->scenario->running()) {
  1963. $result = $this->scenario->runStep();
  1964. return new Maybe($result);
  1965. }
  1966. return new Maybe();
  1967. }
  1968. /**
  1969. * This method is generated.
  1970. * Documentation taken from corresponding module.
  1971. * ----------------------------------------------
  1972. *
  1973. * Asserts that current page has 404 response status code.
  1974. * @see Codeception\Util\Framework::seePageNotFound()
  1975. * @return \Codeception\Maybe
  1976. */
  1977. public function seePageNotFound() {
  1978. $this->scenario->addStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args()));
  1979. if ($this->scenario->running()) {
  1980. $result = $this->scenario->runStep();
  1981. return new Maybe($result);
  1982. }
  1983. return new Maybe();
  1984. }
  1985. /**
  1986. * This method is generated.
  1987. * Documentation taken from corresponding module.
  1988. * ----------------------------------------------
  1989. *
  1990. * Checks that response code is equal to value provided.
  1991. *
  1992. * @param $code
  1993. * @return mixed
  1994. * Conditional Assertion: Test won't be stopped on fail
  1995. * @see Codeception\Util\Framework::seeResponseCodeIs()
  1996. * @return \Codeception\Maybe
  1997. */
  1998. public function canSeeResponseCodeIs($code) {
  1999. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args()));
  2000. if ($this->scenario->running()) {
  2001. $result = $this->scenario->runStep();
  2002. return new Maybe($result);
  2003. }
  2004. return new Maybe();
  2005. }
  2006. /**
  2007. * This method is generated.
  2008. * Documentation taken from corresponding module.
  2009. * ----------------------------------------------
  2010. *
  2011. * Checks that response code is equal to value provided.
  2012. *
  2013. * @param $code
  2014. * @return mixed
  2015. * @see Codeception\Util\Framework::seeResponseCodeIs()
  2016. * @return \Codeception\Maybe
  2017. */
  2018. public function seeResponseCodeIs($code) {
  2019. $this->scenario->addStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args()));
  2020. if ($this->scenario->running()) {
  2021. $result = $this->scenario->runStep();
  2022. return new Maybe($result);
  2023. }
  2024. return new Maybe();
  2025. }
  2026. /**
  2027. * This method is generated.
  2028. * Documentation taken from corresponding module.
  2029. * ----------------------------------------------
  2030. *
  2031. * Checks that page title contains text.
  2032. *
  2033. * ``` php
  2034. * <?php
  2035. * $I->seeInTitle('Blog - Post #1');
  2036. * ?>
  2037. * ```
  2038. *
  2039. * @param $title
  2040. * @return mixed
  2041. * Conditional Assertion: Test won't be stopped on fail
  2042. * @see Codeception\Util\Framework::seeInTitle()
  2043. * @return \Codeception\Maybe
  2044. */
  2045. public function canSeeInTitle($title) {
  2046. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args()));
  2047. if ($this->scenario->running()) {
  2048. $result = $this->scenario->runStep();
  2049. return new Maybe($result);
  2050. }
  2051. return new Maybe();
  2052. }
  2053. /**
  2054. * This method is generated.
  2055. * Documentation taken from corresponding module.
  2056. * ----------------------------------------------
  2057. *
  2058. * Checks that page title contains text.
  2059. *
  2060. * ``` php
  2061. * <?php
  2062. * $I->seeInTitle('Blog - Post #1');
  2063. * ?>
  2064. * ```
  2065. *
  2066. * @param $title
  2067. * @return mixed
  2068. * @see Codeception\Util\Framework::seeInTitle()
  2069. * @return \Codeception\Maybe
  2070. */
  2071. public function seeInTitle($title) {
  2072. $this->scenario->addStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args()));
  2073. if ($this->scenario->running()) {
  2074. $result = $this->scenario->runStep();
  2075. return new Maybe($result);
  2076. }
  2077. return new Maybe();
  2078. }
  2079. /**
  2080. * This method is generated.
  2081. * Documentation taken from corresponding module.
  2082. * ----------------------------------------------
  2083. *
  2084. * Checks that page title does not contain text.
  2085. *
  2086. * @param $title
  2087. * @return mixed
  2088. * Conditional Assertion: Test won't be stopped on fail
  2089. * @see Codeception\Util\Framework::dontSeeInTitle()
  2090. * @return \Codeception\Maybe
  2091. */
  2092. public function cantSeeInTitle($title) {
  2093. $this->scenario->addStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args()));
  2094. if ($this->scenario->running()) {
  2095. $result = $this->scenario->runStep();
  2096. return new Maybe($result);
  2097. }
  2098. return new Maybe();
  2099. }
  2100. /**
  2101. * This method is generated.
  2102. * Documentation taken from corresponding module.
  2103. * ----------------------------------------------
  2104. *
  2105. * Checks that page title does not contain text.
  2106. *
  2107. * @param $title
  2108. * @return mixed
  2109. * @see Codeception\Util\Framework::dontSeeInTitle()
  2110. * @return \Codeception\Maybe
  2111. */
  2112. public function dontSeeInTitle($title) {
  2113. $this->scenario->addStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
  2114. if ($this->scenario->running()) {
  2115. $result = $this->scenario->runStep();
  2116. return new Maybe($result);
  2117. }
  2118. return new Maybe();
  2119. }
  2120. }