Files
angular__angular/e2e/components/button/button.e2e.ts
T
Kristiyan Kostadinov 50f1c266ef refactor: switch e2e tests to async/await (#4705)
* refactor: switch e2e tests to async/await

Switches to using async/await in the e2e tests. This should make it a bit easier to deal with Protractor's async APIs.

* chore: remove the async wrapper
2017-06-01 08:49:20 -07:00

27 lines
949 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');
});
});
});