Files
angular__angular/e2e/components/input-e2e.spec.ts
T
Kristiyan Kostadinov 8e6bee8116 chore: reorganize e2e test files (#5032)
* Renames the e2e test file to match the pattern of `{{component}}-e2e.spec.ts`.
* Flattens the directory structure in the `e2e` directory. Having a separate dir for each component was overkill since only have one file per component.
* Fixes some inconsistent code styles in the Protractor config.

Fixes #5030.
2017-06-09 16:09:08 -07:00

47 lines
1.2 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');
});
});
});