I have the next code that asserts if I can find a bank account in a cell. I found out that it's not working when the text in the cell contains a space after the text.
this.bankAccounts = Selector('td[data-cy="listAccountNumber"]');
async checkBankAccount(accountNumber, currencyCode, name){
const formatedAccount = formatBankAccount(accountNumber, currencyCode);
const bankCell = Selector(this.bankAccounts).withText(formatedAccount);
await t
.expect(bankCell.exists).ok("Should create: " + name +
" bank. Could not find bank: " + formatedAccount);
}
For example, the previous method won't find the next cell if given accountNumber "CY25 7121 9716 3791 8645 3263 6242"
<td data-cy="listAccountNumber">CY25 7121 9716 3791 8645 3263 6242 </td>
But it will find it if my cell was like:
<td data-cy="listAccountNumber">CY25 7121 9716 3791 8645 3263 6242</td>