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