diff --git a/docs/cloud.md b/docs/cloud.md index a189fe23f..8e2692e12 100644 --- a/docs/cloud.md +++ b/docs/cloud.md @@ -32,3 +32,11 @@ CLOUD_KEY="apiKey" CLOUD_USERNAME="useremail" appium server -ka 800 --use-plugin ``` Make sure all `appiumVersion: 2.0` in your capabilities. Refer on LambdaTest config [here](https://github.com/AppiumTestDistribution/appium-device-farm/blob/main/serverConfig/lt-config.json) + + +### HeadSpin + +``` +appium server -ka 800 --use-plugins=device-farm --config ./serverConfig/hs-config.json +``` +Refer on HeadSpin config [here](https://github.com/AppiumTestDistribution/appium-device-farm/blob/main/serverConfig/hs-config.json). diff --git a/serverConfig/hs-config.json b/serverConfig/hs-config.json new file mode 100644 index 000000000..153ad92a5 --- /dev/null +++ b/serverConfig/hs-config.json @@ -0,0 +1,21 @@ +{ + "server": { + "port": 31337, + "plugin": { + "device-farm": { + "platform": "android", + "cloud": { + "cloudName": "headspin", + "url": "https://appium-canary.headspin.io/v0/api-token/wd/hub", + "devices": [ + { + "platformVersion": "12", + "deviceName": "android", + "platform": "android" + } + ] + } + } + } + } +} diff --git a/src/device-managers/cloud/Devices.ts b/src/device-managers/cloud/Devices.ts index 7a83cee35..3c7480315 100644 --- a/src/device-managers/cloud/Devices.ts +++ b/src/device-managers/cloud/Devices.ts @@ -36,7 +36,7 @@ export default class Devices { udid: d.deviceName, }; } - if (this.isSauceLabs() || this.isLambdaTest()) { + if (this.isSauceLabs() || this.isLambdaTest() || this.isHeadSpin()) { this.validateSchema(sauceOrLambdaSchema); cloudDeviceProperties = { name: d.deviceName, @@ -89,4 +89,8 @@ export default class Devices { private isSauceLabs() { return this.cloud.cloudName.toLowerCase() === Cloud.SAUCELABS; } + + private isHeadSpin() { + return this.cloud.cloudName.toLowerCase() === Cloud.HEADSPIN; + } } diff --git a/src/enums/Cloud.ts b/src/enums/Cloud.ts index edf65ddcb..57335645a 100644 --- a/src/enums/Cloud.ts +++ b/src/enums/Cloud.ts @@ -3,6 +3,7 @@ enum Cloud { PCLOUDY = 'pcloudy', SAUCELABS = 'sauce', LAMBDATEST = 'lambdatest', + HEADSPIN = 'headspin', } export default Cloud; diff --git a/src/helpers.ts b/src/helpers.ts index 3d57b8aa9..a81f57bd6 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -76,6 +76,8 @@ export function nodeUrl(device: IDevice, basePath = ''): string { if (device.hasOwnProperty('cloud')) { if (device.cloud.toLowerCase() === Cloud.PCLOUDY) { return `${host}/wd/hub`; + } else if (device.cloud.toLowerCase() === Cloud.HEADSPIN) { + return `${host}`; } else { return `https://${process.env.CLOUD_USERNAME}:${process.env.CLOUD_KEY}@${ new URL(device.host).host