
This benchmark tracks the generated file size for large forms as well as the time to create and destroy many form fields.
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
/**
|
|
* @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';
|
|
|
|
describe('largeform benchmark spec', () => {
|
|
|
|
afterEach(verifyNoBrowserErrors);
|
|
|
|
it('should work for ng2', () => {
|
|
testLargeformBenchmark({
|
|
url: 'all/benchmarks/src/largeform/ng2/index.html',
|
|
});
|
|
});
|
|
|
|
function testLargeformBenchmark(
|
|
openConfig: {url: string, ignoreBrowserSynchronization?: boolean}) {
|
|
openBrowser({
|
|
url: openConfig.url,
|
|
params: [{name: 'copies', value: 1}],
|
|
ignoreBrowserSynchronization: openConfig.ignoreBrowserSynchronization,
|
|
});
|
|
$('#createDom').click();
|
|
expect(element.all(By.css('input[name=value0]')).get(0).getAttribute('value'))
|
|
.toBe('someValue0');
|
|
$('#destroyDom').click();
|
|
expect(element.all(By.css('input[name=value0]')).count()).toBe(0);
|
|
}
|
|
});
|