codeception

Codeception, write acceptance tests with the pageObject design pattern and gherkin

拜拜、爱过 提交于 2019-11-30 16:57:56
I'm looking for a simple example of code with the pageObject design pattern and gherkin because when I follow the codeception BDD documentation , all examples written in the tests/ support/AcceptanceTester.php. I don't understand (poor english skills - -) how not concentrate all code in the AcceptanceTester.php file. By example, I have a sample home page with two buttons A and B. If the user click on the button A, the page A is loaded else if the user click on button B, the page B is loaded. Currently, my AcceptanceTester : <?php // tests/_support/AcceptanceTester.php /** * Inherited Methods *

Printing debug output to console in Codeception

那年仲夏 提交于 2019-11-30 12:40:18
问题 Very thick question, but is there any way to print your own debug messages to the console in Codeception? I mean messages that have nothing to do with assertions, purely for debugging the tests themselves (e.g. like you would var_dump() a variable in any regular PHP website) I have already tried var_dump() , echo and print but to no avail. Using WebDebug 's makeAResponseDump() doesn't produce the required results neither, I just want to be able to see my variable's content without having to

Printing debug output to console in Codeception

青春壹個敷衍的年華 提交于 2019-11-30 02:44:32
Very thick question, but is there any way to print your own debug messages to the console in Codeception? I mean messages that have nothing to do with assertions, purely for debugging the tests themselves (e.g. like you would var_dump() a variable in any regular PHP website) I have already tried var_dump() , echo and print but to no avail. Using WebDebug 's makeAResponseDump() doesn't produce the required results neither, I just want to be able to see my variable's content without having to run a debugger like xdebug . See Debugging which says You may print any information inside a test using

Codeception: Keep a logged in state

六眼飞鱼酱① 提交于 2019-11-29 11:49:22
问题 I want to keep or run the login before most of my tests. But if I try to move the login code to _before it doesn't work since there is no webguy instance available to me. What is the best way to keep the session between multiple tests? This is my code so far, would be glad to receive some help. I have googled and checked the documentation but I cannot find anything about session stuff. <?php use \WebGuy; class ProductCest { private $product_id = '1'; public function _before() { } public

XPath for text after <br/>

為{幸葍}努か 提交于 2019-11-27 07:56:16
问题 Looking to get the XPath of $2.00 with this block: <td class="undefined" colspan="6"> <table class="history-bill-payments" cellspacing="0" cellpadding="0" border="0" align="center" width="99%"> <thead> <tbody> <tr> <td valign="top">04/19/2016</td> <td valign="top" style="text-align:right; height:"> $3.00 <br/> $2.00 </td> I have tried these but to no avail $I->CanSeeElement("//table[contains(tbody/tr[2]/td/table/tbody/tr/td[2]/following-sibling::br)]"); $I->CanSeeElement("//table[contains