I am writing a simple protractor test that is designed to check if a particular input tag contains text after clicking a button. I have tried several things and am currently trying to use protractor.ExpectedConditions to check if it contains any text. Here is my code:
it("should click submit", function() { var EC = protractor.ExpectedConditions; var status = element(by.id('status')); $("#btnSubmitQuery").click(); var condition = EC.textToBePresentInElement(status, 'C'); browser.wait(condition, 8000, "Text is still not present"); status.getText().then(function (text) { console.log(text); }); });
A REST call is made on the server after pressing btnSubmitQuery, but the problem is that I can never get any value for the status. What happens when I run this code is that the browser just waits 8 seconds and then closes, although I can see the text in the element. Nothing is written to the console. Any ideas?
EDIT: The html element I am checking looks like this:
<td><input id="status" type="text" class="form-control" placeholder="PaxStatus ..." value="{{paxInformation.status}}"ng-readonly="true"></td>
source share