From d8929c1d7378ec87f8ae95503ae70fb0055da8d3 Mon Sep 17 00:00:00 2001 From: Julie Ralph Date: Mon, 22 Jun 2015 09:24:09 -0700 Subject: [PATCH] fix(benchmarks): add waits for naive scrolling benchmark to ensure loading Also, simplify selectors. Closes #1706. --- modules/benchmarks/e2e_test/naive_infinite_scroll_perf.ts | 7 +++---- modules/benchmarks/src/naive_infinite_scroll/app.ts | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/benchmarks/e2e_test/naive_infinite_scroll_perf.ts b/modules/benchmarks/e2e_test/naive_infinite_scroll_perf.ts index b5184ac38b..988a4fe0b5 100644 --- a/modules/benchmarks/e2e_test/naive_infinite_scroll_perf.ts +++ b/modules/benchmarks/e2e_test/naive_infinite_scroll_perf.ts @@ -12,12 +12,11 @@ describe('ng2 naive infinite scroll benchmark', function() { url: URL, id: 'ng2.naive_infinite_scroll', work: function() { + browser.wait(protractor.until.elementLocated(protractor.By.css('body /deep/ #scrollDiv')), + 5000); $('#reset-btn').click(); $('#run-btn').click(); - browser.wait(() => { - return $('#done').getText().then(function() { return true; }, - function() { return false; }); - }, 10000); + browser.wait(protractor.until.elementLocated(protractor.By.css('#done')), 10000); }, params: [ {name: 'appSize', value: appSize}, diff --git a/modules/benchmarks/src/naive_infinite_scroll/app.ts b/modules/benchmarks/src/naive_infinite_scroll/app.ts index b8a5802f5e..dbe2e17d05 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/app.ts +++ b/modules/benchmarks/src/naive_infinite_scroll/app.ts @@ -83,5 +83,5 @@ export class App { _locateFinishedMarker() { return DOM.querySelector(document.body, '#done'); } - _getScrollDiv() { return DOM.query('body /deep/ #testArea /deep/ #scrollDiv'); } + _getScrollDiv() { return DOM.query('body /deep/ #scrollDiv'); } }