我正在使用Codeception進行我的第一次驗收測試。Codeception:[RuntimeException]調用未定義的方法AcceptanceTester :: wait
當我跑我的wait()
或waitForElement()
測試,我得到這個消息:
[RuntimeException] Call to undefined method AcceptanceTester::wait
這裏是我的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'
這裏是我的測試:
$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);
我從 official doc
我也做了一定要執行:
vendor/bin/codecept build
什麼問題?
您的配置文件聲明WebGuy並使用Codeception 2.0(或更早)配置風格,但AcceptanceTester在您的測試中使用。他們不相關。 – Naktibalda
我不明白。我對codecption很陌生。你可以請細節? –