Ejemplo n.º 1
0
 public void SetUp()
 {
     app = ConfigureApp
           .iOS
           .AppBundle("../../../iOSMasterDetailApp/bin/iPhoneSimulator/Debug/iOSMasterDetailApp.app")
           .StartApp();
 }
Ejemplo n.º 2
0
 public void SetUp()
 {
     app = ConfigureApp
           .iOS
           .StartApp();
     //app = ConfigureApp.iOS.AppBundle("/Users/administrator/Desktop/BASTA/HockeyApp/iOS/bin/iPhoneSimulator/Release/xtr-xtr-ConferenceApp.iOS.app").StartApp();
 }
 public void BeforeEachTest()
 {
     app = (iOSApp)AppInitializer.StartApp(
         platform,
         null,
         TestConsts.iOSBundleId);
 }
        public void BeforeEachTest()
        {
            // TODO: If the iOS app being tested is included in the solution, then open
            // the Unit Tests window, right click Test Apps, select Add App Project
            // and select the app projects that should be tested.
            //
            // The iOS project should have the Xamarin.TestCloud.Agent NuGet package
            // installed. To start the Test Cloud Agent the following code should be
            // added to the FinishedLaunching method of the AppDelegate:
            //
            //    #if ENABLE_TEST_CLOUD
            //    Xamarin.Calabash.Start();
            //    #endif
            //
            // ^^^ THIS IS THE WAY THE ACQUAINT APP IS SETUP FOR UITESTS ^^^


            app = ConfigureApp
                  .iOS
                  // TODO: If the iOS app being tested is NOT included in the solution, then
                  // uncomment this code and update this path to point to your iOS app.
                  // .AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/Acquaint.Native.UITest.iOS.iOS.app")
                  //
                  // ^^^ THIS IS *NOT* THE WAY THE ACQUAINT APP IS SETUP FOR UITESTS ^^^

                  .StartApp();
        }
Ejemplo n.º 5
0
 public void Setup()
 {
     app = ConfigureApp
           .iOS
           //.AppBundle("/Users/brent/Projects/Xamarin/VoltageRegulatorTemperature/iOS/bin/iPhoneSimulator/Debug/xtr-VoltageRegulatorTemperature.iOS.app")
           .StartApp();
 }
Ejemplo n.º 6
0
        public void Setup()
        {
            // Configure device ID and device IP
            string deviceUDID = string.Empty;
            string deviceIP   = string.Empty;

            if (bot == CurrentBot.FisherHipster)
            {
                deviceUDID = fisherHipsterDeviceIdentifier;
                deviceIP   = fisherHipsterDeviceIP;
            }
            else
            {
                deviceUDID = coffeeHipsterDeviceIdentifier;
                deviceIP   = coffeeHipsterDeviceIP;
            }

            // Install and connect to the iOS app running on the phone
            app = ConfigureApp.iOS.
                  DeviceIdentifier(deviceUDID).
                  DeviceIp(deviceIP).
                  EnableLocalScreenshots().
                  ConnectToApp();
            //InstalledApp ("com.olegoid.InstagramWrapper.InstagramWrapper").
            //StartApp ();
        }
Ejemplo n.º 7
0
        public void BeforeEachTest()
        {
            Environment.SetEnvironmentVariable("UITEST_FORCE_IOS_SIM_RESTART", "1"); // Restart simulator

            app = ConfigureApp.iOS.PreferIdeSettings().AppBundle(path).StartApp(AppDataMode.Clear);
            //DeviceIdentifier("7D1171C1-1463-4B6A-8A17-3A792301214C");
        }
Ejemplo n.º 8
0
        static void LogPropertiesForUIView(this iOSApp app, string query, bool isOnParent = false)
        {
            //Logger.LogLine ("--- UIView Properties ---");

            var properties = new [] {
                // just getters with no params, bools
                "alpha",
                "autoresizesSubviews",
                "autoresizingMask",
                "backgroundColor",
                "bounds",
                "center",
                "clearsContextBeforeDrawing",
                "clipsToBounds",
                "contentMode",
                "contentScaleFactor",
                "exclusiveTouch",
                "frame",
                "gestureRecognizers",
                "hidden",
                "layer",
                "motionEffects",
                "multipleTouchEnabled",
                "opaque",
                "restorationIdentifier",
                "subviews",
                "superview",
                "tag",
                "tintAdjustmentMode",
                "tintColor",
                "transform",
                "userInteractionEnabled",
                "window"
            };

            if (isOnParent)
            {
                query = query + " parent * index:0";
            }

            foreach (var property in properties)
            {
                object prop;
                bool   found =
                    MaybeGetProperty <string> (app, query, property, out prop) ||
                    MaybeGetProperty <int>    (app, query, property, out prop) ||
                    MaybeGetProperty <float>  (app, query, property, out prop) ||
                    MaybeGetProperty <bool>   (app, query, property, out prop);

                if (found)
                {
                    continue;
                }
                //	Logger.LogLine (string.Format ("{0,-30}: {1}", property, prop));
            }

            //Logger.LogLine();
        }
