For below protractor mocha test cases, greeting.getText() will always return
below result instead of the string. Could anyone give me clue on this?
describe('angularjs home', function () {
it('Should welcome a user', function (done) {
browser.get('http://www.angularjs.org');
element(by.model('yourName')).sendKeys('tanshuai');
var greeting = element(by.binding('yourName'));
console.log(greeting.getText());
expect(greeting.getText()).to.eventually.equal('Hello tanshuai!');
});
});
The console.log output================
ElementFinder {
browser_:
ProtractorBrowser {
controlFlow: [Function],
schedule: [Function],
setFileDetector: [Function],
getExecutor: [Function],
................................
getId: [Function],
takeScreenshot: [Function] }