【发布时间】:2018-06-01 10:14:54
【问题描述】:
我正在尝试在 Yii2 上设置代码接收测试。我的堆栈是:vagrant + Selenium + chromedriver + PHP 7.1。这是我的概念配置:
actor: AcceptanceTester
modules:
enabled:
- WebDriver:
url: 'http://localhost:8080/'
window_size: 1920x1080
browser: chrome
capabilities:
chromeOptions:
args: ["--no-sandbox", "--headless", "--disable-gpu"]
binary: "/usr/bin/google-chrome-stable"
- Yii2:
part: [orm,email]
entryScript: index-test.php
config/test.php 等于 config/console.php
这是控制台的一些输出:
./yii serve
Server started on http://localhost:8080/
Document root is "/var/www/test/web"
Quit the server with CTRL-C or COMMAND-C.
[Fri Jun 1 12:46:39 2018] ::1:45348 [200]: /
[Fri Jun 1 12:46:52 2018] ::1:45362 [200]: /
最后,我在基本模板中使用了与 HomeCest 相同的 PageCest 并运行测试。单元测试正在运行,但验收测试返回以下内容:
PageCest: Ensure that about page works
测试测试/验收/PageCest.php:ensureThatAboutPageWorks
[Error] Class name must be a valid object or a string
对于所有方法都重复此错误是 PageCest。 我做错了什么?
【问题讨论】:
-
请使用 -vvv 参数运行 codeception 并提供堆栈跟踪。
标签: selenium yii2 codeception