Jul*_*oro 5 acceptance-testing laravel codeception
我正在使用 Codeception 进行我的第一次验收测试。
当我使用wait()
或运行测试时waitForElement()
,我收到以下消息:
[RuntimeException] Call to undefined method AcceptanceTester::wait
Run Code Online (Sandbox Code Playgroud)
这是我的 acceptance.yml
# Codeception Test Suite Configuration
#
# Suite for acceptance tests.
# Perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.
class_name: WebGuy
modules:
enabled:
- WebDriver
- \Helper\Acceptance
config:
WebDriver:
url: 'http://rh.dev'
browser: 'firefox'
Run Code Online (Sandbox Code Playgroud)
这是我的测试:
$I = new AcceptanceTester($scenario);
$I->wantTo('Register my profile for the first time');
$I->amOnPage('/register');
$I->fillField('name', $person->name);
$I->wait(3); // secs
$I->fillField('lastName', $person->lastName);
Run Code Online (Sandbox Code Playgroud)
我从官方文档那里得到的
我还确保执行:
vendor/bin/codecept build
Run Code Online (Sandbox Code Playgroud)
有什么问题?
我对缺少的wait()
方法有类似的问题。问题是我使用的是PhpBrowser
而不是WebDriver
,并且PhpBrowser
没有提供该方法。在你的测试类中自己实现它是微不足道的:
public function wait($seconds) {
sleep($seconds);
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5441 次 |
最近记录: |