Ejemplo n.º 1
0
        /// <summary>
        /// Takes the screenshots using the currently configured options.
        ///
        /// The app will be automated using the implemented SetAppStateForScreenshotX methods
        /// for all available simulators given the selected device type.
        ///
        /// The SetAppStateForScreenshotX methods will be run in sequence
        /// and screenshots taken after each one if configured.
        /// </summary>
        public void TakeScreenshots()
        {
            ClearScreenshotsDirectory();
            var simulators = DeviceSetParser.GetAvailableSimulators(osVersion, deviceNames);

            foreach (var device in simulators)
            {
                App = ConfigureApp
                      .Debug().EnableLocalScreenshots()
                      .iOS
                      .AppBundle(appBundlePath)
                      .DeviceIdentifier(device.UUID)
                      .StartApp(Xamarin.UITest.Configuration.AppDataMode.DoNotClear);

                TakeScreenShot(device.Name);
            }
        }