Skip to content

Commit 562166c

Browse files
authored
feat: using original filename in capability (#2028)
1 parent 9d53461 commit 562166c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/CapabilityManager.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,17 @@ async function findAppPath(caps: any) {
4545
where: { uploadedFileName: fileName as string },
4646
});
4747
return `${DevicePlugin.serverUrl}${appInfo?.path}`;
48+
} else if (fileName && /^[A-Za-z]+[A-Za-z0-9_\-\.]+\.(zip|apk|aab|ipa|app)$/.test(fileName)) {
49+
const appInfo: any = await prisma.appInformation.findFirst({
50+
where: { fileName: fileName as string },
51+
orderBy: { createdAt: 'desc' },
52+
});
53+
return appInfo ? `${DevicePlugin.serverUrl}${appInfo?.path}` : fileName;
4854
} else {
4955
return fileName;
5056
}
5157
}
58+
5259
export async function androidCapabilities(
5360
caps: ISessionCapability,
5461
freeDevice: IDevice,

0 commit comments

Comments
 (0)