I am currently working on a basic protractor test to verify if a specific input tag contains text after a button is clicked. After trying various methods, I am now attempting to utilize protractor.ExpectedConditions to validate the presence of text. Below is the code snippet:
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);
});
});
Upon clicking btnSubmitQuery, a REST call is sent to the server. However, the issue I am facing is that I cannot retrieve any value for 'status'. When the code is executed, the browser halts for 8 seconds and then closes, despite the text being visible in the element. No data is displayed on the console. Any suggestions?
EDIT: The HTML element I am inspecting appears as follows:
<td><input id="status" type="text" class="form-control" placeholder="PaxStatus ..." value="{{paxInformation.status}}"ng-readonly="true"></td>