import { checkIsMobile , checkAndroidChromeDriverScreenshot , checkAndroidNativeWebScreenshot , checkIsAndroid , checkIsIos , checkTestInBrowser , checkTestInMobileBrowser , getAddressBarShadowPadding , getToolBarShadowPadding , } from '../helpers/utils' ; import getScreenDimensions from '../clientSideScripts/getScreenDimensions' ; import { Executor } from './methods.interface' ; import { EnrichedInstanceData , InstanceOptions } from './instanceData.interfaces' ; /**
 * Enrich the instance data with more data
 */ export default async function getEnrichedInstanceData ( executor , instanceOptions , addShadowPadding ) { const browserData = await executor ( getScreenDimensions ) ; const { addressBarShadowPadding , toolBarShadowPadding , browserName , nativeWebScreenshot , platformName } = instanceOptions ; const isAndroid = checkIsAndroid ( platformName ) ; const isIos = checkIsIos ( platformName ) ; const isMobile = checkIsMobile ( platformName ) ; const isTestInBrowser = checkTestInBrowser ( browserName ) ; const isTestInMobileBrowser = checkTestInMobileBrowser ( platformName , browserName ) ; const isAndroidNativeWebScreenshot = checkAndroidNativeWebScreenshot ( platformName , nativeWebScreenshot ) ; const isAndroidChromeDriverScreenshot = checkAndroidChromeDriverScreenshot ( platformName , nativeWebScreenshot ) ; const addressBarPadding = getAddressBarShadowPadding ( { platformName , browserName , nativeWebScreenshot , addressBarShadowPadding , addShadowPadding , } ) ; const toolBarPadding = getToolBarShadowPadding ( { platformName , browserName , toolBarShadowPadding , addShadowPadding } ) ; return { ... ( browserData ) , ... ( instanceOptions ) , addressBarShadowPadding : addressBarPadding , isAndroid , isAndroidChromeDriverScreenshot , isAndroidNativeWebScreenshot , isIos , isMobile , isTestInBrowser , isTestInMobileBrowser , toolBarShadowPadding : toolBarPadding , } ; }