angularjs - identifying that table header values are what they should be -
i'm trying prove in table have following table labels. date, amount, comment.
<table class="grid-table-body"> <thead> <tr> <th>date</th> <th>amount (£)</th> <th>description</th> </tr> </thead> <tbody> ..... ..... ..... </tbody> </table>
i've got far proving table present!
var mytable = element(by.css('.grid-table-body')); expect(mytable.ispresent()).tobetruthy();
how can loop through each <th>
, text. if put them array prove should be. i.e.
expect(data.get(0).gettext()).tobe("date");
would enough (i think)
first locate elements, can call gettext()
:
var headers = $$(".grid-table-body thead th"); expect(headers.gettext()).toequal(["date", "amount (£)", "description"]);
to check of headers visible, can either use:
expect(headers.isdisplayed()).toequal([true, true, true]);
or, check if there no false
in array:
expect(headers.isdisplayed()).not.tocontain(false);
Comments
Post a Comment