Webception icon indicating copy to clipboard operation
Webception copied to clipboard

Codeception\Util\Mink module is not configured

Open dstankovd opened this issue 9 years ago • 7 comments

Hey, I've run into the following problem...

Codeception\Util\Mink module is not configured!
Provided URL can't be accessed by this driver.[curl] 6: Could not resolve host: localhost [url] http://localhost/admin/api/

I can open it just fine through the browser and postman. This is my acceptance.suite.yml

class_name: WebGuy
modules:
    enabled:
        - PhpBrowser
        - WebHelper
        - REST
    config:
        REST:
            url: 'http://localhost/admin/api/'
            timeout: 90
        PhpBrowser:
            url: 'http://localhost/admin/api/'

And the test is as follows:

$I = new WebGuy($scenario);
$I->wantTo('Login');
$I->sendPOST('pages/login', [
        'username' => 'admin',
        'password' => 'admin'
    ]
);($I);
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContains('"success": true');

I'm using Windows. Any help is appreciated!

dstankovd avatar Mar 12 '15 12:03 dstankovd

any chance you have php-curl installed?

elchesco avatar Mar 12 '15 16:03 elchesco

Yes, it is installed and running.

dstankovd avatar Mar 12 '15 17:03 dstankovd

that usually happens when codeception can't see/connect to the host. sounds more like a configuration issue with your environment or maybe codeception. you can read more here:

https://github.com/Codeception/Codeception/issues/533 https://github.com/Codeception/Codeception/issues/320 https://github.com/Codeception/Codeception/issues/412 https://github.com/Codeception/Codeception/issues/1036

elchesco avatar Mar 13 '15 16:03 elchesco

Thank you but unfortunately non of these helps :( The thing is I cant even run the default tests that come with webception. Tried several times with fresh installs of webception but still no luck... Here is what I do:

  1. Install webception with composer
  2. Change php to php path in composer.bat After this I try to run the default tests but they all fail with the same error:
Codeception\Util\Mink module is not configured!
Provided URL can't be accessed by this driver.[curl] 6: Could not resolve host: ...

Am I doing something wrong?

By the way I can run custom codeception tests of my admin system without any problems.

dstankovd avatar Mar 16 '15 09:03 dstankovd

are you running this through a VM? or installed it through something like XAMPP? does it make a difference pointing to 127.0.0.1 instead of localhost, have you verified your virtual hosts config?

elchesco avatar Mar 17 '15 16:03 elchesco

I've tried both WAMP and XAMPP, without any luck. If I use 127.0.0.1 instead of localhost it can't connect at all, getting connection timeout.

dstankovd avatar Mar 17 '15 18:03 dstankovd

I found this to be a problem with trying to run older tests with the v2.x version of codeception.

I use the codeception executable out of my testing directory, and if I were to run the example tests that ship with Webception, I receive the same error: image

The newer version of codeception does not have behat/mink as a dependency.

elliotboney avatar Apr 13 '15 03:04 elliotboney