FunctionalTesterActions.php 105 KB

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