Files
angular__angular/e2e/components/input-e2e.spec.ts
T
robindijkhof 20e704b074 test(input): add textarea e2e test (#5517)
* e2e(input): add textarea e2e test

* test(input): remove fdescribe
2017-07-06 15:53:21 -07:00

57 lines
1.5 KiB
TypeScript

import {browser, by, element} from 'protractor';
describe('input', () => {
describe('text input', () => {
beforeEach(() => browser.get('/input'));
it('should update input value when user types', () => {
let input = element(by.id('text-input'));
input.sendKeys('abc123');
expect(input.getAttribute('value')).toBe('abc123');
});
});
describe('number input', () => {
beforeEach(() => browser.get('/input'));
it('should update input value when user types', () => {
let input = element(by.id('number-input'));
input.sendKeys('abc123');
expect(input.getAttribute('value')).toBe('123');
});
it('should increment when increment button clicked', async () => {
const input = element(by.id('number-input'));
input.click();
const size = await input.getSize();
browser.actions()
.mouseMove(input, {x: size.width - 5, y: 5})
.click()
.perform();
expect(input.getAttribute('value')).toBe('1');
browser.actions()
.mouseMove(input, {x: size.width - 5, y: size.height - 5})
.click()
.perform();
expect(input.getAttribute('value')).toBe('0');
});
});
describe('textarea', () => {
beforeEach(() => browser.get('/input'));
it('should update input value when user types', () => {
let input = element(by.id('text-area'));
input.sendKeys('abc123');
expect(input.getAttribute('value')).toBe('abc123');
});
});
});