|
1 |
| -describe('angularjs homepage', function() { |
2 |
| - it('should greet the named user', function() { |
3 |
| - browser.get('http://www.angularjs.org'); |
| 1 | +describe('angularjs homepage', () => { |
| 2 | + it('should greet the named user', async () => { |
| 3 | + await browser.get('http://www.angularjs.org'); |
4 | 4 |
|
5 |
| - element(by.model('yourName')).sendKeys('Julie'); |
6 |
| - |
7 |
| - var greeting = element(by.binding('yourName')); |
8 |
| - |
9 |
| - expect(greeting.getText()).toEqual('Hello Julie!'); |
| 5 | + await element(by.model('yourName')).sendKeys('Julie'); |
| 6 | + const greeting = element(by.binding('yourName')); |
| 7 | + expect(await greeting.getText()).toEqual('Hello Julie!'); |
10 | 8 | });
|
11 | 9 |
|
12 |
| - describe('todo list', function() { |
13 |
| - var todoList; |
14 |
| - |
15 |
| - beforeEach(function() { |
16 |
| - browser.get('http://www.angularjs.org'); |
| 10 | + describe('todo list', () => { |
| 11 | + let todoList; |
17 | 12 |
|
| 13 | + beforeEach(async () => { |
| 14 | + await browser.get('http://www.angularjs.org'); |
18 | 15 | todoList = element.all(by.repeater('todo in todoList.todos'));
|
19 | 16 | });
|
20 | 17 |
|
21 |
| - it('should list todos', function() { |
22 |
| - expect(todoList.count()).toEqual(2); |
23 |
| - expect(todoList.get(1).getText()).toEqual('build an AngularJS app'); |
| 18 | + it('should list todos', async () => { |
| 19 | + expect(await todoList.count()).toEqual(2); |
| 20 | + expect(await todoList.get(1).getText()).toEqual('build an AngularJS app'); |
24 | 21 | });
|
25 | 22 |
|
26 |
| - it('should add a todo', function() { |
27 |
| - var addTodo = element(by.model('todoList.todoText')); |
28 |
| - var addButton = element(by.css('[value="add"]')); |
| 23 | + it('should add a todo', async () => { |
| 24 | + const addTodo = element(by.model('todoList.todoText')); |
| 25 | + const addButton = element(by.css('[value="add"]')); |
29 | 26 |
|
30 |
| - addTodo.sendKeys('write a protractor test'); |
31 |
| - addButton.click(); |
| 27 | + await addTodo.sendKeys('write a protractor test'); |
| 28 | + await addButton.click(); |
32 | 29 |
|
33 |
| - expect(todoList.count()).toEqual(3); |
34 |
| - expect(todoList.get(2).getText()).toEqual('write a protractor test'); |
| 30 | + expect(await todoList.count()).toEqual(3); |
| 31 | + expect(await todoList.get(2).getText()) |
| 32 | + .toEqual('write a protractor test'); |
35 | 33 | });
|
36 | 34 | });
|
37 | 35 | });
|
0 commit comments