public void CodedUITest_IIIwhenpassedin3()
        {
            var myWindowApp = XamlWindow.Launch("ac6d9b0f-dd95-410a-aa20-573a49b0e1dd_c0f0e9w7n7var!App");

            this.UIMap.UIRomanConverter_XAMLWindow.UITextBoxEdit.Text = "3";
            Gesture.Tap(UIMap.UIRomanConverter_XAMLWindow.UISubmitButton);

            this.UIMap.AssertThatIIIReturnsFrom3();
        }
        public string GetDateTime(XamlWindow Window)
        {
            string selectedDateTime = "";

            Window.GetChildren().ToList()
            .Where(ctrl => ctrl.ControlType.Name == "ComboBox").ToList()
            .ForEach(ctrl => selectedDateTime += (ctrl as XamlComboBox).SelectedItem.ToString() + "/");

            return(selectedDateTime);
        }
Esempio n. 3
0
 public void OpenWindow(string tileAutomationId)
 {
     try
     {
         this.registry.Add(tileAutomationId, XamlWindow.Launch(tileAutomationId));
         this.LastOpenedWindow = tileAutomationId;
     }
     catch (PlaybackFailureException e)
     {
         throw new AutomationException(e.Message, ResponseStatus.NoSuchWindow);
     }
 }
        public void CodedUITestMethod1()
        {
            // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
            var myWindowApp = XamlWindow.Launch("ac6d9b0f-dd95-410a-aa20-573a49b0e1dd_c0f0e9w7n7var!App");

            this.UIMap.UIRomanConverter_XAMLWindow.UITextBoxEdit.Text = "1";
            Gesture.Tap(UIMap.UIRomanConverter_XAMLWindow.UISubmitButton);

            UIMap.AssertMethod1();

            myWindowApp.Close();
        }
Esempio n. 5
0
        public void EnterTextAndButtonClick()
        {
            string     inText     = "Hello, Windows!";
            XamlWindow xamlWindow = XamlWindow.Launch(TileAutomationId);

            UIMap.UIWindowsAppWindow.UITextInEdit.Text = inText;
            Gesture.Tap(UIMap.UIWindowsAppWindow.UIClickMeButton);
            string outText = UIMap.UIWindowsAppWindow.UITextOutText.DisplayText;

            xamlWindow.Close();
            Assert.AreEqual(inText, outText);
        }
Esempio n. 6
0
        public void CodedUITestMethod1()
        {
            XamlWindow myAppWindow = XamlWindow.Launch("50105L0ku.BassBooster_5j40njvtpg6xe!App");

            Gesture.Tap(this.UIMap.UIBassBoosterWindow.UIItemPane.UILyricsTextBoxEdit);
            UIMap.UIBassBoosterWindow.UITitleBoxEdit.Text  = "8mile";
            UIMap.UIBassBoosterWindow.UIArtistBoxEdit.Text = "Eminem";
            Gesture.Tap(this.UIMap.UIBassBoosterWindow.UISearchButton);
            for (int i = 0; i < 1000000000; i++)
            {
                //Another lame hack because task delay doesn't work...
            }

            this.UIMap.AssertMethod1();
        }
Esempio n. 7
0
        public void CodedUITestMethod1()
        {
            Microsoft.VisualStudio.TestTools.UITest.Input.Point pt;

            var myapp = XamlWindow.Launch("WinRTByExampleAccessibilityExample_req6rhny9ggkj!App");

            Gesture.Tap(this.UIMap.UIAccessibilityExampleWindow.UIAgeEdit);
            // should fail because no error message yet
            Assert.IsFalse(this.UIMap.UIAccessibilityExampleWindow.UINameisRequiredText.TryGetClickablePoint(out pt));

            this.UIMap.UIAccessibilityExampleWindow.UIAgeEdit.Text = "32";
            Keyboard.SendKeys("s", ModifierKeys.Control); // submission

            // should be true now
            Assert.IsTrue(this.UIMap.UIAccessibilityExampleWindow.UINameisRequiredText.TryGetClickablePoint(out pt));

            Gesture.Tap(this.UIMap.UIAccessibilityExampleWindow.UINameEdit);
            Keyboard.SendKeys("Name");
            Keyboard.SendKeys("s", ModifierKeys.Control); // submission

            // should fail because error message cleared
            Assert.IsFalse(this.UIMap.UIAccessibilityExampleWindow.UINameisRequiredText.TryGetClickablePoint(out pt));
            myapp.Close();
        }
Esempio n. 8
0
        public void Start()
        {
            //Запуск калькулятора

            XamlWindow.Launch("Microsoft.WindowsCalculator_8wekyb3d8bbwe!App");
        }
