我正在学习教程“用Yii2和PHP开发网络应用程序”,其中使用了共同欺骗来进行测试。
当使用JavaScript验证运行测试时,书中描述的测试使用Wait(1)方法,该方法允许测试等待1秒以允许验证。
这个函数似乎不再受支持了。它存在于文档中,但在深入研究代码时,无法找到该方法。
我是做错了什么,还是错过了配置更改?
namespace Step\Acceptance;
class Guest extends \AcceptanceTester {
public $username;
public $password;
public function __construct($scenario) {
parent::__construct($scenario);
if ($this->username and $this->password)
$this->login($this->username, $this->password);
}
function login($username, $password) { // 1
$I = $this;
$I->amOnPage('/site/login');
$I->fillField('LoginForm[username]', $username);
$I->fillField('LoginForm[password]', $password);
$I->click('Login');
$I->wait(1);
$I->seeCurrentUrlEquals('/');
}
}发布于 2016-04-05 11:56:27
你解决问题了吗?
我认为这是配置问题,你在使用webdriver吗?也许还可以发布你的acceptance.suite.yml。http://codeception.com/docs/modules/WebDriver#.VwOm6xN96Rs
等待函数位于右边的函数列表中。
编辑:你的acceptance.suite.yml应该有这样的东西
modules:
enabled:
- WebDriver:
url: 'http://localhost/'
browser: firefoxhttps://stackoverflow.com/questions/34162805
复制相似问题