Skip to content

Commit 8a3675b

Browse files
committed
fix: fix determining nativeWebScreenshot for Android
1 parent 40ddd5f commit 8a3675b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/image-comparison-core/src/helpers/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function checkTestInMobileBrowser(isMobile: boolean, browserName: string)
125125
* Checks if this is a native webscreenshot on android
126126
*/
127127
export function checkAndroidNativeWebScreenshot(isAndroid: boolean, nativeWebscreenshot: boolean): boolean {
128-
return (isAndroid && nativeWebscreenshot) || false
128+
return (isAndroid && !!nativeWebscreenshot) || false
129129
}
130130

131131
/**

packages/visual-service/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export async function getInstanceData({
244244
const ltOptions = getLtOptions(requestedCapabilities)
245245
// @TODO: Figure this one out in the future when we know more about the Appium capabilities from LT
246246
// 20241216: LT doesn't have the option to take a ChromeDriver screenshot, so if it's Android it's always native
247-
const nativeWebScreenshot = isAndroid && ltOptions || !!getRequestedAppiumCapability(requestedCapabilities, 'nativeWebScreenshot')
247+
const nativeWebScreenshot = !!(isAndroid && ltOptions) || !!getRequestedAppiumCapability(requestedCapabilities, 'nativeWebScreenshot')
248248
const platformVersion = (rawPlatformVersion === undefined || rawPlatformVersion === '') ? NOT_KNOWN : rawPlatformVersion.toLowerCase()
249249
const {
250250
devicePixelRatio: mobileDevicePixelRatio,

0 commit comments

Comments
 (0)