【问题标题】:Error: Timed out waiting for Protractor to synchronize with the page after 11001ms." when user browser.getCurrentUrl()错误:等待量角器在 11001 毫秒后与页面同步时超时。”当用户 browser.getCurrentUrl()
【发布时间】:2014-04-20 03:02:51
【问题描述】:

我正在测试登录和注销功能,下面是我的测试用例

it('should redirect to login page on click of logout',function(){
    signInPage.email.sendKeys('zahid.afaque@meltwater.com');
    signInPage.password.sendKeys(1234);
    signInPage.loginButton.click();
    expect(browser.getCurrentUrl()).toMatch(/\/collections/);
    signInPage.profileImage.click();
    signInPage.logout.click();
    browser.waitForAngular();
    expect(browser.getCurrentUrl()).toMatch(/\/login/);
});

当我在上面运行时测试它失败,下面是错误消息

Error: Timed out waiting for Protractor to synchronize with the page after 11001ms. Please see https://github.com/angular/protractor/blob/master/docs/faq.md

我尝试使用browser.waitForAngular();,但没有帮助。当我删除期望 "expect(browser.getCurrentUrl()).toMatch(/\/login/);" 时,它就通过了。有谁遇到过同样的问题,求帮助

【问题讨论】:

    标签: javascript jasmine protractor angularjs-e2e angularjs-resource


    【解决方案1】:

    也许您面临与我相同的问题。对我来说,该应用程序不断发送请求,因此从未完成。

    在“click()”之后添加以下行为我修复了它:

    browser.ignoreSynchronization = true;
    

    Link to my question

    【讨论】:

      【解决方案2】:

      ptor.sleep(1000) 而不是等待角度不理想但对我有用

      【讨论】:

      • @aksu 是的,如果它代替 browser.waitForAngular 它将起作用,我的答案将起作用
      • 嘿 Sirk,我也试过了,但它不起作用。
      猜你喜欢
      • 2015-05-06
      • 2023-03-12
      • 1970-01-01
      • 2015-10-05
      • 2014-05-16
      • 2018-12-07
      • 2017-02-02
      • 2016-10-06
      相关资源
      最近更新 更多