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 the Mink timeout to some higher value ?


回答1:


You can set curl options via your test suit configuration just like in example in Codeception docs.

In your case you need CURLOPT_TIMEOUT, see curl_setopt reference

modules: 
    enabled: [PhpBrowser]  
      config:
        PhpBrowser:
          url: 'http://localhost' 
          curl:
            CURLOPT_TIMEOUT: 50000 # timeout in seconds



回答2:


This is related to the following post: Codeception ignores CURLOPT_TIMEOUT

There is a codeception bug that prevents this value from being set. With more recent versions of codeception, >=2.0.15, you can pass CURLOPT_TIMEOUT_MS to accomplish what you are trying to do.



来源:https://stackoverflow.com/questions/22757141/how-to-change-codeception-phpbrowser-mink-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!