Wagner Maciel 695f83529d feat(dev-infra): exposed new rule 'component_benchmark' via dev_infra (#36434)
* Move tools/brotli-cli, tools/browsers, tools/components,
  tools/ng_rollup_bundle, and modules/e2e_util to dev-infra/benchmarking
* Fix imports and references to moved folders and files
* Set up BUILD.bazel files for moved folders so they can be packaged with
  dev-infra's :npm_package

PR Close #36434
2020-04-23 13:31:54 -07:00

41 lines
1.2 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 {$, browser, by, element, ExpectedConditions} from 'protractor';
import {verifyNoBrowserErrors} from '../../../../dev-infra/benchmark/driver-utilities';
function waitForElement(selector: string) {
// Waits for the element with id 'abc' to be present on the dom.
browser.wait(ExpectedConditions.presenceOf($(selector)), 20000);
}
describe('relative assets relative-app', () => {
afterEach(verifyNoBrowserErrors);
const URL = '/';
it('should load in the templateUrl relative to the my-cmp component', () => {
browser.get(URL);
waitForElement('my-cmp .inner-container');
expect(element.all(by.css('my-cmp .inner-container')).count()).toEqual(1);
});
it('should load in the styleUrls relative to the my-cmp component', () => {
browser.get(URL);
waitForElement('my-cmp .inner-container');
const elem = element(by.css('my-cmp .inner-container'));
const width = browser.executeScript(
(e: Element) => parseInt(window.getComputedStyle(e).width), elem.getWebElement());
expect(width).toBe(432);
});
});