2016-02-20 46 views
0

我有一个带有letsencrypt ssl证书的网站。当我对它进行代码验收测试时,测试停止,直到按下ctrl + z。当我对一个非SSL站点运行相同的测试时,没有问题。针对自签名SSL网站运行代码验收测试

这是我在accept.suite.yml中的设置。该phantomjs.cli.args paramater是从该网站:http://szdredd.blogspot.de/2013/10/codeception-phantomjs-setup-for.html

class_name: AcceptanceTester 
modules: 
    enabled: [WebDriver] 
    config: 
     WebDriver: 
      url: https://www.domain.de/ 
      browser: phantomjs 

我的硒日志看起来是这样的:

17:07:15.681 INFO - Executing: [new session: Capabilities [{browserName=phantomjs}]]) 
17:07:15.682 INFO - Creating a new session for Capabilities [{browserName=phantomjs}] 
17:07:15.682 INFO - executable: /usr/bin/phantomjs 
17:07:15.683 INFO - port: 27757 
17:07:15.683 INFO - arguments: [--webdriver=27757, --webdriver-logfile=/phantomjsdriver.log] 
17:07:15.683 INFO - environment: {} 
PhantomJS is launching GhostDriver... 
[INFO - 2016-02-20T17:07:15.754Z] GhostDriver - Main - running on port 27757 
[INFO - 2016-02-20T17:07:15.765Z] Session [64316920-d7f4-11e5-a0c5-8954be0ea076] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"} 
[INFO - 2016-02-20T17:07:15.765Z] Session [64316920-d7f4-11e5-a0c5-8954be0ea076] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.0","driverName":"ghostdriver","driverVersion":"1.0.3","platform":"linux-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}} 
[INFO - 2016-02-20T17:07:15.765Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 64316920-d7f4-11e5-a0c5-8954be0ea076 
17:07:15.771 INFO - Done: [new session: Capabilities [{browserName=phantomjs}]] 
17:07:15.774 INFO - Executing: [implicitly wait: 0]) 
17:07:15.777 INFO - Done: [implicitly wait: 0] 
17:07:15.790 INFO - Executing: [get: https://www.waldhelden.de/]) 
[INFO - 2016-02-20T17:07:33.916Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW 
[INFO - 2016-02-20T17:08:55.442Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW 

[INFO - 2016-02-20T17:09:02.008Z] SessionManagerReqHand - _cleanupWindowlessSessions - 异步会话清理阶段开始NOW 17:09:13.204 INFO - 会话7c5ef02c-9361-49c8-894d-234989179189由于客户端超时而被删除 [INFO - 2016-02-20T17:09:13.211Z] ShutdownReqHand - _handle - 即将关机

我发现在这一侧的提醒,但是当我再补充一点的配置我的错误:

capabilities: 
    phantomjs.cli.args: ['--ignore-ssl-errors=true'] 

Caused by: org.openqa.selenium.WebDriverException: The best matching driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver can't create a new driver instance for Capabilities [{phantomjs.cli.args=[--ignore-ssl-errors=true], browserName=phantom}] 

谁知道如何设置codeception忽略SSL错误?任何帮助感谢!

感谢 乌

回答

0

为了测试我的地盘我用Phantoman自动运行并关闭phantomJS。在codeception.yml我有:

config: 
    Codeception\Extension\Phantoman: 
     path: 'vendor/bin/phantomjs' 
     port: 4444 
     debug: true 
     ignoreSslErrors: true 
     sslProtocol: any 
    Codeception\Extension\Recorder: 
     delete_successful: true