Ejemplo n.º 9
0
 public void BeforeEachTest()
 {
     app = ConfigureApp.iOS.
           EnableLocalScreenshots().
           PreferIdeSettings().
           InstalledApp("com.secret.SecretFiles").
           DeviceIdentifier(iPhone7PlusSimID_iOS10point1).
           StartApp();
 }
Ejemplo n.º 10
0
 public void BeforeEachTest()
 {
     app = ConfigureApp
         .iOS
         // TODO: Update this path to point to your iOS app and uncomment the
         // code if the app is not included in the solution.
         .AppBundle ("../../../bin/iPhoneSimulator/Debug/CI-Demo.app")
         .StartApp ();
 }
Ejemplo n.º 11
0
 public void ProcessAllDevices()
 {
     foreach (string device in Devices)
     {
         iOSApp app = PrepareDevice(device);
         TestApp(app);
         CollectScreenshots(device);
     }
 }
        public void SetUp()
        {

            _app = ConfigureApp
                    .iOS
                    .Debug()
                    .AppBundle(PathToIPA)
                    .StartApp();
        }
Ejemplo n.º 13
0
 public static AppResult DetailPage(this iOSApp app)
 {
     if (app.Query(q => q.Raw("view:'UILayoutContainerView'")).Length == 3)
     {
         // iPad SplitView Landscape
         return(app.Query(q => q.Raw("view:'UILayoutContainerView'"))[2]);
     }
     return(app.Query(q => q.Raw("*"))[0]);
 }
Ejemplo n.º 14
0
        public void BeforeEachTest()
        {
            app = ConfigureApp
                  .iOS
                  .EnableLocalScreenshots()
                  .StartApp();

            app.WaitForLoginScreen();
        }
Ejemplo n.º 15
0
		public static void Restart () 
		{
			App = ConfigureApp
				.iOS
				.Debug ()
				// Keeping the old BundleId for now, Test Cloud doesn't 
				// like it when we update the BundleId for an existing app
				.InstalledApp ("com.xamarin.quickui.controlgallery")
				.StartApp (Xamarin.UITest.Configuration.AppDataMode.Clear);
		}
Ejemplo n.º 16
0
 public static void Restart()
 {
     App = ConfigureApp
           .iOS
           .Debug()
           // Keeping the old BundleId for now, Test Cloud doesn't
           // like it when we update the BundleId for an existing app
           .InstalledApp("com.xamarin.quickui.controlgallery")
           .StartApp(Xamarin.UITest.Configuration.AppDataMode.Clear);
 }
Ejemplo n.º 17
0
 public static void DragFromTo(this iOSApp app, float xStart, float yStart, float xEnd, float yEnd, Speed speed = Speed.Fast)
 {
     if (speed == Speed.Slow)
     {
         app.PanCoordinates(xStart, yStart, xEnd, yEnd, TimeSpan.FromMilliseconds(3000));
     }
     else
     {
         app.PanCoordinates(xStart, yStart, xEnd, yEnd, TimeSpan.FromMilliseconds(1000));
     }
 }
Ejemplo n.º 18
0
 public void BeforeEachTest()
 {
     // TODO: If the iOS app being tested is included in the solution then
     // add a reference to the iOS project from the project containing this file
     app = ConfigureApp
           .iOS
           // TODO: Update this path to point to your iOS app and uncomment the
           // code if the app is not included in the solution.
           //.AppBundle (@"..\..\..\iOS\bin\iPhoneSimulator\Debug\iOSUITest.iOS.app")
           .StartApp();
 }
Ejemplo n.º 19
0
		public void BeforeAnyTests() {
			// TODO: If the iOS app being tested is included in the solution then open
			// the Unit Tests window, right click Test Apps, select Add App Project
			// and select the app projects that should be tested.
			app = ConfigureApp
				.iOS
				// TODO: Update this path to point to your iOS app and uncomment the
				// code if the app is not included in the solution.
				//.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/UITests.iOS.app")
				.StartApp();
		}
