2016-12-19 20:17:23 +02:00
|
|
|
import {browser, by, element} from 'protractor';
|
2017-01-12 13:24:51 -08:00
|
|
|
import {screenshot} from '../../screenshot';
|
|
|
|
|
|
2016-12-19 20:17:23 +02:00
|
|
|
|
2016-04-04 11:32:29 -07:00
|
|
|
describe('button', function () {
|
|
|
|
|
describe('disabling behavior', function () {
|
|
|
|
|
beforeEach(function() {
|
|
|
|
|
browser.get('/button');
|
|
|
|
|
});
|
2017-01-12 13:24:51 -08:00
|
|
|
|
2016-04-04 11:32:29 -07:00
|
|
|
it('should prevent click handlers from executing when disabled', function () {
|
2016-06-24 11:34:49 -07:00
|
|
|
element(by.id('test-button')).click();
|
|
|
|
|
expect(element(by.id('click-counter')).getText()).toEqual('1');
|
2017-01-12 13:24:51 -08:00
|
|
|
screenshot('clicked once');
|
2016-04-04 11:32:29 -07:00
|
|
|
|
2016-06-24 11:34:49 -07:00
|
|
|
element(by.id('disable-toggle')).click();
|
|
|
|
|
element(by.id('test-button')).click();
|
|
|
|
|
expect(element(by.id('click-counter')).getText()).toEqual('1');
|
2017-01-12 13:24:51 -08:00
|
|
|
screenshot('click disabled');
|
2016-04-04 11:32:29 -07:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|