@@ -12,6 +12,7 @@ public abstract class UITestBase : IDisposable
1212 private readonly string appId ;
1313 private readonly string app ;
1414 private readonly string androidAppActivity ;
15+ private readonly string rootPath ;
1516 private readonly string testOutPath ;
1617
1718 protected UITestBase ( string appId , string androidApkFile , string androidAppActivity , string windowsAppId , string testOutputPath )
@@ -21,7 +22,7 @@ protected UITestBase(string appId, string androidApkFile, string androidAppActiv
2122 this . appId = appId ;
2223 this . androidAppActivity = androidAppActivity ;
2324 var assemblyPath = Assembly . GetAssembly ( typeof ( UITestBase ) ) ! . Location ;
24- var rootPath = Path . GetFullPath ( Path . Combine ( assemblyPath , "../../../../../../../" ) ) ;
25+ rootPath = Path . GetFullPath ( Path . Combine ( assemblyPath , "../../../../../../../" ) ) ;
2526 testOutPath = Path . GetFullPath ( Path . IsPathFullyQualified ( testOutputPath ) ? testOutputPath : Path . Combine ( rootPath , testOutputPath ) ) ;
2627 Directory . CreateDirectory ( testOutPath ) ;
2728 app = devicePlatform switch
@@ -59,12 +60,14 @@ protected UITestBase(string appId, string androidApkFile, string androidAppActiv
5960
6061 private AndroidDriver SetupAndroid ( Uri serverUri )
6162 {
63+ var apk = Path . GetFullPath ( Path . IsPathFullyQualified ( app ) ? app : Path . Combine ( rootPath , app ) ) ;
64+
6265 // See: https://github.com/appium/appium-uiautomator2-driver
6366 var driverOptions = new AppiumOptions ( )
6467 {
6568 AutomationName = AutomationName . AndroidUIAutomator2 ,
6669 PlatformName = MobilePlatform . Android ,
67- App = app ,
70+ App = apk ,
6871 } ;
6972 // TODO: Use this instead of App for local dev
7073 //driverOptions.AddAdditionalAppiumOption("appPackage", appId);
0 commit comments