Ejemplo n.º 20
0
        public void BeforeEachTest()
        {
            _app = ConfigureApp
                   .iOS
                   // TODO: Update this path to point to your iOS app and uncomment the
                   // code if the app is not included in the solution.
                   //.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/PrismDemo.iOS.app")
                   .StartApp();

            _queries = new iOSQueries(_app);
        }
Ejemplo n.º 21
0
        public void BeforeEachTest()
        {
            if (app == null)
            {
                app = ConfigureApp
                .iOS
                .EnableLocalScreenshots()
                .StartApp();

            }
        }
Ejemplo n.º 22
0
        static bool MaybeGetLayerProperty <T> (iOSApp app, string query, string property, out object result)
        {
            try {
                result = app.Query(q => q.Raw(query).Invoke("layer").Invoke(property).Value <T> ()).First();
            } catch {
                result = null;
                return(false);
            }

            return(true);
        }
Ejemplo n.º 23
0
 public void BeforeEachTest()
 {
     // TODO: If the iOS app being tested is included in the solution then open
     // the Unit Tests window, right click Test Apps, select Add App Project
     // and select the app projects that should be tested.
     app = ConfigureApp
           .iOS
           // TODO: Update this path to point to your iOS app and uncomment the
           // code if the app is not included in the solution.
           //.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/iOSUITest.iOS.app")
           .StartApp();
 }
Ejemplo n.º 24
0
        string GetTitle()
        {
            var titleQuery = App switch
            {
                iOSApp iOSApp => iOSApp.Query(x => x.Class("UILabel").Marked(PageTitleConstants.OpportunityDetailPage)),

                AndroidApp androidApp => androidApp.Query(x => x.Class("AppCompatTextView").Marked(PageTitleConstants.OpportunityDetailPage)),

                _ => throw new NotSupportedException(),
            };

            return(titleQuery?.FirstOrDefault()?.Text);
        }
Ejemplo n.º 25
0
        string GetTitle(int timeoutInSeconds = 60)
        {
            App.WaitForElement(_pageTitleText, "Could Not Retrieve Page Title", TimeSpan.FromSeconds(timeoutInSeconds));

            var titleQuery = App switch
            {
                iOSApp iosApp => iosApp.Query(x => x.Class("UILabel").Marked(_pageTitleText)),
                AndroidApp androidApp => androidApp.Query(x => x.Class("AppCompatTextView").Marked(_pageTitleText)),
                _ => throw new NotSupportedException(),
            };

            return(titleQuery.First().Text);
        }
Ejemplo n.º 26
0
 public void BeforeEachTest()
 {
     // TODO: If the iOS app being tested is included in the solution then open
     // the Unit Tests window, right click Test Apps, select Add App Project
     // and select the app projects that should be tested.
     app = ConfigureApp
         .iOS
         .DeviceIdentifier ("1EAF0958-7B01-4B9D-9813-AEF3FA9E42E8")
     // TODO: Update this path to point to your iOS app and uncomment the
     // code if the app is not included in the solution.
     //.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/HypnoTime.UITest.iOS.app")
         .InstalledApp ("com.your-company.HypnoTime")
         .StartApp ();
 }
Ejemplo n.º 27
0
 public void BeforeEachTest()
 {
     // TODO: If the iOS app being tested is included in the solution then open
     // the Unit Tests window, right click Test Apps, select Add App Project
     // and select the app projects that should be tested.
     app = ConfigureApp
           .iOS
           .DeviceIdentifier("1EAF0958-7B01-4B9D-9813-AEF3FA9E42E8")
           // TODO: Update this path to point to your iOS app and uncomment the
           // code if the app is not included in the solution.
           //.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/HypnoTime.UITest.iOS.app")
           .InstalledApp("com.your-company.HypnoTime")
           .StartApp();
 }
Ejemplo n.º 28
0
 public void BeforeEachTest()
 {
     // TODO: If the iOS app being tested is included in the solution then open
     // the Unit Tests window, right click Test Apps, select Add App Project
     // and select the app projects that should be tested.
     //
     // The iOS project should have the Xamarin.TestCloud.Agent NuGet package
     // installed. To start the Test Cloud Agent the following code should be
     // added to the FinishedLaunching method of the AppDelegate:
     //
     //    #if ENABLE_TEST_CLOUD
     //    Xamarin.Calabash.Start();
     //    #endif
     app = ConfigureApp.iOS.InstalledApp("com.companyname.phonewordios").StartApp();
 }
