无法在虚拟机中运行代码 - 无法找到并加载

时间:2013-06-24 09:37:09

标签: php virtual-machine acceptance-testing mink codeception

我安装了一个vm ubuntu来宾操作系统。

我的应用程序正在我的主机操作系统中的浏览器中运行

http://abc.localhost:8888

我输入 php codecept.phar在客户操作系统终端中运行。

我收到以下错误:

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

我的接受.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'

我在acceptance.suite.yml中尝试过使用和不使用8888。我得到了同样的错误。

请告知。

警告:我还在https://github.com/Codeception/Codeception/issues/388中交叉发布了同一张票。如果我从那里得到答案,我会更新这个问题。

1 个答案:

答案 0 :(得分:4)

  1. SSH进入来宾VM。
  2. sudo nano / etc / hosts
  3. 添加以下127.0.0.1 abc.localhost
  4. 确保acceptance.yml是正确的。
  5. # 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'
    

    然后在guest虚拟机vm

    中运行命令php codecept.phar run