HsacAcceptanceTests.SlimTests.BrowserTest.GridTests.GridOnPageWithSimilarTablesTest


This test ensures we can find elements inside tables representing a grid where each column indicates a property and each row contains the values for the properties of one item.
We check we find the right table, based on the column values we look for.

variable defined: HTML= {{{ <!DOCTYPE html> <html lang="en"> <body> <table> <thead> <tr><th>Lastname</th><th>Firstname</th><th>Gender</th><th>Birth date</th><th></th></tr> </thead> <tbody> <tr><td>Smith</td><td>Joe</td><td>Male</td><td>10-01-1975</td><td><button>Edit</button><button>Delete</button></td></tr> <tr><td>Johnson</td><td>Pamela</td><td>Female</td><td>01-12-1978</td><td><button>Edit</button><button>Delete</button></td></tr> <tr><td><a>Rogers<img />-Smith</a></td><td>Jack</td><td>Male</td><td>10-01-1980</td><td><button>Edit</button><button>Delete</button></td></tr> </tbody> </table> <table> <thead> <tr><th>Lastname</th><th>Firstname</th><th>Gender</th><th>Birth date</th><th></th></tr> </thead> <tbody> <tr><td>Foo</td><td>Boris</td><td>Female</td><td>11-01-1975</td><td><button>Edit</button><button>Delete</button></td></tr> <tr><td>Bar</td><td>Angela</td><td>Male</td><td>11-12-1978</td><td><button>Edit</button><button>Add</button></td></tr> </tbody> </table> </body> </html>}}}


script mock xml server setup
add response
<!DOCTYPE html>
<html lang="en">
<body>
<table>
    <thead>
    <tr><th>Lastname</th><th>Firstname</th><th>Gender</th><th>Birth date</th><th></th></tr>
    </thead>
    <tbody>
    <tr><td>Smith</td><td>Joe</td><td>Male</td><td>10-01-1975</td><td><button>Edit</button><button>Delete</button></td></tr>
    <tr><td>Johnson</td><td>Pamela</td><td>Female</td><td>01-12-1978</td><td><button>Edit</button><button>Delete</button></td></tr>
    <tr><td><a>Rogers<img />-Smith</a></td><td>Jack</td><td>Male</td><td>10-01-1980</td><td><button>Edit</button><button>Delete</button></td></tr>
    </tbody>
</table>
<table>
    <thead>
    <tr><th>Lastname</th><th>Firstname</th><th>Gender</th><th>Birth date</th><th></th></tr>
    </thead>
    <tbody>
    <tr><td>Foo</td><td>Boris</td><td>Female</td><td>11-01-1975</td><td><button>Edit</button><button>Delete</button></td></tr>
    <tr><td>Bar</td><td>Angela</td><td>Male</td><td>11-12-1978</td><td><button>Edit</button><button>Add</button></td></tr>
    </tbody>
</table>
</body>
</html>
$url<-[http://127.0.0.1:8001/FitNesseMock] get mock server url

script browser test
seconds before timeout 1
open $url->[http://127.0.0.1:8001/FitNesseMock]
check value of column number 1 in row number 2 Johnson
check value of Firstname in row where Lastname is Rogers Jack
check value of Birth date in row where Lastname is Rogers 10-01-1980
click Edit in row where Lastname is Smith
check value of Firstname in row where Lastname is Foo Boris
check value of Birth date in row where Firstname is Angela 11-12-1978
click Add in row where Lastname is Bar


script mock xml server setup
stop