angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Reduce calls to waitForAngular in map function #1784

Closed smhc closed 9 years ago

smhc commented 9 years ago

The following to query the text for each cell of a table performs a 'waitForAngular' for every cell, which is very slow for a large table.

Is it possible to only call 'waitForAngular' once when invoked via 'map' ? Is there any way to turn off the synchronisation during this iteration? Using 'ignoreSynchronisation=true' doesn't allow turning sync on and off arbitrarily mid test due to the queuing design of web driver.

getTableText = function() {
        return element.all(by.repeater('row in rows')).map(function(rowResults) {
            return rowResults.all(by.repeater('col in cols')).map(function(cellResults) {
                return cellResults.getText();
            });
        });
    };
juliemr commented 9 years ago

We can't turn off waitForAngular for all calls to map, since some may modify the page and cause race conditions. We can probably do something to give better control over using ignoreSynchronization though.

FuturaITLtd commented 9 years ago

Would it be quicker to wait for the table to load then get the data via jquery? That's what we did and it reduced time to read data significantly.

Sent from my iPhone

On 5 Feb 2015, at 01:07, smhc notifications@github.com wrote:

The following to query the text for each cell of a table performs a 'waitForAngular' for every cell, which is very slow for a large table.

Is it possible to only call 'waitForAngular' once when invoked via 'map' ? Is there any way to turn off the synchronisation during this iteration? Using 'ignoreSynchronisation=true' doesn't allow turning sync on and off arbitrarily mid test due to the queuing design of web driver.

getTableText = function() { return element.all(by.repeater('row in rows')).map(function(rowResults) { return rowResults.all(by.repeater('col in cols')).map(function(cellResults) { return cellResults.getText(); }); }); }; — Reply to this email directly or view it on GitHub.

smhc commented 9 years ago

We can probably do something to give better control over using ignoreSynchronization though.

Yes please. A method to 'queue' the setting for ignoreSynchronization would help address the problem.

juliemr commented 9 years ago

See https://github.com/angular/protractor/issues/1939