【发布时间】:2017-03-06 09:53:14
【问题描述】:
在我的 Angular2 应用程序中,我有一个 Karma 单元测试,它需要等待一个元素启用。
我的问题是我不确定如何让测试等待该元素启用,然后再尝试单击它。
it('should check the fundDropdown exists', function () {
browser.get(url);
var menuStratItem = element(by.xpath('/html/body/alg-app/mainviewer/p-tabview/div/ul/li[2]/a'));
// Need to wait for this element to become enabled before I try to click it...
expect(menuStratItem.isEnabled()).toBe(true);
menuStratItem.click();
expect(element(by.id('fundDropdown')).isPresent()).toBe(true);
});
在继续测试之前如何等待该元素启用?
【问题讨论】:
标签: angular protractor karma-runner