public virtual void SetUp(Application app, WindowNames windowName)
        {
            application = app;
            Enum name = windowName;

            _windowName = name.ToString();
            GetWindow(_windowName);
        }
Esempio n. 2
0
        public void SetUp(Application app, WindowNames windowName, string criteria)
        {
            base.SetUp(app, windowName);

            controls.Add(nameof(controlNames.click_ok_button), controlFactory.Assign(window.Get <Button>(SearchCriteria.ByAutomationId(nameof(itemNames.okButton))), ControlType.button, ActionType.click));
            controls.Add(nameof(controlNames.write_endDate_datePicker), controlFactory.Assign(windowTools.GetDateTimePicker(window, SearchCriteria.ByAutomationId("endDate")), ControlType.dateTimePicker, ActionType.write, criteria));

            //            controls.Add(nameof(controlNames.), controlFactory.Assign(,ControlType,ActionType));
        }
 public void SetUp(Application app, WindowNames windowName, ITestCommands commands)
 {
     base.SetUp(app, windowName);
     controls.Add(nameof(controlNames.write_username_textBox),
                  controlFactory.Assign(window.Get <WinFormTextBox>(SearchCriteria.ByAutomationId(nameof(itemNames.username))), ControlType.winFormTextBox, ActionType.write, username));
     controls.Add(nameof(controlNames.write_password_textBox),
                  controlFactory.Assign(window.Get <WinFormTextBox>(SearchCriteria.ByAutomationId(nameof(itemNames.password))), ControlType.winFormTextBox, ActionType.write, password));
     controls.Add(nameof(controlNames.doubleClick_ok_button),
                  controlFactory.Assign(window.Get <Button>(SearchCriteria.ByAutomationId(nameof(itemNames.okButton))), ControlType.button, ActionType.doubleClick));
 }
Esempio n. 4
0
        public void SetUp(Application app, WindowNames windowName, string facilityName)
        {
            base.SetUp(app, windowName);
//          controls.Add(nameof(controlNames.click_centralOffice_radioButton), controlFactory.Assign(window.Get<RadioButton>(SearchCriteria.ByAutomationId(nameof(itemNames.centralOfficeRadioButton))), ControlType.radioButton, ActionType.click));
            controls.Add(nameof(controlNames.click_systemAdmin_radioButton), controlFactory.Assign(window.Get <RadioButton>(SearchCriteria.ByAutomationId(nameof(itemNames.systemAdminRadioButton))), ControlType.radioButton, ActionType.click));
            controls.Add(nameof(controlNames.click_facility_radioButton), controlFactory.Assign(window.Get <RadioButton>(SearchCriteria.ByAutomationId(nameof(itemNames.facilityRadioButton))), ControlType.radioButton, ActionType.click));
            controls.Add(nameof(controlNames.click_ok_button), controlFactory.Assign(window.Get <Button>(SearchCriteria.ByAutomationId(nameof(itemNames.okButton))), ControlType.button, ActionType.click));
            controls.Add(nameof(controlNames.click_divisions_comboBox_criteria), controlFactory.Assign(window.Get <ComboBox>(SearchCriteria.ByAutomationId(nameof(itemNames.divisions))), ControlType.winFormComboBox, ActionType.click, "Any"));
            controls.Add(nameof(controlNames.click_listView_listView_criteria), controlFactory.Assign(window.Get <ListView>(SearchCriteria.ByAutomationId(nameof(itemNames.listView))), ControlType.listView, ActionType.click, facilityName));
        }
Esempio n. 5
0
        /// <summary>
        ///
        /// </summary>
        public WindowViewModel()
        {
            CaptureWindow = IntPtr.Zero;

            foreach (var process in Process.GetProcesses().Where(x => x.MainWindowHandle != IntPtr.Zero))
            {
                WindowNames.Add(process.ProcessName);
                m_processNameProcess[process.ProcessName] = process;
            }
        }
Esempio n. 6
0
        public void SetUp(Application app, WindowNames windowName, string searchText)
        {
            base.SetUp(app, windowName);
            controls.Add(nameof(controlNames.write_criteria_winFormTextBox), controlFactory.Assign(window.Get <WinFormTextBox>(SearchCriteria.ByAutomationId(nameof(itemNames.criteria))), ControlType.winFormTextBox, ActionType.write, searchText));
            controls.Add(nameof(controlNames.click_lastName_button), controlFactory.Assign(window.Get <Button>(SearchCriteria.ByAutomationId(nameof(itemNames.lastNameButton))), ControlType.button, ActionType.click));
            controls.Add(nameof(controlNames.click_newClient_button), controlFactory.Assign(window.Get <Button>(SearchCriteria.ByAutomationId(nameof(itemNames.newClientButton))), ControlType.button, ActionType.click));
            controls.Add(nameof(controlNames.click_ok_button), controlFactory.Assign(window.Get <Button>(SearchCriteria.ByAutomationId(nameof(itemNames.okButton))), ControlType.button, ActionType.click));


            //            controls.Add(nameof(controlNames.), controlFactory.Assign(,ControlType,ActionType));
        }
