【问题标题】:Protractor : Error : Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL量角器:错误:超时 - 在 jasmine.DEFAULT_TIMEOUT_INTERVAL 指定的超时内未调用异步回调
【发布时间】:2016-09-10 14:54:27
【问题描述】:

我的 E2E 测试是在页面中填写一些详细信息,单击按钮转到下一页并验证我们是否到达了下一页。现在我可以移动到下一页并向下滚动,但之后我无法根据 id、name 或 css 选择元素,它失败并出现上述错误。

为什么会出现“超时 Aysnc 回调未被调用”错误?

我看到很多问题都要求相同的错误,但在我的情况下没有一个答案有效。PFB 代码。

beforeEach(() => {
    browser.manage().window().setSize(BROWSER_WIDTH, BROWSER_HEIGHT);
    browser.get('index.html#/banking');
    bankingDetails = require('./banking.page');
});

fit('should navigate to check panel for source type = saving and one ' +
    'savings checkbox was selected', () => {

    var checkPanelDetails = require('./check.page');
    bankingDetails.fillBankingDetails(true, true);
    bankingDetails.bankingWeiterButton.click();
    browser.executeScript('window.scrollTo(0, 700);');
    var isPresent = browser.wait(function () {
        return checkPanelDetails.isVisible();
    });
    expect(isPresent).toBeTruthy();
});


check.page

var CheckPanel = function () {
this.checkPanel = element(by.name('check.confirm'));
this.isVisible = function () {
    return this.checkPanel.isPresent();
};
};
module.exports = new CheckPanel();   

注意: 我正在使用 jasmine(2.4.1) 和量角器(2.3.0)

【问题讨论】:

标签: angularjs jasmine protractor angularjs-e2e


【解决方案1】:

这是来自 jasmine Asynchronous_Support 的链接,可帮助我了解超时问题。希望对你有帮助,

  describe("long asynchronous specs", function() {
        beforeEach(function(done) {
          done();
        }, 10000);
        });

【讨论】:

  • 不,Emna 不工作。已更新您的建议并尝试过,同样的问题。
  • 在量角器部分查看我的其他问题,因为我曾经多次遇到这个问题..
猜你喜欢
  • 2021-03-31
  • 2016-05-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-24
  • 2016-04-21
  • 2019-01-07
相关资源
最近更新 更多