1
我有一个量角器测试,导航到另一个URL,在我的测试环境中无法找到/解析,所以我检查标题是否不是以前的标题。如何等待元素不再存在
测试如下:
it('should navigate to another site in case of click on cancel link', function() {
page.navigate();
page.submit();
protractor.getInstance().ignoreSynchronization = true;
browser.wait(function(){
return element(by.id('submit')).isPresent();
});
page.closePage();
// the title of a 404, dns issue etc is at least different from the previous site:
expect(browser.getTitle()).not.toEqual('MyDummyTitle')
protractor.getInstance().ignoreSynchronization = false;
});
这在大多数的浏览器,但在Internet Explorer中我发现,它往往是没有准备好导航到不存在的页面,就会引发期待。
我可以以某种方式等待'submit'元素消失,类似于我在执行closePage之前做的事情吗?
的感谢!奇迹般有效。 – Maarten 2014-12-09 10:17:05