2013-06-24 42 views
3

我安裝了vm ubuntu客戶機操作系統。無法在虛擬機中運行代碼隱藏 - 無法找到並加載主機

我的應用程序是從我的主機操作系統的瀏覽器通過URL

http://abc.localhost:8888

運行I型在來賓操作系統終端 PHP codecept.phar運行。

我得到以下錯誤:

[Codeception\Exception\Configuration] 
    Mink could not be found and loaded 

我acceptance.yml說

# Codeception Test Suite Configuration 

# suite for acceptance tests. 
# perform tests in browser using the Selenium-like tools. 
# powered by Mink (http://mink.behat.org). 
# (tip: that's what your customer will see). 
# (tip: test your ajax and javascript by one of Mink drivers). 

# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. 

class_name: WebGuy 
modules: 
    enabled: 
     - PhpBrowser 
     - WebHelper 
     - Mink 
    config: 
     PhpBrowser: 
      url: 'http://abc.localhost:8888' 

我已經有和沒有8888的acceptance.suite.yml嘗試。我犯了同樣的錯誤。

請指教。

警告:我也在https://github.com/Codeception/Codeception/issues/388中交叉張貼了相同的票。如果我從那裏得到答案,會更新這個問題。

回答

3
  1. SSH到客戶虛擬機中。
  2. sudo的納米/ etc/hosts中
  3. 添加以下127.0.0.1 abc.localhost
  4. 確保acceptance.yml是正確的。
# Codeception Test Suite Configuration 

# suite for acceptance tests. 
# perform tests in browser using the Selenium-like tools. 
# powered by Mink (http://mink.behat.org). 
# (tip: that's what your customer will see). 
# (tip: test your ajax and javascript by one of Mink drivers). 

# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. 

class_name: WebGuy 
modules: 
    enabled: 
     - PhpBrowser 
     - WebHelper 
    config: 
     PhpBrowser: 
      url: 'http://abc.localhost' 

然後運行命令php codecept.phar run你的訪客VM中安裝