mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
8e6bee8116
* Renames the e2e test file to match the pattern of `{{component}}-e2e.spec.ts`.
* Flattens the directory structure in the `e2e` directory. Having a separate dir for each component was overkill since only have one file per component.
* Fixes some inconsistent code styles in the Protractor config.
Fixes #5030.
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import {browser, by, element} from 'protractor';
|
|
|
|
describe('fullscreen', () => {
|
|
|
|
beforeEach(() => browser.get('/fullscreen'));
|
|
|
|
it('should open a dialog inside a fullscreen element and move it to the document body', () => {
|
|
element(by.id('fullscreen-open')).click();
|
|
element(by.id('dialog-open')).click();
|
|
|
|
expectOverlayInFullscreen();
|
|
|
|
element(by.id('dialog-fullscreen-exit')).click();
|
|
expectOverlayInBody();
|
|
});
|
|
|
|
it('should open a dialog inside the document body and move it to a fullscreen element', () => {
|
|
element(by.id('dialog-open')).click();
|
|
expectOverlayInBody();
|
|
|
|
element(by.id('dialog-fullscreen-open')).click();
|
|
expectOverlayInFullscreen();
|
|
|
|
element(by.id('dialog-fullscreen-exit')).click();
|
|
expectOverlayInBody();
|
|
});
|
|
|
|
/** Expects the overlay container to be inside of the body element. */
|
|
function expectOverlayInBody() {
|
|
expect(browser.isElementPresent(by.css('body > .cdk-overlay-container')))
|
|
.toBe(true, 'Expected the overlay container to be inside of the body.');
|
|
}
|
|
|
|
/** Expects the overlay container to be in fullscreen mode. */
|
|
function expectOverlayInFullscreen() {
|
|
expect(browser.isElementPresent(by.css('#fullscreen-pane > .cdk-overlay-container')))
|
|
.toBe(true, 'Expected the overlay container to be in fullscreen mode.');
|
|
}
|
|
|
|
});
|