Exemplo n.º 1
0
        public void Test1()
        {
            application = Application.Launch(PaintAppId);
            paintWindow = application.GetWindow("Untitled - Paint");
            MenuBar menuBar = paintWindow.MenuBar;

            Assert.IsNotNull(menuBar, "Paint is not open");
            Menu open = menuBar.MenuItem("File", "Open");

            open = menuBar.MenuItemBy(SearchCriteria.ByText("File"), SearchCriteria.ByText("Open"));
            open.Click();
            Window childWindow = null;

            if (paintWindow.ModalWindows().Any())
            {
                childWindow = paintWindow.ModalWindow("child");
                TextBox textBox = childWindow.Get <TextBox>("currentValueTextBox");
                textBox.Text = "Some image address";
                Button openButton = childWindow.Get <Button>("Open");
                openButton.Click();
                Assert.IsNull(childWindow);
            }
            Button selectExt = paintWindow.Get <Button>(SearchCriteria.ByText("Locator to the extended select"));

            selectExt.Click();
            Button selectAll = paintWindow.Get <Button>(SearchCriteria.ByText("Select All"));

            selectAll.Click();
            Button cut = paintWindow.Get <Button>(SearchCriteria.ByText("Cut"));

            cut.Click();
            application.Close();
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method launches the .exe, selects the "Developer Form" button and submits the Package Item Id captured from the Admin side
        /// </summary>
        public static void getWindow()
        {
            // Launch application instance
            Application application = Application.Launch(ConfigurationManager.AppSettings["PathToAutoClient"]);
            //Window window1 = application.GetWindow("Select Automation Instance", InitializeOption.NoCache);

            //// Select Default Automation from dropdown and click OK
            //// If Auto Client is configured to skip this menu, the next 4 lines can be commented out.
            //ListBox listbox = window1.Get<ListBox>();
            //listbox.Select("Default Automation");
            //Button ok = window1.Get<Button>(SearchCriteria.ByText("OK"));
            //ok.Click();

            // Select Developer Form in Menu Bar and enter package item ID
            Window  window2 = application.GetWindow("eSearch Automation on QA - Default Automation", InitializeOption.NoCache);
            MenuBar menuBar = window2.MenuBar;

            menuBar.MenuItem("Developer Form").Click();

            Keyboard.Instance.Enter(DynamicTestInformation.packageItemId);
            Keyboard.Instance.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN);

            // 30 sec sleep to allow AutoClient to complete processing before results are checked
            Thread.Sleep(30000);
        }
Exemplo n.º 3
0
        public void changeCalcMode(String mode)
        {
            MenuBar menus = (MenuBar)win.Get(SearchCriteria
                                             .ByControlType(ControlType.MenuBar).AndByText("Application"));

            if (mode.Equals("Mortgage"))
            {
                Menu tobeSelected = menus.MenuItem("View", "Worksheets", "Mortgage");
                tobeSelected.Click();
            }
            else
            {
                Menu tobeSelected = menus.MenuItem("View", mode);
                tobeSelected.Click();
                win.WaitWhileBusy();
            }
        }
Exemplo n.º 4
0
        void FindMultiLevelMenuItem()
        {
            MenuBar menuBar = MainWindow.MenuBar;
            Menu    menu    = menuBar.MenuItem("Multi-Level Menu");

            Assert.NotNull(menu.SubMenu(SearchCriteria.ByText("Level 1"))
                           .SubMenu("Level 2")
                           .SubMenu("Level 3"));
        }
Exemplo n.º 5
0
        private void OpenAddLanguage(Window showLabels)
        {
            MenuBar mEdit       = showLabels.Get <MenuBar>("projectMenu");
            var     bAddSubject = mEdit.MenuItem("Edit").ChildMenus[3];

            bAddSubject.Click();

            CreateNewLanguage("FR");
            var bLanguage = showLabels.Get <Button>("FR");

            bLanguage.Click();
        }
Exemplo n.º 6
0
        public static void ExitVipr()
        {
            List <Window> ViPers = ViPr.GetWindows();

            foreach (Window ViPrWindow in ViPers)
            {
                if (ViPrWindow.Name.Contains("ViPr - ["))
                {
                    MenuBar menuBar = ViPrWindow.Get <MenuBar>(SearchCriteria.ByText("Application"));
                    Thread.Sleep(1000);
                    menuBar.MenuItem("Exit").Click();
                }
            }

            Thread.Sleep(15000);
            //Thread.Sleep(45000);
            //ViPrClass.CheckViPrLogoffError();
        }
