File tree 3 files changed +16
-16
lines changed
3 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -26,16 +26,13 @@ export default function setup(): void {
26
26
args : [ path . join ( __dirname , '..' ) ] ,
27
27
webdriverOptions : { }
28
28
} ) ;
29
- await this . app . start ( ) ;
30
- const browser = this . app . client ;
31
- await browser . waitUntilWindowLoaded ( ) ;
32
29
33
- browser . timeouts ( 'script' , 15000 ) ;
30
+ await this . app . start ( ) ;
34
31
} ) ;
35
32
36
- afterEach ( function ( ) {
33
+ afterEach ( async function ( ) {
37
34
if ( this . app && this . app . isRunning ( ) ) {
38
- return this . app . stop ( ) ;
35
+ await this . app . stop ( ) ;
39
36
}
40
37
} ) ;
41
38
}
Original file line number Diff line number Diff line change @@ -4,24 +4,26 @@ import { SpectronClient } from 'spectron';
4
4
import commonSetup from './common-setup' ;
5
5
6
6
describe ( 'angular-electron App' , function ( ) {
7
+
7
8
commonSetup . apply ( this ) ;
8
9
9
- let browser : any ;
10
10
let client : SpectronClient ;
11
11
12
- beforeEach ( function ( ) {
13
- client = this . app . client ;
14
- browser = client as any ;
15
- } ) ;
12
+ beforeEach ( async function ( ) {
13
+ await this . app . start ( ) ;
16
14
17
- it ( 'should display message saying App works !' , async function ( ) {
18
- const text = await browser . getText ( 'app-home h1' ) ;
19
- expect ( text ) . to . equal ( 'App works !' ) ;
15
+ client = this . app . client ;
20
16
} ) ;
21
17
22
18
it ( 'creates initial windows' , async function ( ) {
23
19
const count = await client . getWindowCount ( ) ;
24
20
expect ( count ) . to . equal ( 1 ) ;
25
21
} ) ;
26
22
23
+ it ( 'should display message saying App works !' , async function ( ) {
24
+ const elem = await client . $ ( 'app-home h1' ) ;
25
+ const text = await elem . getText ( ) ;
26
+ expect ( text ) . to . equal ( 'App works !' ) ;
27
+ } ) ;
28
+
27
29
} ) ;
Original file line number Diff line number Diff line change 4
4
"outDir" : " ../out-tsc/e2e" ,
5
5
"module" : " commonjs" ,
6
6
"types" : [
7
- " mocha"
7
+ " mocha" ,
8
+ " node"
8
9
]
9
10
},
10
11
"include" : [
11
- " e2e/**/* .ts"
12
+ " e2e/*.ts"
12
13
]
13
14
}
You can’t perform that action at this time.
0 commit comments