This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(driverProviders): Add TestObject and Kobiton as driverProviders
feat(driverProviders): Add TestObject and Kobiton as driverProviders 1. Add testObject and kobiton to driverProviders 2. Add testObject and kobiton items to cli, config and index 3. Add instructions for using testObject and kobiton to server-setup
- Loading branch information
1 parent
83e2ba8
commit 6ba30e0
Showing
6 changed files
with
142 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* This is an implementation of the Kobiton Driver Provider. | ||
* It is responsible for setting up the account object, tearing | ||
* it down, and setting up the driver correctly. | ||
*/ | ||
import * as q from 'q'; | ||
import {Config} from '../config'; | ||
import {Logger} from '../logger'; | ||
import {DriverProvider} from './driverProvider'; | ||
|
||
let logger = new Logger('kobiton'); | ||
|
||
export class Kobiton extends DriverProvider { | ||
constructor(config: Config) { | ||
super(config); | ||
} | ||
|
||
/** | ||
* Configure and launch (if applicable) the object's environment. | ||
* @return {q.promise} A promise which will resolve when the environment is | ||
* ready to test. | ||
*/ | ||
protected setupDriverEnv(): q.Promise<any> { | ||
let deferred = q.defer(); | ||
this.config_.capabilities['kobitonUser'] = this.config_.kobitonUser; | ||
this.config_.capabilities['kobitonKey'] = this.config_.kobitonKey; | ||
this.config_.seleniumAddress = 'https://' + this.config_.kobitonUser + ':' + | ||
this.config_.kobitonKey + '@api.kobiton.com/wd/hub'; | ||
|
||
logger.info('Using Kobiton selenium server at ' + this.config_.seleniumAddress); | ||
deferred.resolve(); | ||
return deferred.promise; | ||
} | ||
} |
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,33 @@ | ||
/* | ||
* This is an implementation of the TestObject Driver Provider. | ||
* It is responsible for setting up the account object, tearing | ||
* it down, and setting up the driver correctly. | ||
*/ | ||
import * as q from 'q'; | ||
import {Config} from '../config'; | ||
import {Logger} from '../logger'; | ||
import {DriverProvider} from './driverProvider'; | ||
|
||
let logger = new Logger('testobject'); | ||
|
||
export class TestObject extends DriverProvider { | ||
constructor(config: Config) { | ||
super(config); | ||
} | ||
|
||
/** | ||
* Configure and launch (if applicable) the object's environment. | ||
* @return {q.promise} A promise which will resolve when the environment is | ||
* ready to test. | ||
*/ | ||
protected setupDriverEnv(): q.Promise<any> { | ||
let deferred = q.defer(); | ||
this.config_.capabilities['testobject.user'] = this.config_.testobjectUser; | ||
this.config_.capabilities['testobject_api_key'] = this.config_.testobjectKey; | ||
this.config_.seleniumAddress = 'https://us1.appium.testobject.com/wd/hub'; | ||
|
||
logger.info('Using TestObject selenium server at ' + this.config_.seleniumAddress); | ||
deferred.resolve(); | ||
return deferred.promise; | ||
} | ||
} |