Esempio n. 9
0
 public static void LaunchCalculator()
 {
     XamlWindow.Launch("Microsoft.WindowsCalculator_8wekyb3d8bbwe!App");
 }
 public void CheckIfDefaultUserDwarftsAreLoaded()
 {
     XamlWindow.Launch("d131933c-490a-4b6b-ac88-cf9b43fd999a_5v9vtwr4m7rda!App");
     // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
     this.UIMap.DefaultUserScreenShowsDwarfts();
 }
        public void Test_ValuePattern()
        {
            //Launch app
            XamlWindow samplewindow = XamlWindow.Launch(
                "10da12ee-a022-4719-88bb-93272747b2c1_3gp2x379966ha!App");

            System.Threading.Thread.Sleep(3000);

            XamlWindow MS_XAML_DateTimeSelector_UIATest = new XamlWindow();

            MS_XAML_DateTimeSelector_UIATest.SearchProperties[XamlWindow.PropertyNames.Name] = "DateTimeSelector_UIATest2015";

            var DateTimeSelector_UIATest = AutomationElement.RootElement.FindFirst
                                               (TreeScope.Children, new System.Windows.Automation.PropertyCondition(AutomationElement.NameProperty,
                                                                                                                    "DateTimeSelector_UIATest2015"));

            DateTimeSelector_UIATest = DateTimeSelector_UIATest.FindFirst(TreeScope.Children, Condition.TrueCondition);

            var datetimeselector = DateTimeSelector_UIATest.FindFirst(TreeScope.Children,
                                                                      new System.Windows.Automation.PropertyCondition(AutomationElement.AutomationIdProperty, "datetimeselector"));

            //Tap the button (in which "3/19/2010" date is set to SelectedDate)
            var btn_Set = new XamlButton(MS_XAML_DateTimeSelector_UIATest);

            btn_Set.SearchProperties[XamlButton.PropertyNames.AutomationId] = "btn_Set";
            Gesture.Tap(btn_Set);

            //CodedUI does not recognize DateSelector control , so we can't use valuepattern
            //var DateEditor = new XamlControl(MS_XAML_DateTimeSelector_UIATest);
            //DateEditor.SearchProperties[XamlControl.PropertyNames.AutomationId] = "DateEditor";

            //var msg = "Before:" + DateEditor.FriendlyName;

            //object _valuepattern = null;
            //if (datetimeselector.TryGetCurrentPattern(ValuePattern.Pattern, out _valuepattern))
            //{
            //    ((ValuePattern)_valuepattern).SetValue("10/23/2010");
            //}

            //msg += ".After:" + DateEditor.FriendlyName;

            //Assert.AreEqual("Before:3/19/2010.After:10/23/2010", msg);
            System.Threading.Thread.Sleep(2000);

            var msg = "Before:" + GetDateTime(MS_XAML_DateTimeSelector_UIATest);

            XamlComboBox CboDays = new XamlComboBox(MS_XAML_DateTimeSelector_UIATest);

            CboDays.SearchProperties[XamlComboBox.PropertyNames.AutomationId] = "DaysList";
            XamlComboBox CboMonths = new XamlComboBox(MS_XAML_DateTimeSelector_UIATest);

            CboMonths.SearchProperties[XamlComboBox.PropertyNames.AutomationId] = "MonthsList";
            XamlComboBox CboYears = new XamlComboBox(MS_XAML_DateTimeSelector_UIATest);

            CboYears.SearchProperties[XamlComboBox.PropertyNames.AutomationId] = "YearsList";

            CboYears.SelectedItem  = "2010";
            CboMonths.SelectedItem = "October";
            CboDays.SelectedIndex  = 22;

            msg += ".After:" + GetDateTime(MS_XAML_DateTimeSelector_UIATest);
            Assert.AreEqual("Before:19/March/2010/12/00/AM/.After:23/October/2010/12/00/AM/", msg);
        }
Esempio n. 12
0
 public CodedUITest1()
 {
     XamlWindow myAppWindow = XamlWindow.Launch("53fc6321-07ff-4efe-8cd3-d946d18d8643_5smkd5rccf47t!App");
 }
 /// <summary>
 /// Launch App mentioned in App.config
 /// </summary>
 /// <returns>AppWindow</returns>
 public static XamlWindow LaunchApp()
 {
     Logger.InsertLogLine("Launching the App");
     xamlAppWindow = new XamlWindow();
     xamlAppWindow.SearchProperties.Add(XamlWindow.PropertyNames.AutomationId, ConfigurationManager.AppSettings["AppName"].ToString(), XamlWindow.PropertyNames.Name, ConfigurationManager.AppSettings["WindowName"].ToString());
     if (!xamlAppWindow.Exists)
     {
     xamlAppWindow = XamlWindow.Launch(ConfigurationManager.AppSettings["AppName"].ToString());
         xamlAppWindow.CloseOnPlaybackCleanup = true;
     }
     xamlAppWindow.CloseOnPlaybackCleanup = true;
     return xamlAppWindow;
 }
 public void CheckLoadingTextIsShown()
 {
     XamlWindow.Launch("d131933c-490a-4b6b-ac88-cf9b43fd999a_5v9vtwr4m7rda!App");
     this.UIMap.CheckStartUpText();
 }