I recently edited an item and here is my code:
let articleName = $('[placeholder="Article name"]');
articleName.click().clear().sendKeys('Test Item Edited');
saveItem.click();
However, when I attempt to verify the test case with:
expect(articleName.getText()).toContain('Test Item Edited');
or
expect(articleName.getAttribute("Test Item Edited")).toEqual('Test Item Edited');
an error is displayed stating "Expected '' to contain 'Test Item Edited'."
Upon further investigation, it appears that in the source code, the article name cannot be found after editing. Could this be the reason for the error?
<input _ngcontent-c30="" class="mat-input-element mat-form-field-autofill-control ng-pristine ng-valid ng-touched" matinput="" required="" maxlength="80" pattern="[A-Za-z0-9 ]{1,80}" id="mat-input-611" placeholder="Article name" aria-invalid="false" aria-required="true">
As a newcomer to protractor, I am unsure of how to address this issue.