我安装了一个 vm ubuntu guest 操作系统。
我的应用程序在我的主机操作系统中的浏览器中运行在 url 上
我打字 php codecept.phar 在 guest 操作系统终端中运行。
我收到以下错误:
[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'
我已经尝试过在 acceptance.suite.yml 中使用和不使用 8888。我得到了同样的错误。
请指教。
警告:我还在 https://github.com/Codeception/Codeception/issues/388 中交叉发布了同一张票.如果我从那里得到答案,我会更新这个问题。
最佳答案
- 通过 SSH 连接到 guest VM。
- sudo nano/etc/hosts
- 加入以下
127.0.0.1 abc.localhost
- 确保 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
关于php - 无法在虚拟机中运行 codeception - 无法找到和加载 Mink,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17272309/