//get count of checked checkboxes,
//count must be 1 because it selected one product
var checkedCount = productPage.selectedProducts.count();
expect(checkedCount).toBe(1).then(function() {
browser.sleep(2222);
productDialogPage. createTaskButton.click();
});
這是我的代碼。當用戶選擇時,createtaskbutton被激活。失敗:無法讀取未定義的屬性(量角器)
通常它被禁用。
誤差
Failed: Cannot read property 'then' of undefined Stack: TypeError: Cannot read property 'then' of undefined
當我改變這個
//get count of checked checkboxes, count must 1 be because it selected one product
var checkedCount = productPage.selectedProducts.count();
expect(checkedCount).toBe(1);
browser.sleep(4222);
//click task create and expect confirm dialog to be displyed
productDialogPage.createTaskButton.click();
same
Message: Failed: Cannot read property 'click' of undefined Stack: TypeError: Cannot read property 'click' of undefined
它亙古不變的閱讀我的規範類,它一旦進入去另一個規範。
也出於同樣
//get count of checked checkboxes, count must 1 be because it selected one product
var checkedCount = productPage.selectedProducts.count();
expect(checkedCount).toBe(1);
browser.sleep(4222);
browser.wait(function() {
return productDialogPage.createTaskButton.isPresent();
})
如何獲取元素createTaskButton? – gyc