File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " selenium-appium" ,
3
- "version" : " 0.0.3 " ,
3
+ "version" : " 0.0.4 " ,
4
4
"description" : " A brdige to make selenium-webdriver to drive appium to do native app testing" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ interface IAppiumWaitUntilFound {
16
16
getByclassName ( className : string , timeout ?: number , message ?: string ) : WebElementPromise ;
17
17
}
18
18
19
- export interface IAppiumDriver extends IAppiumWaitUntilFound
20
- {
19
+ export interface IAppiumDriver extends IAppiumWaitUntilFound {
21
20
start ( ) : Promise < void > ;
22
21
stop ( ) : Promise < void > ;
23
22
restart ( ) : Promise < void > ;
@@ -67,22 +66,22 @@ class AppiumDriver implements IAppiumDriver {
67
66
}
68
67
69
68
start ( ) : Promise < void > {
70
- return new Promise < void > ( resolve => {
69
+ return new Promise < void > ( ( resolve , reject ) => {
71
70
new Builder ( )
72
71
. usingServer ( this . url_ )
73
72
. withCapabilities ( this . capabilities_ )
74
73
. build ( )
75
74
. then ( driver => { this . webDriver = driver ; resolve ( ) ; } )
76
- . catch ( e => { this . error_ = e ; throw e ; } ) ;
75
+ . catch ( e => { this . error_ = e ; reject ( e ) } ) ;
77
76
} ) ;
78
77
}
79
78
80
79
stop ( ) : Promise < void > {
81
- return new Promise < void > ( resolve => {
80
+ return new Promise < void > ( ( resolve , reject ) => {
82
81
this . webDriver && this . webDriver
83
82
. quit ( )
84
83
. then ( ( ) => resolve ( ) )
85
- . catch ( e => { this . error_ = e ; throw e } ) ;
84
+ . catch ( e => { this . error_ = e ; reject ( e ) } ) ;
86
85
resolve ( ) ;
87
86
} ) ;
88
87
}
You can’t perform that action at this time.
0 commit comments