-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #812 from wordpress-mobile/update/appium-improvements
e2e test improvements
- Loading branch information
Showing
15 changed files
with
2,487 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* @flow | ||
* @format | ||
* */ | ||
|
||
/** | ||
* External dependencies | ||
*/ | ||
import childProcess from 'child_process'; | ||
|
||
// Spawns an appium process | ||
export const start = ( localAppiumPort: number ) => new Promise < childProcess.ChildProcess > ( ( resolve, reject ) => { | ||
const appium = childProcess.spawn( 'appium', [ | ||
'--port', localAppiumPort.toString(), | ||
'--log', './appium-out.log', | ||
'--log-no-colors', | ||
] ); | ||
|
||
let appiumOutputBuffer = ''; | ||
let resolved = false; | ||
appium.stdout.on( 'data', ( data ) => { | ||
if ( ! resolved ) { | ||
appiumOutputBuffer += data.toString(); | ||
if ( appiumOutputBuffer.indexOf( 'Appium REST http interface listener started' ) >= 0 ) { | ||
resolved = true; | ||
resolve( appium ); | ||
} | ||
} | ||
} ); | ||
|
||
appium.on( 'close', ( code ) => { | ||
if ( ! resolved ) { | ||
reject( new Error( `Appium process exited with code ${ code }` ) ); | ||
} | ||
} ); | ||
} ); | ||
|
||
export const stop = async ( appium: ?childProcess.ChildProcess ) => { | ||
if ( ! appium ) { | ||
return; | ||
} | ||
await appium.kill( 'SIGINT' ); | ||
}; | ||
|
||
export default { | ||
start, | ||
stop, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.