Exemplo n.º 7
0
        public void DoExitVipr()
        {
            Console.WriteLine("Enter in DoExitVipr)");
            var allItem = Desktop.Instance.Windows();

            foreach (var element in allItem)
            {
                if (element.Name.Contains("ViPr - ["))
                {
                    Console.WriteLine("Click on Exit button of ViPr - called from DoExitViPr)");
                    MenuBar menuBar = element.Get <MenuBar>(SearchCriteria.ByText("Application"));
                    Thread.Sleep(1000);
                    menuBar.MenuItem("Exit").Click();
                }
            }

            Thread.Sleep(45000);
            ViPrClass.CheckViPrLogoffError();
        }
Exemplo n.º 8
0
        public void UITest()
        {
            OpenWinAddProject();
            SaveNewProject();
            CreateNewLanguage("EN");

            Window showLabels = this.application.GetWindow("Show labels - BigTestFun");

            OpenAddLanguage(showLabels);

            AddFastLabels(showLabels);
            AddSlowLabel();
            EditLabel();

            var tbSearch = showLabels.Get <TextBox>("TB_SearchQuery");

            tbSearch.Text = "newlabel";
            tbSearch.Text = string.Empty;

            var bSortLabelName = showLabels.Get <Button>("B_Name");

            bSortLabelName.Click();
            bSortLabelName.Click();

            MenuBar mEdit       = showLabels.Get <MenuBar>("projectMenu");
            var     bAddSubject = mEdit.MenuItem("Edit").ChildMenus[4];

            bAddSubject.Click();

            CreateNewModule();
            RemoveLabels(showLabels);
            SelectFilter(showLabels);

            MenuBar mProject     = showLabels.Get <MenuBar>("projectMenu");
            var     bBackProject = mProject.MenuItem("File").ChildMenus.First();

            bBackProject.Click();
        }
 public static void MenuItem(object obj)
 {
     string[] path = obj as string[];
     menuBar.MenuItem(path).Click();
     bMenuItemClicked = true;
 }
Exemplo n.º 10
0
        public void GROUP()
        {
            Console.WriteLine("GROUP");

            UserInputs.PressKey((int)VirtualKeys.F2);
            Thread.Sleep(5000);
            ViPrClass.SetDocNumberAndSN(NunitSettings.DocumentNumber, NunitSettings.SN);

            //Hot keys
            UserInputs.HotKey(KeyboardInput.SpecialKeys.ALT, "A");
            Thread.Sleep(5000);

            ViPrClass.SwitchToSession2();
            Thread.Sleep(3000);

            Window SESSION2 = ManageWindows.GetWindow("SESSION2");

            MenuBar menuBar = SESSION2.MenuBar;

            White.Core.UIItems.MenuItems.Menu OpenSessionMenu = menuBar.MenuItem("File", "Open Session...");
            OpenSessionMenu.Click();
            Thread.Sleep(2000);

            SESSION2 = ManageWindows.GetWindow("SESSION2");

            var OpenSessionWindow = SESSION2.ModalWindows()[0];

            Thread.Sleep(2000);

            White.Core.UIItems.TextBox FileNameTextBox = OpenSessionWindow.Get <White.Core.UIItems.TextBox>(SearchCriteria.ByAutomationId("1152"));
            FileNameTextBox.Click();
            UserInputs.Enter("Session4.edp");
            Thread.Sleep(2000);
            OpenSessionWindow.Get <White.Core.UIItems.Button>(SearchCriteria.ByText("Open")).Click();
            ViPrClass.SwitchToSession4();

            Thread.Sleep(5000);
            UserInputs.Enter("HSIMSA");
            UserInputs.PressKey((int)KeyboardInput.SpecialKeys.RETURN);
            Thread.Sleep(3000);

            //Enter opertorId
            UserInputs.Enter(NunitSettings.OperatorId);
            UserInputs.PressKey((int)KeyboardInput.SpecialKeys.TAB);
            UserInputs.Enter(NunitSettings.PasswordId);
            UserInputs.PressKey((int)KeyboardInput.SpecialKeys.RETURN);
            Thread.Sleep(3000);
            UserInputs.Enter("GROUP");
            UserInputs.PressKey((int)KeyboardInput.SpecialKeys.RETURN);
            Thread.Sleep(5000);

            ViPrClass.SwitchToViPr();

            UserInputs.HotKey(KeyboardInput.SpecialKeys.ALT, "A");
            Thread.Sleep(8000);

            UserInputs.PressKey((int)VirtualKeys.O);
            Thread.Sleep(2000);
            UserInputs.HotKey(KeyboardInput.SpecialKeys.ALT, "A");
            Thread.Sleep(2000);

            UserInputs.HotKey(KeyboardInput.SpecialKeys.CONTROL, "M");
            Thread.Sleep(5000);

            //Enter Pend Reason "AAMC"
            UserInputs.PressKey((int)VirtualKeys.A);
            Thread.Sleep(2000);

            UserInputs.HotKey(KeyboardInput.SpecialKeys.CONTROL, "M");
            Thread.Sleep(5000);

            ViPrClass.ExitVipr();

            //Stop services
            Service.Stop(NunitSettings.ServiceWdName);
            Service.Stop(NunitSettings.ServiceDttName);

            // Check all FocusIns
            List <string> ExpApplications = new List <string>();

            ExpApplications.Add("https://cigna.esecurecare.net/app/home");
            ExpApplications.Add("https://cigna.esecurecare.net/app/answers/list/search/1/kw/RNC/answers.c$is_healthcare_reform/~any~");
            ExpApplications.Add("C-KIT:Reimbursement RNC 501 Processing Reference Guide");
            ExpApplications.Add("\"C:\\Program Files\\E!PC\\EXTRA.exe\" C:\\Program Files\\E!PC\\Sessions\\Session4.edp");
            ExpApplications.Add("AppUse:Group - Session 4");

            Assert.IsTrue(CheckResults.CheckAllFocusIn(ExpApplications));
        }
