@@ -5,39 +5,37 @@ const { expect } = require('chai')
5
5
// to run this example just run
6
6
// mocha path/to/this/file
7
7
8
- describe ( 'When searching on google' , function ( ) {
9
- it ( 'shows results' , async function ( ) {
10
- this . timeout ( 10000 ) ; //we need to increase the timeout or else mocha will exit with an error
8
+ describe ( 'When searching on google' , function ( ) {
9
+ it ( 'shows results' , async function ( ) {
10
+ this . timeout ( 10000 ) //we need to increase the timeout or else mocha will exit with an error
11
11
const chromeless = new Chromeless ( )
12
12
13
- await chromeless . goto ( 'https://google.com' )
13
+ await chromeless
14
+ . goto ( 'https://google.com' )
14
15
. wait ( 'input[name="q"]' )
15
16
. type ( 'chromeless github' , 'input[name="q"]' )
16
17
. press ( 13 ) // press enter
17
18
. wait ( '#resultStats' )
18
19
19
-
20
20
const result = await chromeless . exists ( 'a[href*="graphcool/chromeless"]' )
21
21
22
-
23
22
expect ( result ) . to . be . true
24
23
await chromeless . end ( )
25
24
} )
26
25
} )
27
26
28
- describe ( 'When clicking on the image of the demo playground' , function ( ) {
29
- it ( 'should redirect to the demo' , async function ( ) {
30
- this . timeout ( 10000 ) ; //we need to increase the timeout or else mocha will exit with an error
27
+ describe ( 'When clicking on the image of the demo playground' , function ( ) {
28
+ it ( 'should redirect to the demo' , async function ( ) {
29
+ this . timeout ( 10000 ) //we need to increase the timeout or else mocha will exit with an error
31
30
const chromeless = new Chromeless ( )
32
- await chromeless . goto ( 'https://github.com/graphcool/chromeless' )
31
+ await chromeless
32
+ . goto ( 'https://github.com/graphcool/chromeless' )
33
33
. wait ( 'a[href="https://chromeless.netlify.com/"]' )
34
34
. click ( 'a[href="https://chromeless.netlify.com/"]' )
35
35
. wait ( '#root' )
36
36
37
-
38
37
const url = await chromeless . evaluate ( url => window . location . href )
39
38
40
-
41
39
expect ( url ) . to . match ( / ^ h t t p s \: \/ \/ c h r o m e l e s s \. n e t l i f y \. c o m / )
42
40
await chromeless . end ( )
43
41
} )
0 commit comments