Exemple #1
0
        /// <summary>
        /// Gets the app path for the application being tested
        /// </summary>
        /// <returns>The app path.</returns>
        private string GetAppPath()
        {
            var devicePlatform = AppiumConfig.GetDevicePlatform();
            var appName        = devicePlatform == DevicePlatform.Android ? AppiumConfig.GetAndroidRealApp() : AppiumConfig.GetiOSRealApp();

            return(Path.Combine(AppiumConfig.GetAppPath(), appName));
        }
Exemple #2
0
        public string SettingAppPath()
        {
            bool checkAndroid  = deviceMap.Any(o => Regex.IsMatch(o.Value.ToString(), @"([Aa][Nn][Dd][Rr][Oo][Ii][Dd])"));
            bool checkMAC      = deviceMap.Any(o => Regex.IsMatch(o.Value.ToString(), @"([Mm][Aa][Cc])"));
            bool checkReal     = deviceMap.Any(o => Regex.IsMatch(o.Value.ToString(), @"([Rr][Ee][Aa][Ll])"));
            bool checkEmulator = deviceMap.Any(o => Regex.IsMatch(o.Value.ToString(), @"([Ee][Mm][Uu][Ll][Aa][Tt][Oo][Rr])"));

            if (checkAndroid && checkReal)
            {
                return(Path.Combine(AppiumConfig.GetAppPath(), AppiumConfig.GetAndroidRealApp()));
            }

            if (checkAndroid && checkEmulator)
            {
                return(Path.Combine(AppiumConfig.GetAppPath(), AppiumConfig.GetAndroidEmulatorApp()));
            }

            if (checkMAC && checkReal)
            {
                return(Path.Combine(AppiumConfig.GetAppPath(), AppiumConfig.GetiOSRealApp()));
            }

            if (checkMAC && checkEmulator)
            {
                return(Path.Combine(AppiumConfig.GetAppPath(), AppiumConfig.GetiOSEmulatorApp()));
            }

            throw new ArgumentException("Failed to set the App Path!");
        }