Ejemplo n.º 29
0
        static iOSApp PrepareDevice(string device)
        {
            Assert.NotNull(AllDevices[device], "Device " + device + " not found");

            iOSApp app = ConfigureApp
                         .iOS
                         .AppBundle(BundlePath)
                         .DeviceIdentifier(AllDevices[device])
                         .EnableLocalScreenshots()
                         .StartApp();

            app.Invoke("activateTestEnvironment:", "true");

            return(app);
        }
Ejemplo n.º 30
0
        public static int IndexForElementWithText(this iOSApp app, Func <AppQuery, AppQuery> query, string text)
        {
            var elements = app.Query(query);
            int index    = 0;

            for (int i = 0; i < elements.Length; i++)
            {
                string labelText = elements[i].Label;
                if (labelText == (text))
                {
                    index = i;
                    break;
                }
                index++;
            }
            return(index == elements.Length ? -1 : index);
        }
Ejemplo n.º 31
0
 public void BeforeEachTest()
 {
     // TODO: If the iOS app being tested is included in the solution then open
     // the Unit Tests window, right click Test Apps, select Add App Project
     // and select the app projects that should be tested.
     //
     // The iOS project should have the Xamarin.TestCloud.Agent NuGet package
     // installed. To start the Test Cloud Agent the following code should be
     // added to the FinishedLaunching method of the AppDelegate:
     //
     app = ConfigureApp
           .iOS
           // TODO: Update this path to point to your iOS app and uncomment the
           // code if the app is not included in the solution.
           //.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/UITest.iOS.app")
           .StartApp();
 }
Ejemplo n.º 32
0
 public void BeforeEachTest()
 {
     // TODO: If the iOS app being tested is included in the solution then open
     // the Unit Tests window, right click Test Apps, select Add App Project
     // and select the app projects that should be tested.
     //
     // The iOS project should have the Xamarin.TestCloud.Agent NuGet package
     // installed. To start the Test Cloud Agent the following code should be
     // added to the FinishedLaunching method of the AppDelegate:
     //
     //    #if ENABLE_TEST_CLOUD
     //    Xamarin.Calabash.Start();
     //    #endif
     app = ConfigureApp
           .iOS
           // TODO: Update this path to point to your iOS app and uncomment the
           // code if the app is not included in the solution.
           .AppBundle("/Users/ahanag22/Desktop/Permissions/Products/app/Permissions.app")
           .StartApp();
 }
		public void BeforeEachTest()
		{
			// TODO: If the iOS app being tested is included in the solution then open
			// the Unit Tests window, right click Test Apps, select Add App Project
			// and select the app projects that should be tested.
			//
			// The iOS project should have the Xamarin.TestCloud.Agent NuGet package
			// installed. To start the Test Cloud Agent the following code should be
			// added to the FinishedLaunching method of the AppDelegate:
			//
			//    #if ENABLE_TEST_CLOUD
			//    Xamarin.Calabash.Start();
			//    #endif
			app = ConfigureApp
				.iOS
				// TODO: Update this path to point to your iOS app and uncomment the
				// code if the app is not included in the solution.
				//.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/MessageBarUITests.iOS.app")
				.StartApp();
		}
Ejemplo n.º 34
0
 public void BeforeEachTest()
 {
     // TODO: If the iOS app being tested is included in the solution then open
     // the Unit Tests window, right click Test Apps, select Add App Project
     // and select the app projects that should be tested.
     //
     // The iOS project should have the Xamarin.TestCloud.Agent NuGet package
     // installed. To start the Test Cloud Agent the following code should be
     // added to the FinishedLaunching method of the AppDelegate:
     //
     //    #if ENABLE_TEST_CLOUD
     //    Xamarin.Calabash.Start();
     //    #endif
     app = ConfigureApp
           .iOS
           // TODO: Update this path to point to your iOS app and uncomment the
           // code if the app is not included in the solution.
           //.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/MapViewUITest.iOS.app")
           //.AppBundle ("/Users/allyis1/Desktop/recipes/ios/content_controls/map_view/display_device_location/bin/iPhone/Release/MapView.exe")
           .StartApp();
 }
