【问题标题】:Test Bootstrap modals with Codeception and PhantomJs使用 Codeception 和 PhantomJs 测试 Bootstrap 模态
【发布时间】:2016-06-05 14:40:16
【问题描述】:

我开始使用 Codeception 和 PhantomJS 进行验收测试。

这是我的acceptance.suite.yml

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: http://localhost/
            browser: firefox
            window_size: 1280x1024
            wait: 2s
        - \Helper\Acceptance

还有我的验收测试

$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"

我做错了吗?

【问题讨论】:

    标签: twitter-bootstrap phantomjs bootstrap-modal codeception


    【解决方案1】:

    可能是因为acceptance.yml 说浏览器'firefox',它应该是'phantomjs'。

    【讨论】:

      猜你喜欢
      • 2014-08-13
      • 2016-08-06
      • 2013-09-07
      • 2015-07-16
      • 1970-01-01
      • 2015-07-21
      • 1970-01-01
      • 2015-03-18
      • 1970-01-01
      相关资源
      最近更新 更多