Skip to content

Commit

Permalink
Fix capability checks for skipReport (#1120)
Browse files Browse the repository at this point in the history
* Fix capability checks for skipReport

* bump up version for release
  • Loading branch information
sudharsan-selvaraj authored May 17, 2024
1 parent 85cfb0b commit d511162
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "appium-device-farm",
"version": "8.4.7-rc.31",
"version": "8.4.7-rc.32",
"description": "An appium 2.0 plugin that manages and create driver session on available devices",
"main": "./lib/src/main.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/CapabilityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ function deleteAlwaysMatch(caps: ISessionCapability, capabilityName: string) {
}

async function findAppPath(caps: any) {
if (caps.firstMatch[0]['df:skipReport']) return;
const fileName = _.has(caps, 'alwaysMatch') ? caps.alwaysMatch['appium:app'] : caps.firstMatch[0]['appium:app'];
const mergedCaps = Object.assign({}, caps.firstMatch ? caps.firstMatch[0] : {}, caps.alwaysMatch);
if (mergedCaps['df:skipReport']) return;
const fileName = mergedCaps['appium:app'];
if (fileName?.startsWith('file')) {
const appInfo: any = await prisma.appInformation.findFirst({
where: { uploadedFileName: fileName as string },
Expand Down
3 changes: 2 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ class DevicePlugin extends BasePlugin {
} = caps;
stripAppiumPrefixes(requiredCaps);
stripAppiumPrefixes(allFirstMatchCaps);
const mergedCapabilites = Object.assign({}, caps.firstMatch[0], caps.alwaysMatch);
await addNewPendingSession({
...Object.assign({}, caps.firstMatch[0], caps.alwaysMatch),
capability_id: pendingSessionId,
Expand Down Expand Up @@ -376,7 +377,7 @@ class DevicePlugin extends BasePlugin {
if (isRemoteOrCloudSession) {
addProxyHandler(sessionId, device.host);
}
if (!caps.alwaysMatch['df:skipReport']) {
if (!mergedCapabilites['df:skipReport']) {
log.info('Skipping dashboard report');
await EventBus.fire(
new SessionCreatedEvent({
Expand Down

0 comments on commit d511162

Please sign in to comment.