Yii2 Codeception 接受类名必须是有效的对象或字符串

去关心

我正在尝试在 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。我做错了什么?

去关心

问题出在 codeception.yaml 中。所以codeception wad 无法找到Actor 类。注意拼写和填充。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章