Я использую транспортир для тестирования моего приложения.
Я пытаюсь получить значение внутри тега <p>
, и я могу сделать это, как показано console.log
, но ожидаемый результат возвращаетошибка:
[14:54:57] E/launcher - Cannot read property 'equal' of undefined
[14:54:57] E/launcher - TypeError: Cannot read property 'equal' of undefined
Это мой код на stepdefinitions.js
:
Then('I see the alert "Values are incorrect" for the contents which does not match the proper data', function (next) {
browser.sleep(9999);
let failed_msg = element(by.css('.error-message'));
failed_msg.getText().then(function(text){
console.log('MY ALERT MESSAGE FOR THIS SCENARIO IS: ',text);
expect((failed_msg).to.equal("Values are incorrect"));
next();
});
});
Может кто-нибудь мне помочь?