TestCase: Verify the table ROW contains text.
To verify text present in Table Row, i tried Using "expect.gettext().toContain(datefinal)".
But ouput returns "Expected '7/18/17' to contain undefined."
HTML Code:
<table class="table" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr class="tableheader">
<tr>
<td nowrap="true" align="left">
<a
href="/internal/servlet/internalAccountPartner&command=edit"
[email protected]</a>
</td>
<td align="left">7/18/17</td>
CODE:
var dateString = "";
var newDate = new Date();
// Get the month, day, and year.
dateString += (newDate.getMonth() + 1) + "/";
dateString += newDate.getDate() + "/";
dateString += newDate.getFullYear() - 2000;
var datefinal = console.log(dateString);
expect(cells.get(6).getText()).toContain(datefinal);
OUTPUT:
Expected '7/18/17' to contain undefined.