0
describe("I should see a a list of cars to add ", function() {
  var add_car_button = element(by.id('add_car'));
  add_car_btn.click() // Failure, can't continue on from here
  // assertions to follow...
});

运行测试时从量角器收到的错误:

等待量角器同步时出错

add_car_btn会将用户发送到一个新页面,其中将向用户显示汽车列表(通过 http get 请求收集)。我怎样才能成功地指示 webdriver 单击按钮而不会继续前进?

4

1 回答 1

0

将失败的代码放在 beforeEach 块中是一种成功的解决方法,请参阅https://github.com/angular/protractor/issues/376

于 2013-12-30T17:18:58.627 回答