我有HTML:
<div class="p-login-info" ng-show="loggedOut()">My text.</div>
在javascript中:
var e = element(by.className('p-login-info'));
e.getText()
.then(function(text){
var logoutText = "You have been log out.";
expect(text).toMatch(logoutText);
console.log("============= "+text);
});
我的控制台日志中没有任何内容。
有什么想法吗?
答案 0 :(得分:0)
您可能希望使用textToBePresentInElement
预期条件:
var EC = protractor.ExpectedConditions;
var e = element(by.className('p-login-info'));
browser.wait(EC.textToBePresentInElement(e, "You have been log out."), 5000);