超时等待量角器到11秒后与页面同步 - 量角器 [英] Timed out waiting for Protractor to synchronize with the page after 11 seconds - Protractor

查看:286
本文介绍了超时等待量角器到11秒后与页面同步 - 量角器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个登录表单,我想设置输入到两个输入,但测试没有在Chrome,Safari浏览器通过,但与Firefox它的工作原理。

起初我有一个$ HTTP请求和它完成,而据我所知,量角器继续当$ HTTP是完成的,因此这不应该成为问题,是这样吗?

错误:


  

未捕获的异常:超时等待量角器同步
  以11秒后的页面。请参见
   https://github.com/angular/protractor/blob/master/docs /faq.md


这是我的测试:

\r
\r

描述('ADM登录页',函数(){\r
beforeEach(函数(){\r
browser.get('http://127.0.0.1:8383/v2');\r
});\r
\r
它('登陆',函数(){\r
VAR用户名=元素(by.css('div.e2e-ADM-用户名输入input.Input持有人))\r
密码=元素(by.css('div.e2e-ADM-密码输入input.Input持有人'));\r
\r
username.sendKeys('测试');\r
期待(username.getText())TOBE(测试)。\r
\r
password.click();\r
\r
password.sendKeys(',,测试);\r
期待(password.getText())TOBE(',,测试)。\r
\r
。元素(by.css('div.Login-ActionHolder a.Big-行动))点击();\r
});\r
});

\r

\r
\r


解决方案

您可以添加allScriptsTimeout:在量角器配置文件毫秒。我有在这时间太长背景中的$ HTTP请求。​​

  exports.config = {
    ...
    allScriptsTimeout:50000,
    ...
};

I have a login form, and I want to set input to both inputs, but the test doesn't go through in Chrome, Safari, but with Firefox it works.

Initially I have a $http request and it is done, and as I know, protractor continues when $http is done, so this should not be the issue, or is it?

Error:

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

This is my test:

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

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

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

		password.click();

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

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

解决方案

you could add allScriptsTimeout: milliseconds in protractor configuration file. I was having a $http request in the background that was taking too long.

exports.config = {
    ...
    allScriptsTimeout: 50000,
    ...
};

这篇关于超时等待量角器到11秒后与页面同步 - 量角器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