mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
3beccb9e70
* Update e2e tests, take screenshots when screen become stable * fix lint * Make id optional * Remove screenshot for checkbox with keyboard event * Fix radio test
25 lines
957 B
TypeScript
25 lines
957 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', () => {
|
|
element(by.id('test-button')).click();
|
|
expect(element(by.id('click-counter')).getText()).toEqual('1');
|
|
browser.wait(ExpectedConditions.not(
|
|
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
|
|
.then(() => screenshot('clicked once'));
|
|
|
|
element(by.id('disable-toggle')).click();
|
|
element(by.id('test-button')).click();
|
|
expect(element(by.id('click-counter')).getText()).toEqual('1');
|
|
browser.wait(ExpectedConditions.not(
|
|
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
|
|
.then(() => screenshot('click disabled'));
|
|
});
|
|
});
|
|
});
|