I'm writing a simple protractor test that's intended to check if a certain input tag contains text after a button is clicked. I've tried a few things and I'm currently trying to use protractor.ExpectedConditions to check if it contains any text. Here's 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 to a server once btnSubmitQuery is clicked but the problem is that I can never get any value for status. What happens when I run this code is that the browser just waits for 8 seconds then closes, even though I can see text in the element. Nothing gets logged to the console. Any ideas?
EDIT: The html element I'm checking looks like this:
<td><input id="status" type="text" class="form-control" placeholder="PaxStatus ..." value="{{paxInformation.status}}"ng-readonly="true"></td>