我有一个Symfony 2.4.4站点,其中包含简单的Codeception(2.1.7)验收测试设置。运行验收测试时,我收到以下错误:
[Codeception\Exception\ConfigurationException]
AcceptanceTester class doesn't exist in suite folder.
Run the 'build' command to generate it
AcceptanceTester
类确实存在于tests/acceptance
目录中。如果我运行构建,我会收到以下错误:
[Codeception\Exception\ConfigurationException]
Configuration file could not be found.
Run `bootstrap` to initialize Codeception.
codeception.yml
文件确实存在并包含以下内容:
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
helpers: tests/_support
settings:
bootstrap: _bootstrap.php
colors: false
memory_limit: 1024M
coverage:
enabled: true
remote: true
include:
- app/*
exclude:
- app/cache/*
include:
...
modules:
config:
Db:
dsn: ''
user: ''
password: ''
dump: tests/_data/dump.sql
如果我运行一个bootstrap,它会确认:
Project is already initialized in '.'
acceptance.suite.yml包含:
class_name: AcceptanceTester
modules:
enabled:
- AcceptanceHelper
有什么建议吗?
答案 0 :(得分:1)
AcceptanceTester.php文件应位于tests / _support目录中。
运行codecept build
以重新生成Tester文件。
您没有启用accepted.suite.yml的模块。 您必须启用Symfony2,PhpBrowser和WebDriver之一。
您的网站使用旧版本的Symfony,如果使用Symfony2模块,可能会导致Codeception问题,因此我建议使用PhpBrowser或WebDriver对其进行测试。
答案 1 :(得分:0)
我相信,你需要运行命令codecept bootstrap
。
答案 2 :(得分:0)
我遇到了这个问题,我意识到我运行了codecept bootstrap
,但vendor
和tests
文件夹位于错误的目录中。
我跟着this video,它帮助了我。