WebGuy.php 64 KB

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