Esempio n. 7
0
        public override void SetUp(Application app, WindowNames windowName)
        {
            base.SetUp(app, windowName);

            //id of visit completion button is not deterministic, but it has a distict borderColor.... not the best solution
            controls.Add(nameof(controlNames.click_visitCompletion_button), controlFactory.Assign(windowTools.GetButton(window, System.Drawing.Color.FromArgb(255, 255, 255, 255)), ControlType.button, ActionType.click));
            controls.Add(nameof(controlNames.click_close_button), controlFactory.Assign(window.Get <Button>(SearchCriteria.ByAutomationId("cancelButton")), ControlType.button, ActionType.click));

            /*TODO: Add more button controls
             *
             */
        }
Esempio n. 8
0
        public void SetUp(Application app, WindowNames windowName, string type, string reason, string note)
        {
            base.SetUp(app, windowName);

            controls.Add(nameof(controlNames.click_ok_button), controlFactory.Assign(window.Get <Button>(SearchCriteria.ByAutomationId(nameof(itemNames.okButton))), ControlType.button, ActionType.click));
            controls.Add(nameof(controlNames.click_cancel_button), controlFactory.Assign(window.Get <Button>(SearchCriteria.ByAutomationId(nameof(itemNames.cancelButton))), ControlType.button, ActionType.click));
            controls.Add(nameof(controlNames.write_note_textBox), controlFactory.Assign(window.Get <TextBox>(SearchCriteria.ByAutomationId(nameof(itemNames.completionNote))), ControlType.textBox, ActionType.write, note));
            controls.Add(nameof(controlNames.click_type_comboBox), controlFactory.Assign(window.Get <ComboBox>(SearchCriteria.ByAutomationId(nameof(itemNames.visitType))), ControlType.winFormComboBox, ActionType.click, type));
            controls.Add(nameof(controlNames.click_reason_comboBox), controlFactory.Assign(window.Get <ComboBox>(SearchCriteria.ByAutomationId(nameof(itemNames.visitCompletionType))), ControlType.winFormComboBox, ActionType.click, reason));


            //controls.Add(nameof(controlNames.write_endDate_datePicker), controlFactory.Assign(windowTools.GetDateTimePicker(window, SearchCriteria.ByAutomationId("endDate")), ControlType.dateTimePicker, ActionType.write, criteria));

            //            controls.Add(nameof(controlNames.), controlFactory.Assign(,ControlType,ActionType));
        }
Esempio n. 9
0
        /// <summary>
        /// Get the name of the window and send it to OpenWindow()
        /// </summary>
        /// <param name="winName">win name</param>
        public void WindowsOpenCheck(WindowNames winName)
        {
            switch (winName)
            {
            case WindowNames.Info:
                OpenWindow("AboutUI");
                break;

            case WindowNames.Settings:
                OpenWindow("SettingsUI");
                break;

            case WindowNames.Break:
                if (Properties.Settings.Default.breakStretches == true)
                {
                    OpenWindow("BreakStretchesUI");
                }
                else if (Properties.Settings.Default.breakStretches == false)
                {
                    OpenWindow("BreakUI");
                }
                break;

            case WindowNames.ToBreak:
                OpenWindow("DueBreakUI");
                break;

            case WindowNames.Main:
                if (Properties.Settings.Default.simpleUI == true)
                {
                    OpenWindow("SimpleUI");
                }
                else if (Properties.Settings.Default.simpleUI == false)
                {
                    OpenWindow("CompleteUI");
                }
                break;

            default:
                throw new ArgumentOutOfRangeException("winName", winName, "Please report to the developer (WB 74)");
            }
        }
Esempio n. 10
0
 /// <summary>
 /// Toggles a window based on the root game object which holds the window
 /// It will disable the window and re-enable every child under the root
 /// </summary>
 /// <param name="window">window to toggle</param>
 /// <param name="forceClose">If true, it will close the window instead of toggling</param>
 private void ToggleWindow(WindowNames window, bool forceClose = false)
 {
     if (forceClose)
     {
         foreach (Transform child in windows[window].transform)
         {
             child.gameObject.SetActive(false);
         }
         currentOpenWindow = WindowNames.none;
     }
     else
     {
         if (currentOpenWindow == window)
         {
             currentOpenWindow = WindowNames.none;
         }
         else
         {
             currentOpenWindow = window;
         }
         foreach (KeyValuePair <WindowNames, GameObject> item in windows)
         {
             if (item.Key == currentOpenWindow)
             {
                 foreach (Transform child in item.Value.transform)
                 {
                     child.gameObject.SetActive(true);
                 }
             }
             else
             {
                 foreach (Transform child in item.Value.transform)
                 {
                     child.gameObject.SetActive(false);
                 }
             }
         }
     }
     CheckPause();
 }
        public void SetUp(Application app, WindowNames windowName, ITestCommands commands)
        {
            base.SetUp(app, windowName);

            controls.Add(nameof(controlNames.doubleClick_ok_button), controlFactory.Assign(window.Items[0], ControlType.button, ActionType.doubleClick));
        }