2016-06-23 12:47:54 -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
|
|
|
|
*/
|
|
|
|
|
2016-07-13 13:10:02 -04:00
|
|
|
import {verifyNoBrowserErrors} from 'e2e_util/e2e_util';
|
2015-12-05 05:21:38 -05:00
|
|
|
|
2016-06-08 18:45:15 -04:00
|
|
|
function waitForElement(selector: any /** TODO #9100 */) {
|
2015-12-05 05:21:38 -05:00
|
|
|
var EC = (<any>protractor).ExpectedConditions;
|
|
|
|
// Waits for the element with id 'abc' to be present on the dom.
|
|
|
|
browser.wait(EC.presenceOf($(selector)), 20000);
|
|
|
|
}
|
|
|
|
|
|
|
|
describe('relative assets relative-app', () => {
|
|
|
|
|
|
|
|
afterEach(verifyNoBrowserErrors);
|
|
|
|
|
2016-05-02 01:54:19 -04:00
|
|
|
var URL = 'all/playground/src/relative_assets/';
|
2015-12-05 05:21:38 -05:00
|
|
|
|
|
|
|
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');
|
|
|
|
var elem = element(by.css('my-cmp .inner-container'));
|
2016-06-08 18:45:15 -04:00
|
|
|
var width = browser.executeScript(function(e: any /** TODO #9100 */) {
|
2015-12-05 05:21:38 -05:00
|
|
|
return parseInt(window.getComputedStyle(e).width);
|
|
|
|
}, elem.getWebElement());
|
|
|
|
|
|
|
|
expect(width).toBe(432);
|
|
|
|
});
|
|
|
|
});
|