@@ -8,8 +8,8 @@ describe('ElementFinder', function() {
8
8
await browser . get ( 'index.html#/form' ) ;
9
9
const nameByElement = element ( by . binding ( 'username' ) ) ;
10
10
11
- expect ( await nameByElement . getText ( ) )
12
- . toEqual ( await browser . findElement ( by . binding ( 'username' ) ) . getText ( ) ) ;
11
+ await expect ( nameByElement . getText ( ) )
12
+ . toEqual ( browser . findElement ( by . binding ( 'username' ) ) . getText ( ) ) ;
13
13
} ) ;
14
14
15
15
it ( 'should wait to grab the WebElement until a method is called' , async function ( ) {
@@ -19,11 +19,11 @@ describe('ElementFinder', function() {
19
19
20
20
await browser . get ( 'index.html#/form' ) ;
21
21
22
- expect ( await name . getText ( ) ) . toEqual ( 'Anon' ) ;
22
+ await expect ( name . getText ( ) ) . toEqual ( 'Anon' ) ;
23
23
24
24
await usernameInput . clear ( ) ;
25
25
await usernameInput . sendKeys ( 'Jane' ) ;
26
- expect ( await name . getText ( ) ) . toEqual ( 'Jane' ) ;
26
+ await expect ( name . getText ( ) ) . toEqual ( 'Jane' ) ;
27
27
} ) ;
28
28
29
29
it ( 'should chain element actions' , async function ( ) {
@@ -32,10 +32,10 @@ describe('ElementFinder', function() {
32
32
const usernameInput = element ( by . model ( 'username' ) ) ;
33
33
const name = element ( by . binding ( 'username' ) ) ;
34
34
35
- expect ( await name . getText ( ) ) . toEqual ( 'Anon' ) ;
35
+ await expect ( name . getText ( ) ) . toEqual ( 'Anon' ) ;
36
36
37
37
await ( ( usernameInput . clear ( ) as any ) as ElementFinder ) . sendKeys ( 'Jane' ) ;
38
- expect ( await name . getText ( ) ) . toEqual ( 'Jane' ) ;
38
+ await expect ( name . getText ( ) ) . toEqual ( 'Jane' ) ;
39
39
} ) ;
40
40
41
41
it ( 'should run chained element actions in sequence' , function ( done : any ) {
@@ -75,8 +75,8 @@ describe('ElementFinder', function() {
75
75
76
76
await browser . get ( 'index.html#/conflict' ) ;
77
77
78
- expect ( await reused . getText ( ) ) . toEqual ( 'Inner: inner' ) ;
79
- expect ( await reused . isPresent ( ) ) . toBe ( true ) ;
78
+ await expect ( reused . getText ( ) ) . toEqual ( 'Inner: inner' ) ;
79
+ await expect ( reused . isPresent ( ) ) . toBe ( true ) ;
80
80
} ) ;
81
81
82
82
it ( 'should differentiate elements with the same binding by chaining' , async function ( ) {
@@ -85,8 +85,8 @@ describe('ElementFinder', function() {
85
85
const outerReused = element ( by . binding ( 'item.reusedBinding' ) ) ;
86
86
const innerReused = element ( by . id ( 'baz' ) ) . element ( by . binding ( 'item.reusedBinding' ) ) ;
87
87
88
- expect ( await outerReused . getText ( ) ) . toEqual ( 'Outer: outer' ) ;
89
- expect ( await innerReused . getText ( ) ) . toEqual ( 'Inner: inner' ) ;
88
+ await expect ( outerReused . getText ( ) ) . toEqual ( 'Outer: outer' ) ;
89
+ await expect ( innerReused . getText ( ) ) . toEqual ( 'Inner: inner' ) ;
90
90
} ) ;
91
91
92
92
it ( 'should chain deeper than 2' , async function ( ) {
@@ -96,7 +96,7 @@ describe('ElementFinder', function() {
96
96
97
97
await browser . get ( 'index.html#/conflict' ) ;
98
98
99
- expect ( await reused . getText ( ) ) . toEqual ( 'Inner: inner' ) ;
99
+ await expect ( reused . getText ( ) ) . toEqual ( 'Inner: inner' ) ;
100
100
} ) ;
101
101
102
102
it ( 'should allow handling errors' , async function ( ) {
@@ -129,8 +129,8 @@ describe('ElementFinder', function() {
129
129
const byCss = by . css ( 'body' ) ;
130
130
const byBinding = by . binding ( 'greet' ) ;
131
131
132
- expect ( await element ( byCss ) . locator ( ) ) . toEqual ( byCss ) ;
133
- expect ( await element ( byBinding ) . locator ( ) ) . toEqual ( byBinding ) ;
132
+ await expect ( element ( byCss ) . locator ( ) ) . toEqual ( byCss ) ;
133
+ await expect ( element ( byBinding ) . locator ( ) ) . toEqual ( byBinding ) ;
134
134
} ) ;
135
135
136
136
it ( 'should propagate exceptions' , async function ( ) {
@@ -144,7 +144,7 @@ describe('ElementFinder', function() {
144
144
function ( ) {
145
145
return false ;
146
146
} as any as ( ( ) => ppromise . Promise < void > ) ) ;
147
- expect ( await successful ) . toEqual ( false ) ;
147
+ await expect ( successful ) . toEqual ( false ) ;
148
148
} ) ;
149
149
150
150
it ( 'should be returned from a helper without infinite loops' , async function ( ) {
@@ -154,7 +154,7 @@ describe('ElementFinder', function() {
154
154
} ) ;
155
155
156
156
await helperPromise . then ( async function ( finalResult : ElementFinder ) {
157
- expect ( await finalResult . getText ( ) ) . toEqual ( 'Hiya' ) ;
157
+ await expect ( finalResult . getText ( ) ) . toEqual ( 'Hiya' ) ;
158
158
} as any as ( ( ) => ppromise . Promise < void > ) ) ;
159
159
} ) ;
160
160
@@ -169,8 +169,8 @@ describe('ElementFinder', function() {
169
169
170
170
const name = element ( by . binding ( 'username' ) ) ;
171
171
172
- expect ( await name . getText ( ) ) . toEqual ( 'Anon' ) ;
173
- expect ( await name . getText ( ) . then ( null , function ( ) { } ) ) . toEqual ( 'Anon' ) ;
172
+ await expect ( name . getText ( ) ) . toEqual ( 'Anon' ) ;
173
+ await expect ( name . getText ( ) . then ( null , function ( ) { } ) ) . toEqual ( 'Anon' ) ;
174
174
175
175
} ) ;
176
176
@@ -180,7 +180,7 @@ describe('ElementFinder', function() {
180
180
const usernameInput = element ( by . model ( 'username' ) ) ;
181
181
const name = element ( by . binding ( 'username' ) ) ;
182
182
183
- expect ( await usernameInput . equals ( usernameInput ) ) . toEqual ( true ) ;
184
- expect ( await usernameInput . equals ( name ) ) . toEqual ( false ) ;
183
+ await expect ( usernameInput . equals ( usernameInput ) ) . toEqual ( true ) ;
184
+ await expect ( usernameInput . equals ( name ) ) . toEqual ( false ) ;
185
185
} ) ;
186
186
} ) ;
0 commit comments