Files
angular__angular/e2e/components/fullscreen-e2e.spec.ts
T
Kristiyan Kostadinov 8e6bee8116 chore: reorganize e2e test files (#5032)
* 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.
2017-06-09 16:09:08 -07:00

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.');
}
});