Skip to content

Commit

Permalink
fix: LT device allocation (#1482)
Browse files Browse the repository at this point in the history
  • Loading branch information
saikrishna321 authored Dec 17, 2024
1 parent c793541 commit 357c094
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions serverConfig/lt-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"port": 31337,
"plugin": {
"device-farm": {
"platform": "android",
"platform": "ios",
"cloud": {
"cloudName": "lambdatest",
"url": "https://mobile-hub.lambdatest.com/wd/hub",
"devices": [
{
"platformVersion": "11",
"deviceName": "Pixel 3a",
"platform": "android"
"platformVersion": "14",
"deviceName": "iPhone.*",
"platform": "ios"
}
]
}
Expand Down
21 changes: 8 additions & 13 deletions src/device-managers/cloud/CapabilityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,14 @@ export default class CapabilityManager {
}

getCapability() {
if(this.freeDevice.cloud.toLowerCase() !== Cloud.LAMBDATEST) {
const entries = Object.entries(this.freeDevice.capability);
if (!this.capabilities.alwaysMatch) {
this.capabilities.alwaysMatch = {};
}

entries.map(([key, val]) => {
this.capabilities.alwaysMatch[`appium:${key}`] = val;
});
if (this.freeDevice.cloud.toLowerCase() === Cloud.PCLOUDY) {
this.capabilities.alwaysMatch['appium:pCloudy_ApiKey'] = process.env.CLOUD_KEY;
this.capabilities.alwaysMatch['appium:pCloudy_Username'] = process.env.CLOUD_USERNAME;
}
const capsToUpdate = this.capabilities.firstMatch? this.capabilities.firstMatch[0] : this.capabilities.alwaysMatch;
const entries = Object.entries(this.freeDevice.capability);
entries.map(([key, val]) => {
capsToUpdate[`appium:${key}`] = val;
});
if (this.freeDevice.cloud.toLowerCase() === Cloud.PCLOUDY) {
capsToUpdate['appium:pCloudy_ApiKey'] = process.env.CLOUD_KEY;
capsToUpdate['appium:pCloudy_Username'] = process.env.CLOUD_USERNAME;
}
return this.capabilities;
}
Expand Down

0 comments on commit 357c094

Please sign in to comment.