mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
b757b1387c
The dev-infra build tooling is now decoupled from `ng-dev`. This will make it easier to update `ng-dev` without necessarily needing to upgrade the whole build system, Bazel etc. This is useful when e.g. new release tool features have been added and should also be ported to active LTS branches. PR Close #46976
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC 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 {verifyNoBrowserErrors} from '@angular/build-tooling/bazel/benchmark/driver-utilities';
|
|
import {$, browser, by, element, ExpectedConditions} from 'protractor';
|
|
|
|
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);
|
|
});
|
|
});
|