codeception

Codeception API testing response comes back as 'N/A'

雨燕双飞 提交于 2020-01-15 05:42:11
问题 I am writing an API using Laravel and Codeception as my testing framework. I am having trouble getting Codeception to come back with a response code that I can pick up from Codeception as well as a JSON response. I've written a simple test to get a list of users from a GET request. The test is as follows: $I = new ApiGuy($scenario); $I->wantTo("access API methods if I'm authenticated as a User"); $I->sendGET('users'); $I->seeResponseIsJson(); $I->seeResponseCodeIs(200); I can see the results

Why doesn't Codeception's PhpBrowser follow a “Reload” header?

ぃ、小莉子 提交于 2020-01-14 10:08:44
问题 This is happening to me in a real CodeIgniter project in the Ion Auth authentication library, but for the sake of clarity, I have reduced it to it's simplest form. The script: I have this one line script located at http://localhost/~captbaritone/redirect/index.php : <?php header("Refresh:0;url=https://google.com");¬ In my browser, it redirects to Google.com. The Test: To test it I wrote this acceptance test: <?php $I = new WebGuy($scenario); $I->wantTo('Redirect to Google.com'); $I->amOnPage(

Why doesn't Codeception's PhpBrowser follow a “Reload” header?

最后都变了- 提交于 2020-01-14 10:06:45
问题 This is happening to me in a real CodeIgniter project in the Ion Auth authentication library, but for the sake of clarity, I have reduced it to it's simplest form. The script: I have this one line script located at http://localhost/~captbaritone/redirect/index.php : <?php header("Refresh:0;url=https://google.com");¬ In my browser, it redirects to Google.com. The Test: To test it I wrote this acceptance test: <?php $I = new WebGuy($scenario); $I->wantTo('Redirect to Google.com'); $I->amOnPage(

Codeception - closed popup breaks selemium test

99封情书 提交于 2020-01-06 15:18:56
问题 I'm testing a simple flow using Codeception with Selenium/FacebookWebdriver where a popup window gets closed at the end - causing entire test to break. The code is complete (the test will run) and will reproduce the error. I'm really desperate here, any suggestions will be very much appreciated. These are the errors I get: Codeception error message: [Facebook\WebDriver\Exception\NoSuchWindowException] Window not found. The browser window may have been closed. Selenium server output message:

How to use database on Vagrant for testing with Codeception

你。 提交于 2020-01-06 10:42:11
问题 I use Vagrant and Codception, but when i want to test application localy, I must do it on LAMP (or something like that) server. How can I use database on Vagrant? 回答1: All you need is just to setup access to your mysql server that runs on the guest machine (vagrant box) from the host and then to set appropriate database DNS in your codeception.yml config. Here is some general instructions: 1) Allow your vagrant's mysql server listen all interfaces ssh to your box by setting 'bind-address'

How to use database on Vagrant for testing with Codeception

时光毁灭记忆、已成空白 提交于 2020-01-06 10:39:51
问题 I use Vagrant and Codception, but when i want to test application localy, I must do it on LAMP (or something like that) server. How can I use database on Vagrant? 回答1: All you need is just to setup access to your mysql server that runs on the guest machine (vagrant box) from the host and then to set appropriate database DNS in your codeception.yml config. Here is some general instructions: 1) Allow your vagrant's mysql server listen all interfaces ssh to your box by setting 'bind-address'

Debugging with XDebug + PHPStorm force me to always step into

做~自己de王妃 提交于 2020-01-06 03:59:05
问题 I am trying to debug my Codeception tests. My debug platform using PHPStorm + XDebug is working great when using from browser with the right IDE-KEY as cookie. However, when trying to debug codecept using the CLI I encounter the following problem: If I put a breakpoint in my Cest class, behavior is normal. I am able to skip functions and click "Resume" to stop debugging. But whenever I put a breakpoint that is in my code (I.E controllers or my namespace classes), xdebug becomes unusable: If I

Codeception - “ Curl error thrown for http POST to /session with params:”

三世轮回 提交于 2020-01-05 05:32:05
问题 first of all, sorry for my poor english. I have a problem with the test automation. I am a beginner. I have virtual box instance with my app, where is set a standard address with VirtualBox outside (192.168.56.101). I connect netbeans with this instance, and i have project with my app on this. And the last thing - I'm trying to biuld test automation for it. Unfortunately, I have a problem,. Test is created, selenium started, PhantomJs also started. I go to the project folder, "codecept run"

How to change codeception phpbrowser/mink timeout

自古美人都是妖i 提交于 2020-01-02 07:51:19
问题 I'm trying to create test with codeception that will check's the page is properly working in case of high load. Unfortunately if the page is in very very high load and the tests starts I got such error: [..] [Codeception\Exception\ModuleConfig] Codeception\Util\Mink module is not configured! Provided URL can't be accessed by this driver.[curl] 28: Operation timed out after 30031 milliseconds with 0 out of -1 bytes received [url] http://xxxx.xxx/app_db2.php [..] Is there any possibility to set

How in codeception to make rollback a database if the test failed?

六月ゝ 毕业季﹏ 提交于 2019-12-24 19:27:39
问题 I need to test the feature in account. But for this need register an account. If the feature does not work correctly and the test fails, how do I can automatically delete an account from a database (account created during testing)? 回答1: I think you have a few options. You can do clean-up in your Cest class's _before or _after methods (if you use a framework you could use an ORM to delete all accounts for example). Codeception's Db module (see https://codeception.com/docs/modules/Db) also has