예제 #1
0
		public AppUtils(bool repl, string platform)
		{

			string path = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;
			var info = new FileInfo(path);
			string directory = info.Directory.Parent.Parent.Parent.FullName;
			TestPlatform environment = TestEnvironment.Platform;
			string pathToApp;

			if (environment == TestPlatform.TestCloudiOS)
			{
				Queries = new iOSQueries ();
				App = ConfigureApp.iOS.ApiKey(Key).StartApp ();
			}
			else if (TestEnvironment.Platform.Equals(TestPlatform.TestCloudAndroid))
			{
				Queries = new AndroidQueries ();
				App = ConfigureApp.Android.ApiKey(Key).StartApp();
			}
			else if (environment == TestPlatform.Local)
			{
				Platform = platform; 

			    if (Platform == iOS)
			    {
                    pathToApp = Path.Combine(directory, "iOS.Phone", "bin", "iPhoneSimulator", "Debug", "CompassMobileiOSPhone.app");
                    App = ConfigureApp.iOS.AppBundle(pathToApp).DeviceIdentifier("43C4DF36-5591-4C67-9718-1FCDF13A4046").EnableLocalScreenshots().ApiKey(Key).StartApp();
                    Queries = new iOSQueries();
			    }

			    else
			    {
                    pathToApp = Path.Combine(directory, "Droid.Phone", "bin", "Debug", "com.parivedasolutions.projectez.apk");
                    App = ConfigureApp.Android.ApkFile(pathToApp).EnableLocalScreenshots().ApiKey(Key).DeviceSerial("f13ada45").StartApp(Xamarin.UITest.Configuration.AppDataMode.Clear);
			        Queries = new AndroidQueries();
			    }
			}
			if(repl)
			{
				App.Repl ();
			}
		}
예제 #2
0
        public AppUtils(bool repl, string platform)
        {
            string       path        = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;
            var          info        = new FileInfo(path);
            string       directory   = info.Directory.Parent.Parent.Parent.FullName;
            TestPlatform environment = TestEnvironment.Platform;
            string       pathToApp;

            if (environment == TestPlatform.TestCloudiOS)
            {
                Queries = new iOSQueries();
                App     = ConfigureApp.iOS.ApiKey(Key).StartApp();
            }
            else if (TestEnvironment.Platform.Equals(TestPlatform.TestCloudAndroid))
            {
                Queries = new AndroidQueries();
                App     = ConfigureApp.Android.ApiKey(Key).StartApp();
            }
            else if (environment == TestPlatform.Local)
            {
                Platform = platform;

                if (Platform == iOS)
                {
                    pathToApp = Path.Combine(directory, "iOS.Phone", "bin", "iPhoneSimulator", "Debug", "CompassMobileiOSPhone.app");
                    App       = ConfigureApp.iOS.AppBundle(pathToApp).DeviceIdentifier("43C4DF36-5591-4C67-9718-1FCDF13A4046").EnableLocalScreenshots().ApiKey(Key).StartApp();
                    Queries   = new iOSQueries();
                }

                else
                {
                    pathToApp = Path.Combine(directory, "Droid.Phone", "bin", "Debug", "com.parivedasolutions.projectez.apk");
                    App       = ConfigureApp.Android.ApkFile(pathToApp).EnableLocalScreenshots().ApiKey(Key).DeviceSerial("f13ada45").StartApp(Xamarin.UITest.Configuration.AppDataMode.Clear);
                    Queries   = new AndroidQueries();
                }
            }
            if (repl)
            {
                App.Repl();
            }
        }