2016-09-02 15:37:22 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {openBrowser, verifyNoBrowserErrors} from 'e2e_util/e2e_util';
|
2016-11-10 21:13:11 -05:00
|
|
|
import {$} from 'protractor';
|
2016-09-02 15:37:22 -04:00
|
|
|
|
|
|
|
describe('largetable benchmark spec', () => {
|
|
|
|
|
|
|
|
afterEach(verifyNoBrowserErrors);
|
|
|
|
|
|
|
|
it('should work for ng2', () => {
|
2016-10-18 18:45:16 -04:00
|
|
|
testTableBenchmark({
|
2016-09-02 15:37:22 -04:00
|
|
|
url: 'all/benchmarks/src/largetable/ng2/index.html',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should work for ng2 switch', () => {
|
2016-10-18 18:45:16 -04:00
|
|
|
testTableBenchmark({
|
2016-09-02 15:37:22 -04:00
|
|
|
url: 'all/benchmarks/src/largetable/ng2_switch/index.html',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should work for the baseline', () => {
|
2016-10-18 18:45:16 -04:00
|
|
|
testTableBenchmark({
|
2016-09-02 15:37:22 -04:00
|
|
|
url: 'all/benchmarks/src/largetable/baseline/index.html',
|
|
|
|
ignoreBrowserSynchronization: true,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should work for the incremental-dom', () => {
|
2016-10-18 18:45:16 -04:00
|
|
|
testTableBenchmark({
|
2016-09-02 15:37:22 -04:00
|
|
|
url: 'all/benchmarks/src/largetable/incremental_dom/index.html',
|
|
|
|
ignoreBrowserSynchronization: true,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-10-18 18:45:16 -04:00
|
|
|
function testTableBenchmark(openConfig: {url: string, ignoreBrowserSynchronization?: boolean}) {
|
2016-09-02 15:37:22 -04:00
|
|
|
openBrowser({
|
|
|
|
url: openConfig.url,
|
|
|
|
ignoreBrowserSynchronization: openConfig.ignoreBrowserSynchronization,
|
|
|
|
params: [{name: 'cols', value: 5}, {name: 'rows', value: 5}],
|
|
|
|
});
|
|
|
|
$('#createDom').click();
|
|
|
|
expect($('#root').getText()).toContain('0/0');
|
|
|
|
$('#createDom').click();
|
|
|
|
expect($('#root').getText()).toContain('A/A');
|
|
|
|
$('#destroyDom').click();
|
|
|
|
expect($('#root').getText()).toEqual('');
|
|
|
|
}
|
|
|
|
});
|