2016-10-10 16 views
0

我有一個Symfony2項目,但我無法正確配置WebDriver。 我已經安裝了Facebook的webdriver的和codeception與作曲家:Codeception autoload:'WebDriver'未定義

的Facebook/webdriver的: 版本:1.1.3 *

codeception/codeception: 版本:2.2.5 *

我跟着這些指示(當自動加載失敗,許多其他來源沒有成功): http://codeception.com/11-20-2013/webdriver-tests-with-codeception.html

codeception.yml在項目根:

actor: Tester 
paths: 
    tests: tests 
    log: tests/_output 
    data: tests/_data 
    support: tests/_support 
    envs: tests/_envs 
settings: 
    bootstrap: _bootstrap.php 
    colors: true 
    memory_limit: 1024M 
extensions: 
    enabled: 
     - Codeception\Extension\RunFailed 
     - WebDriver 
    config: 
     WebDriver: 
      url: 'http://localhost/' 
      browser: firefox 
      port: 4444 
modules: 
    config: 
     Db: 
      dsn: '' 
      user: '' 
      password: '' 
      dump: tests/_data/dump.sql 

我有產生驗收測試,並且當我運行codeception,發生以下錯誤:

[Codeception\Exception\ConfigurationException] 
Class `WebDriver` is not defined. Autoload it or include into '_bootstrap.php' file of 'tests' directory 

我已經嘗試添加到這個測試/ _bootstrap.php:上述 require_once __DIR__.'/../vendor/codeception/codeception/src/Codeception/Module/WebDriver.php';

路徑是正確的,PHP文件被發現,但問題仍然存在。 究竟應該如何自動加載或自舉?

編輯: 我使WebDriver啓用和配置到tests/acceptance.suite.yml而不是根文件夾codeception.yml中,並解決了問題。

仍然不清楚爲什麼會發生這種情況?

+0

難道你'codeception.yml'配置後的webdriver運行'供應商/斌/ codecept build'命令? – BVengerov

回答