无法选择元素



我能够使用 ng-repeat 选择一个元素,但开发人员使用了虚拟重复,因此以下代码现在不起作用

expect(stores.listStores(0).getText()).toContain('Prahran');
expect(element.all(by.repeater('store in ui.stores')).count()).toEqual(1);

失败:索引越界。尝试访问索引处的元素:0,但只有 0 个元素与定位器 by.repeater("store in ui.stores"( 匹配

您可以制作一个 CSS 选择器来匹配材料设计中继器元素:

element.all(by.css('[md-virtual-repeat="store in ui.stores"]'));

最新更新