我开始使用Codeception和PhantomJS进行验收测试。
这是我的acceptance.suite.yml
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: http://localhost/
browser: firefox
window_size: 1280x1024
wait: 2s
- HelperAcceptance
和我的验收测试
$I = new AcceptanceTester($scenario);
$I->wantTo('Check that something');
$I->amOnPage('/');
$I->click('element that opens a bootstrap modal');
$I->see("Something on the modal");
我有一个以./phantomjs --webdriver=4444
开头的 PhantomJS 服务器,我用 php codecept.phar run acceptance
启动了我的测试。
但是,测试失败
Step I see "Something on the modal"
Fail Failed asserting that /
[...]
--> contains "Something on the modal".
而_output
目录中的屏幕截图显示了模态和"Something on the modal"
。
我做错了什么吗?
也许是因为acceptance.yml说浏览器"Firefox",它应该是"phantomjs"。