|
1 |
| -import { browser, element, by } from 'protractor'; |
| 1 | +import {browser, $} from 'protractor'; |
2 | 2 | import { loadServerView, loadClientView } from './e2e.utils';
|
3 | 3 |
|
4 | 4 | describe('e2e test preboot', function () {
|
5 | 5 |
|
6 | 6 | it('should validate server view', function () {
|
7 | 7 | loadServerView()
|
8 |
| - .then(() => element(by.css('h1')).getText()) |
| 8 | + .then(() => $('h1').getText()) |
9 | 9 | .then(text => expect(text).toEqual('server view'));
|
10 | 10 | });
|
11 | 11 |
|
12 | 12 | it('should validate basic client view', function () {
|
13 | 13 | loadServerView()
|
14 | 14 | .then(() => loadClientView())
|
15 |
| - .then(() => element(by.css('h1')).getText()) |
| 15 | + .then(() => $('h1').getText()) |
16 | 16 | .then(text => expect(text).toEqual('client view'));
|
17 | 17 | });
|
18 | 18 |
|
19 | 19 | it('should validate typing input to a text box', function () {
|
20 | 20 | const input = 'foo man choo';
|
21 | 21 |
|
22 | 22 | loadServerView()
|
23 |
| - .then(() => element(by.css('#myTextBox')).click()) |
| 23 | + .then(() => $('#myTextBox').click()) |
24 | 24 | .then(() => browser.actions().sendKeys(input).perform())
|
25 | 25 | .then(() => loadClientView())
|
26 |
| - .then(() => element(by.css('#myTextBox')).getAttribute('value')) |
| 26 | + .then(() => $('#myTextBox').getAttribute('value')) |
27 | 27 | .then(actual => expect(actual).toEqual(input));
|
28 | 28 | });
|
29 | 29 |
|
30 | 30 | it('should validate choosing from a select', function () {
|
31 | 31 | const expected = 'foo';
|
32 | 32 |
|
33 | 33 | loadServerView()
|
34 |
| - .then(() => element(by.css('#mySelect')).click()) |
35 |
| - .then(() => element(by.css('#myVal')).click()) |
| 34 | + .then(() => $('#mySelect').click()) |
| 35 | + .then(() => $('#myVal').click()) |
36 | 36 | .then(() => loadClientView())
|
37 |
| - .then(() => element(by.css('#mySelect')).element(by.css('option:checked')).getText()) |
| 37 | + .then(() => $('#mySelect').$('option:checked').getText()) |
38 | 38 | .then(actual => expect(actual).toEqual(expected));
|
39 | 39 | });
|
40 | 40 | });
|
0 commit comments