Ejemplo n.º 35
0
        public Task SelectTheme(PreferredTheme preferredTheme)
        {
            var rowNumber = (int)preferredTheme;
            var totalRows = Enum.GetNames(typeof(PreferredTheme)).Count();

            var rowOffset = App switch
            {
                iOSApp _ => rowNumber.Equals(totalRows - 1) ? -1 : 1,
                AndroidApp _ => 0,
                _ => throw new NotSupportedException()
            };

            try
            {
                App.Tap(_themePicker);
            }
            catch
            {
                App.Tap(_themePickerContainer);
            }

            scrollToRow(App, rowNumber, rowOffset, totalRows, preferredTheme);

            if (App is iOSApp)
            {
                App.Tap(x => x.Marked("Done"));
            }
            else if (App is AndroidApp)
            {
                App.Tap(x => x.Marked("OK"));
            }
            else
            {
                throw new NotSupportedException();
            }


            App.Screenshot($"Selected Row From Picker: {preferredTheme}");

            return(WaitForPageToLoad());
Ejemplo n.º 36
0
 public void BeforeEachTest()
 {
     // TODO: If the iOS app being tested is included in the solution then open
     // the Unit Tests window, right click Test Apps, select Add App Project
     // and select the app projects that should be tested.
     //
     // The iOS project should have the Xamarin.TestCloud.Agent NuGet package
     // installed. To start the Test Cloud Agent the following code should be
     // added to the FinishedLaunching method of the AppDelegate:
     //
     //    #if ENABLE_TEST_CLOUD
     //    Xamarin.Calabash.Start();
     //    #endif
     app = ConfigureApp
           .iOS
           // TODO: Update this path to point to your iOS app and uncomment the
           // code if the app is not included in the solution.
           //.AppBundle ("../../../Xamarin.SingleView/bin/iPhoneSimulator/Debug/Xamarin.SingleView.app")
           //.DeviceIdentifier("4763BC2E-31B5-4AE6-B286-D5EDE73069F7")
           //.InstalledApp("com.microsoft.mobcat.Xamarin-SingleView.alstrakh")
           .StartApp();
 }
Ejemplo n.º 37
0
        public static bool DragFromToForElement(this iOSApp app, int scrollNumberLimit, Func <AppQuery, AppQuery> query, float xStart, float yStart, float xEnd, float yEnd)
        {
            int numberOfScrolls = 0;

            // Element exists
            if (app.Query(query).Length > 0)
            {
                return(true);
            }

            while (app.Query(query).Length == 0)
            {
                DragFromTo(app, xStart, yStart, xEnd, yEnd);
                if (numberOfScrolls > scrollNumberLimit)
                {
                    return(false);
                }
                numberOfScrolls++;
            }
            // Element found
            return(true);
        }
		public void BeforeEachTest ()
		{
			// TODO: If the iOS app being tested is included in the solution then open
			// the Unit Tests window, right click Test Apps, select Add App Project
			// and select the app projects that should be tested.
			//
			// The iOS project should have the Xamarin.TestCloud.Agent NuGet package
			// installed. To start the Test Cloud Agent the following code should be
			// added to the FinishedLaunching method of the AppDelegate:
			//
			//    #if DEBUG
			//    Xamarin.Calabash.Start();
			//    #endif
			//
			// For more information please read:
			// http://developer.xamarin.com/guides/testcloud/uitest/adding-uitest/
			app = ConfigureApp
				.iOS
			// TODO: Update this path to point to your iOS app and uncomment the
			// code if the app is not included in the solution.
			//.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/NotificationWindowTap.iOS.app")
				.StartApp ();
		}
 public void SetUp()
 {
     _app = ConfigureApp.iOS.AppBundle(PathToIPA).ApiKey("0c4aec6adb022f65167bde1dc14de100").StartApp();
 }
Ejemplo n.º 40
0
 public void BeforeEachTest()
 {
     app = ConfigureApp.iOS.StartApp ();
 }
Ejemplo n.º 41
0
		public void SetUp ()
		{
			app = ConfigureApp.Debug ().iOS.InstalledApp (BUNDLE_IDENTIFIER).DeviceIp (DEVICE_WIFI_IP).ApiKey (API_KEY).StartApp ();
		}
Ejemplo n.º 42
0
 public void BeforeEachTest()
 {
     //app = ConfigureApp.iOS.StartApp ();
     app = ConfigureApp.iOS.InstalledApp (BUNDLE_IDENTIFIER).ApiKey (API_KEY).DeviceIp (DEVICE_WIFI_IP).StartApp ();
 }
Ejemplo n.º 43
0
		public void TestFixtureTearDown ()
		{
			app = null;
		}
Ejemplo n.º 44
0
 public void BeforeEachTest()
 {
     app = ConfigureApp.iOS
         #if SIMULATOR
         .AppBundle("../../../../bugTrap/bin/iPhoneSimulator/Debug/bugTrap.app")
         .Debug()
         #else
         .InstalledApp("io.bugtrap.bugTrap")
         .ApiKey("9143d067ec53bfb406aff56327f5e53b")
         #endif
         .EnableLocalScreenshots()
         .StartApp();
 }