Question

I am trying to login to my app using WebGuy. I created a Cept file MergeCompaniesCept.php with contents:

$I = new WebGuy($scenario);
$I->wantTo('login into admin, merge companies, & verify data');
$I->amOnPage('/login.php');
$I->fillField("username","name");
$I->fillField("password","xxxxxxxxxxxxxxxxx");
$I->click("LOGIN");

But I get the following error:

[Codeception\Exception\ModuleConfig]                                                     
Codeception\Util\Mink module is not configured!                                          
Provided URL can't be accessed by this driver.

[curl] 77: [url] https://localhost/
[info]

array(                                                                              
    'url' => 'https://localhost/',                                                         
    'content_type' => NULL,                                                                
    'http_code' => 0,                                                                      
    'header_size' => 0,                                                                    
    'request_size' => 0,                                                                   
    'filetime' => -1,                                                                      
    'ssl_verify_result' => 0,                                                              
    'redirect_count' => 0,                                                                 
    'total_time' => 0.002284,                                                              
    'namelookup_time' => 0.00214,                                                          
    'connect_time' => 0.002295,                                                            
    'pretransfer_time' => 0,                                                               
    'size_upload' => 0,                                                                    
    'size_download' => 0,                                                                  
    'speed_download' => 0,                                                                 
    'speed_upload' => 0,                                                                   
    'download_content_length' => -1,                                                       
    'upload_content_length' => -1,                                                         
    'starttransfer_time' => 0,                                                             
    'redirect_time' => 0,                                                                  
    'certinfo' =>                                                                             
),
array (                                                                              
    'primary_ip' => '127.0.0.1',                                                           
    'primary_port' => 443,                                                                 
    'local_ip' => '127.0.0.1',                                                             
    'local_port' => 41951,                                                                 
    'redirect_url' => '',                                                                  
)
[debug]                                                                                



 run [-c|--config[="..."]] [--report] [--html] [--xml] [--tap] [--json] [--colors]     [--silent] [--steps] [--debug] [-cc|--coverage] [--no-exit] [suite] [test]

I thought the issue was related to self signed cert and the use of curl without -k, so I made the following change to WebHelper

<?php
namespace Codeception\Module;

class WebHelper extends \Codeception\Module\PhpBrowser {
    public function _initialize() {
        $client = new \Behat\Mink\Driver\Goutte\Client();
        $driver = new \Behat\Mink\Driver\GoutteDriver($client);
        $client->setClient(new \Guzzle\Http\Client('', array(
            'curl.CURLOPT_SSL_VERIFYPEER' => false,
            'curl.CURLOPT_CERTINFO'       => false
        ))); 
        $this->session = new \Behat\Mink\Session($driver);
        parent::_initialize();
    }
}

However, the same error still persists.

Any help here would be much appreciated!

Update

The following changes finally fixed the issue:

<?php
namespace Codeception\Module;

class WebHelper extends \Codeception\Module\PhpBrowser {
    public function _initialize() {
        $client = new \Behat\Mink\Driver\Goutte\Client();
        $driver = new \Behat\Mink\Driver\GoutteDriver($client);
        $client->setClient(new \Guzzle\Http\Client('', array(
        //'curl.CURLOPT_SSL_VERIFYPEER' => false,
        //'curl.CURLOPT_CERTINFO'       => false
        'ssl.certificate_authority' => false
        ))); 
        $this->session = new \Behat\Mink\Session($driver);
        //parent::_initialize();
    }
}
Était-ce utile?

La solution 2

Use the ssl.certificate_authority option:

$client = new Client($baseUrl, [
    'ssl.certificate_authority' => false,
]);

Autres conseils

Try the following:

capabilities:
              acceptSslCerts: true
              acceptInsecureCerts: true

at acceptance.suite.yml

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top