I am trying to write a Protractor test to validate the text within each cell in the first row of an Angular Grid.
The Angular Grid has 299 rows, but only 30 rows are being tested for some reason.
I have removed some of the Expected Results & error message below to make it easier to read.
Protractor Code:
it('should validate the Spec column(first column) in the Table', () => {
element.all(by.css('div.ag-cell[col-id="Spec"]'))
.map(function (cell) {
return cell.getText();
})
.then(function (cellValues) {
expect(cellValues).toEqual(["2205", "2205", "2304", "2507", "254SMO", "26-4-4", "29-4", "302", "304", "304H", "304L", "304N", "305", "308", "309", "309S", "310",
"310S", "316", "316H", "316L", "316N", "317", "317L", "321", "321H", "329", "330", "347", "3RE60", "405", "409", "410", "410S", "420", "430", "440A", "440B", "440C", "44LN",
"654SMO", " 70/30 CuNi", "7Mo Plus", plus a lot more expected results]);
})
});
Error Message:
Expected $.length = 30 to equal 299.
Expected $[30] = undefined to equal '405'.
Expected $[31] = undefined to equal '409'.
Plus a lot more
Can someone please tell me why it's only picking up a few of the cells?
Below, you can see one of the rows that is appearing undefined has col-id="Spec" so I don't know why that isn't being picked up in the test
Note: I've inspected the cells not being picked up & they have col-id="Spec".
