Angularjs 如何使用selenium和codeception在验收测试中检测dom变化
我正在为用英语写的申请写一份验收测试。我将Codeception测试框架与selenium结合使用。测试将一些文本写入输入字段并提交表单。它应该通过ajax api调用将新任务添加到db中,并将新的Angularjs 如何使用selenium和codeception在验收测试中检测dom变化,angularjs,selenium-webdriver,acceptance-testing,Angularjs,Selenium Webdriver,Acceptance Testing,我正在为用英语写的申请写一份验收测试。我将Codeception测试框架与selenium结合使用。测试将一些文本写入输入字段并提交表单。它应该通过ajax api调用将新任务添加到db中,并将新的元素添加到现有任务列表中。 我将如何检测添加的新元素?以下是到目前为止我得到的信息: <?php $I = new WebGuy($scenario); $I->wantTo('add new story'); $I->amOnPage('/'); $I->fillField(
元素添加到现有任务列表中。
我将如何检测添加的新元素?以下是到目前为止我得到的信息:
<?php
$I = new WebGuy($scenario);
$I->wantTo('add new story');
$I->amOnPage('/');
$I->fillField('input', 'asdf');
$I->pressKey('input[name=input]', '13');
// ensure that new <li> has been added?
您可以使用以下任何方式编写代码来单击li
//通过分区访问
$I->click('div div div div div ul li a');
$I->see('UNIT 1');
//通过类名访问
$I->click('div[class="new"] div div div a');
//通过div id访问
$I->click('div[id=tnList] ul li a');
新元素是否添加到列表的末尾或列表中间的任何位置?它被添加到开始。