2014-10-06 28 views
0

我使用laravel與codeception和硒的行動,我創建了一個新的名爲suite硒,創造了它這個配置文件:Codeception和硒不顯示

class_name: SeleniumTester 
modules: 
    enabled: 
     - SeleniumHelper 
     - WebDriver 
     - Laravel4 
    config: 
     WebDriver: 
      url: 'http://app.dev:8000/' 
      browser: 'firefox' 
      wait: 3 
      capabilities: 
        unexpectedAlertBehaviour: 'accept' 

我的測試:

$I = new SeleniumTester($scenario); 
$I->wantTo('Log in a visitor'); 
$I->am('Visitor'); 
$I->haveAnAccount(); 
$I->amOnPage('/'); 
$I->fillField(LoginPage::$usernameField,LoginPage::$username); 
$I->fillField(LoginPage::$passwordField,LoginPage::$password); 
$I->click(self::$loginButton); 
$I->seeInCurrentUrl('@uset'); 

運行bin/codecept run selenium它打開Firefox約1秒與空白頁它會自動關閉然後。測試在我的控制檯上正確運行,但我無法看到Firefox上的步驟,如果我可以修復它,這將非常好。

可能是什麼問題?我正在使用mac OS X 10.9.5

回答

0

什麼是hasAnAccount()方法?也許這裏有錯誤,腳本無法通過下一步操作。它在SeleniumHelper中嗎?

嘗試在調試模式下啓動codeception(以獲取更多信息)並註釋行hasAnAccount()。

bin/codecept run -d selenium 

HTH

+0

的'haveAnAccount'方法只是爲了創建一個帳戶的幫手,這是沒有問題的,但挖小時的工作時間,我發現,你不能使用'WebServer'和'Laravel4'後模塊在同一時間。當驗收測試正在運行時,現在的大問題是設置合適的環境。 Laravel不會在'testing' env中運行驗收測試 – Fabrizio 2014-10-07 13:55:08