Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 1ae7b31

Browse files
chalinwardbell
authored andcommitted
chore(e2e): fix user-input test
closes #2065 There seemed to be a timing issue. A simple rewrite using async/await seems to solve the problem.
1 parent 787ca16 commit 1ae7b31

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

public/docs/_examples/user-input/e2e-spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,15 @@ describe('User Input Tests', function () {
5454
});
5555
});
5656

57-
it('should be able to filter key events', function () {
57+
it('should be able to filter key events', async () => {
5858
let mainEle = element(by.css('key-up3'));
5959
let inputEle = mainEle.element(by.css('input'));
6060
let outputTextEle = mainEle.element(by.css('p'));
6161
expect(outputTextEle.getText()).toEqual('');
62-
return sendKeys(inputEle, 'abc').then(function() {
63-
expect(outputTextEle.getText()).toEqual('', 'should be blank - have not sent enter yet');
64-
return sendKeys(inputEle, protractor.Key.ENTER);
65-
}).then(function() {
66-
expect(outputTextEle.getText()).toEqual('abc');
67-
});
62+
await sendKeys(inputEle, 'abc');
63+
expect(outputTextEle.getText()).toEqual('', 'should be blank - have not sent enter yet');
64+
await sendKeys(inputEle, protractor.Key.ENTER);
65+
expect(outputTextEle.getText()).toEqual('abc');
6866
});
6967

7068
it('should be able to filter blur events', function () {

0 commit comments

Comments
 (0)