2015-05-04 132 views
0

我有一個登錄表單,並且我想爲兩個輸入設置輸入,但測試不會在Chrome瀏覽器,Safari瀏覽器中進行,但使用Firefox有用。超時等待量角器在11秒後與頁面同步 - 量角器

最初我有一個$ http請求,它已完成,並且據我所知,量角器在$ http完成時繼續,所以這不應該是問題,還是它?

錯誤:

Uncaught exception: Timed out waiting for Protractor to synchronise with the page after 11 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md

這是我的測試:

describe('ADM login page', function() { 
 
\t beforeEach(function() { 
 
\t \t browser.get('http://127.0.0.1:8383/v2'); 
 
\t }); 
 

 
\t it('login', function() { 
 
\t \t var username = element(by.css('div.e2e-adm-username-input input.Input-Holder')), 
 
\t \t \t password = element(by.css('div.e2e-adm-password-input input.Input-Holder')); 
 

 
\t \t username.sendKeys('test'); 
 
\t \t expect(username.getText()).toBe('test'); 
 

 
\t \t password.click(); 
 

 
\t \t password.sendKeys(',,test'); 
 
\t \t expect(password.getText()).toBe(',,test'); 
 

 
\t \t element(by.css('div.Login-ActionHolder a.Big-Action')).click(); 
 
\t }); 
 
});

回答

0

您可以添加allScriptsTimeout:在量角器配置文件毫秒。我在背景中需要$ http請求時間太長。

exports.config = { 
    ... 
    allScriptsTimeout: 50000, 
    ... 
}; 
相關問題