Exemplo n.º 11
0
        public void CHIRPS()
        {
            Console.WriteLine("CHIRPS");

            UserInputs.PressKey((int)VirtualKeys.F2);
            Thread.Sleep(5000);
            ViPrClass.SetDocNumberAndSN(NunitSettings.DocumentNumber, NunitSettings.SN);

            //Hot keys
            UserInputs.HotKey(KeyboardInput.SpecialKeys.ALT, "A");
            Thread.Sleep(5000);

            ViPrClass.SwitchToSession2();
            Thread.Sleep(3000);

            Window SESSION2 = ManageWindows.GetWindow("SESSION2");

            MenuBar menuBar = SESSION2.MenuBar;

            White.Core.UIItems.MenuItems.Menu OpenSessionMenu = menuBar.MenuItem("File", "Open Session...");
            OpenSessionMenu.Click();
            Thread.Sleep(2000);

            SESSION2 = ManageWindows.GetWindow("SESSION2");

            var OpenSessionWindow = SESSION2.ModalWindows()[0];

            Thread.Sleep(2000);

            White.Core.UIItems.TextBox FileNameTextBox = OpenSessionWindow.Get <White.Core.UIItems.TextBox>(SearchCriteria.ByAutomationId("1152"));
            FileNameTextBox.Click();
            UserInputs.Enter("Session1.edp");
            Thread.Sleep(2000);
            OpenSessionWindow.Get <White.Core.UIItems.Button>(SearchCriteria.ByText("Open")).Click();
            ViPrClass.SwitchToSession1();

            Thread.Sleep(5000);
            UserInputs.Enter("EBDAA08");
            UserInputs.PressKey((int)KeyboardInput.SpecialKeys.RETURN);
            Thread.Sleep(3000);
            //Enter opertorId
            UserInputs.Enter(NunitSettings.OperatorId);
            UserInputs.PressKey((int)KeyboardInput.SpecialKeys.TAB);
            UserInputs.Enter(NunitSettings.PasswordId);
            UserInputs.PressKey((int)KeyboardInput.SpecialKeys.RETURN);
            Thread.Sleep(3000);
            UserInputs.Enter("GHMM");
            UserInputs.PressKey((int)KeyboardInput.SpecialKeys.RETURN);
            Thread.Sleep(5000);

            ViPrClass.SwitchToViPr();

            UserInputs.HotKey(KeyboardInput.SpecialKeys.ALT, "A");
            Thread.Sleep(8000);

            UserInputs.PressKey((int)VirtualKeys.O);
            Thread.Sleep(2000);
            UserInputs.HotKey(KeyboardInput.SpecialKeys.ALT, "A");
            Thread.Sleep(2000);

            UserInputs.HotKey(KeyboardInput.SpecialKeys.CONTROL, "M");
            Thread.Sleep(5000);

            //Enter Pend Reason "AAMC"
            UserInputs.PressKey((int)VirtualKeys.A);
            Thread.Sleep(2000);

            UserInputs.HotKey(KeyboardInput.SpecialKeys.CONTROL, "M");
            Thread.Sleep(5000);

            ViPrClass.ExitVipr();

            //Stop services
            Service.Stop(NunitSettings.ServiceWdName);
            Service.Stop(NunitSettings.ServiceDttName);

            // Check all FocusIns
            List <string> ExpApplications = new List <string>();

            ExpApplications.Add("AppUse:CHIRPS - Session 1");

            Assert.IsTrue(CheckResults.CheckAllFocusIn(ExpApplications));
        }