我正在尝试调用 done() 进行异步测试,但这不起作用,我收到“未定义不是函数”错误。
describe('Login screen tests', function () {
var ptor = protractor.getInstance();
beforeEach(function(){
console.log('In before Each method');
ptor.get('http://staging-machine/login/#/');
});
it('Blank Username & Password test', function(done) {
ptor.findElement(protractor.By.id("submit")).click();
var message = ptor.findElement(protractor.By.repeater('message in messages'));
message.then(function(message){
message.getText().then(function(text) {
console.log("Message shown:"+text);
expect(message.getText()).toContain('Username or Password can\'t be blank');
done();
});
});
});
});
我试着用谷歌搜索,发现茉莉花可能有一些问题,但我仍然无法解决这个问题。因为错误似乎真的出乎意料。任何帮助,将不胜感激。