@@ -434,19 +434,42 @@ describe('utils', () => {
434434 expect ( await determineNativeContext ( driver ) ) . toBeFalsy ( )
435435 } )
436436
437+ // For iOS
438+ it ( 'should return true for when appium:bundleId is provided and autoWebview is true' , async ( ) => {
439+ ( driver . capabilities as WebdriverIO . Capabilities ) . browserName = '' ;
440+ ( driver . requestedCapabilities as AppiumCapabilities ) [ 'appium:bundleId' ] = 'string' ;
441+ ( driver . requestedCapabilities as AppiumCapabilities ) [ 'appium:autoWebview' ] = true
442+
443+ expect ( await determineNativeContext ( driver ) ) . toBeFalsy ( )
444+ } )
445+
446+ // For Android
437447 it ( 'should return true for when appium:appPackage is provided' , async ( ) => {
438448 ( driver . capabilities as WebdriverIO . Capabilities ) . browserName = '' ;
439449 ( driver . requestedCapabilities as AppiumCapabilities ) [ 'appium:appPackage' ] = 'string'
440450
441451 expect ( await determineNativeContext ( driver ) ) . toBeTruthy ( )
442452 } )
443453
444- it ( 'should return true for when appium:bundleId is provided and autoWebview is true ' , async ( ) => {
454+ it ( 'should return true for when appium:appActivity is provided' , async ( ) => {
445455 ( driver . capabilities as WebdriverIO . Capabilities ) . browserName = '' ;
446- ( driver . requestedCapabilities as AppiumCapabilities ) [ 'appium:bundleId' ] = 'string' ;
447- ( driver . requestedCapabilities as AppiumCapabilities ) [ 'appium:autoWebview' ] = true
456+ ( driver . requestedCapabilities as AppiumCapabilities ) [ 'appium:appActivity' ] = 'appActivity'
448457
449- expect ( await determineNativeContext ( driver ) ) . toBeFalsy ( )
458+ expect ( await determineNativeContext ( driver ) ) . toBeTruthy ( )
459+ } )
460+
461+ it ( 'should return true for when appium:appWaitActivity is provided' , async ( ) => {
462+ ( driver . capabilities as WebdriverIO . Capabilities ) . browserName = '' ;
463+ ( driver . requestedCapabilities as AppiumCapabilities ) [ 'appium:appWaitActivity' ] = 'appWaitActivity'
464+
465+ expect ( await determineNativeContext ( driver ) ) . toBeTruthy ( )
466+ } )
467+
468+ it ( 'should return true for when appium:appWaitPackage is provided' , async ( ) => {
469+ ( driver . capabilities as WebdriverIO . Capabilities ) . browserName = '' ;
470+ ( driver . requestedCapabilities as AppiumCapabilities ) [ 'appium:appWaitPackage' ] = 'appWaitPackage'
471+
472+ expect ( await determineNativeContext ( driver ) ) . toBeTruthy ( )
450473 } )
451474 } )
452475} )
0 commit comments