forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton-e2e.spec.ts
More file actions
26 lines (20 loc) · 958 Bytes
/
Copy pathbutton-e2e.spec.ts
File metadata and controls
26 lines (20 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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(await 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(await 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');
});
});
});