I am trying to read the values from the table cells in a row to check the values corresponding to the expected ones.
I was faced with a situation where the protractor cannot get the text of the specific cells that interest me, because it cannot find the cells that I request.
Here are my test suite steps:
beforeAll(function() {
common.journeyValidationBtn.click();
helper.waitForUrlToContain('journey-validation');
helper.waitForElementToHide(common.spinner);
common.fabBtn.click();
helper.waitForPresenceOf(common.calculateBtn);
common.runCalculation(secondaryPeriod);
helper.waitForPresenceOf(common.fabBtn, 30000);
helper.waitForElementToHide(common.spinner);
common.selectComparisonPeriod(initialPeriod);
helper.waitForTableRows(page.reimbursementCalculations).then(function() {
console.log('*** Table Rows Found - promise resolved ***');
page.reimbursementCalculations.count().then(function(count){
console.log('*** Number of Table Rows Found - ' + count + ' ***');
row = page.reimbursementCalculations.first();
cells = row.all(by.css('td'));
cells.count().then(function(cellCount){
console.log('*** Number of Table Cells Found - ' + cellCount + ' ***');
cells.get(0).getText().then(function(text){
console.log('*** First Table Cell Text - ' + text + ' ***');
});
});
});
}, function(reason){
console.log('*** Table Rows Not Found - promise rejected ***');
console.log(reason);
});
});
it('Then I should get more than one cell returned', function() {
expect(cellCount.count()).toBeGreaterThan(0);
});
When I run the test, I see some Jasmine timeout errors, followed by a crash for my wait, when it cannot call count () in my cell variable, which is assigned in the beforeAll block. Perhaps this timeout is related to what I see, but I'm trying to debug this further.
[12:20:01] I/testLogger - [chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
[chrome
, , , ( 11 ), , undefined . my beforeAll, , , undefined .
, .
, - , - ?