FunctionalTesterActions.php 86 KB

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