Files
angular__angular/e2e/components/button-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

27 lines
946 B
TypeScript

import {browser, by, element, ExpectedConditions} from 'protractor';
import {screenshot} from '../screenshot';
describe('button', () => {
describe('disabling behavior', () => {
beforeEach(() => browser.get('/button'));
it('should prevent click handlers from executing when disabled', async () => {
element(by.id('test-button')).click();
expect(element(by.id('click-counter')).getText()).toEqual('1');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('clicked once');
element(by.id('disable-toggle')).click();
element(by.id('test-button')).click();
expect(element(by.id('click-counter')).getText()).toEqual('1');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('click disabled');
});
});
});