Esempio n. 1
0
        public In_Desktop_Use_SchedulingAssisstant_Set_Provider(Application app, string candidateName)
        {
            application = app;
            windowTools = new WindowTools();
            String[] weekDays = new String[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
            //String[] weekDays = new String[] { "Saturday" };
            Button dayToClick = null;

            foreach (string day in weekDays)
            {
                List <Window> windows = windowTools.GetWindows(application);
                window     = windowTools.GetWindow(windows, "HomeHealthDesktop");
                dayToClick = GetButton(window, day);

                if (dayToClick.IsOffScreen == false)
                {
                    dayToClick.DoubleClick();
                }
                else
                {
                    windowTools.MouseDoubleClickPoint(window, new Point(dayToClick.Location.X, dayToClick.Location.Y));
                }

                SetProviderToCalendar(candidateName);
            }

            CloseSchedulingAssistantTab();
        }
Esempio n. 2
0
        private void ClickGDIControl_ClickApplyButton_HandleOverrideDialog()
        {
            Button ApplyButton;
            Point  pointX;

            int track = 353;

            do
            {
                //scheduling window doesn't contain named controls, so mouse clicks
                pointX = new Point(track, 606);

                windowTools.MouseDoubleClickPoint(window, pointX);

                ApplyButton = windowTools.GetButton(window, "Apply Changes");
                track      += 8;
            } while (!ApplyButton.Enabled);

            ApplyButton.DoubleClick();

            int winCount = application.GetWindows().Count;


            var dialogBox = windowTools.GetFirstDescendant(AutomationElement.RootElement,
                                                           (e) => e.Name == "CBI" && e.ClassName == "#32770");

            if (dialogBox != null)
            {
                var button = windowTools.GetFirstDescendant(dialogBox,
                                                            (e) => e.Name.Contains("Yes") && e.ClassName.Contains("Button"));

                Assert.IsNotNull(button);

                var caption = windowTools.GetFirstDescendant(dialogBox,
                                                             (e) => e.Name.Contains("Do you wish to attempt to override availability"));

                ((InvokePattern)button.GetCurrentPattern(InvokePattern.Pattern)).Invoke();
            }
        }