为什么Angular网站(irctc.co.in)需要把脚本WaitForAngularEnabled设为false,没有这个代码就无法工作。

问题描述 投票:-3回答:1
describe('Protractor Alert steps', function () {
   it('Open Angular js website Alerts', function () {
        browser.waitForAngularEnabled(false);
        browser.get("https://www.irctc.co.in/nget/train-search");
        element(by.xpath("//button[contains(text(),'Ok')]")).click();
      })
})

现在它的工作与上面的代码,但你能解释一下我

这是Angular网站,那么为什么下面的语句必须是假的呢?

browser.waitForAngularEnabled(false); ?

没有上面这行代码是不行的......

angular testing protractor
1个回答
0
投票

这是一个错误,下面的承诺不需要处理。

31mF[0mA茉莉花规格超时。重新设置WebDriver控制流程。

失败原因:1)Protractor告警步骤 打开Angular js网站 告警信息:[31m Error: 超时--在jasmine.DEFAULT_TIMEOUT_INTERVAL指定的超时内未调用Async回调。[0m Stack: 错误:超时 - 异步回调没有在jasmine.DEFAULT_TIMEOUT_INTERVAL指定的超时时间内被调用。超时--在jasmine.DEFAULT_TIMEOUT_INTERVAL指定的超时时间内没有调用Async回调。在listOnTimeout (internaltimers.js:549:17) at processTimers (internaltimers.js:492:7) 消息:[31m Failed: script timeout


0
投票

您收到一个超时错误。修改您的配置文件中的超时限制。

exports.config = {
    allScriptsTimeout: 90 * 1000, // Set to 90 seconds
    getPageTimeout: 15 * 1000, // Set to 15 seconds

    // if you're using Node, you might want to adjust this as well:
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 60 * 1000, // 60 second timeout
        print: function() {}
    },
};

只是一个警告:长测试是脆弱的测试。仔细调整你的超时限制。

© www.soinside.com 2019 - 2024. All rights reserved.