예제 #1
0
        public void Scenario1()
        {
            //Action
            UserInputs.PressKey((int)VirtualKeys.F2);
            Thread.Sleep(10000);
            ViPrClass.SetDocNumberAndSN(NunitSettings.DocumentNumber, NunitSettings.SN);

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

            UserInputs.HotKey(KeyboardInput.SpecialKeys.CONTROL, "M");
            //Set PendReason to Maternity
            UserInputs.PressKey((int)VirtualKeys.M);
            Thread.Sleep(2000);

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

            Console.WriteLine("Before Exit ViPr");
            ViPrClass.ExitVipr();

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

            // Create List of Expected hotkeys
            List <OpenSpan> ExpHotkeys = new List <OpenSpan>();

            ExpHotkeys.Add(OpenSpanEvents.F2_hotkey);
            ExpHotkeys.Add(OpenSpanEvents.AltA_hotkey);
            ExpHotkeys.Add(OpenSpanEvents.AltA_hotkey);
            ExpHotkeys.Add(OpenSpanEvents.AltA_hotkey);
            ExpHotkeys.Add(OpenSpanEvents.CtrlM_hotkey);
            ExpHotkeys.Add(OpenSpanEvents.CtrlM_hotkey);

            //Check if Expected hotkeys correspond to Actual
            CheckResults.CheckAllHotkeys(ExpHotkeys);

            List <string> ExpApplications = new List <string>();

            ExpApplications.Add("\"C:\\Program Files\\ViPr\\ViPr.exe\"");
            //ExpApplications.Add("Inquiry:Inquiry - Session 3");

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

            //Create Expected data for Close event.
            List <OpenSpanClose> ExpectedCloseEventList = new List <OpenSpanClose>();
            OpenSpanClose        ExpectedCloseEvent     = new OpenSpanClose();

            ExpectedCloseEvent.trigger               = "z030_Proclaim_WU_Close.WorkUnitClose";
            ExpectedCloseEvent.application_id        = "Proclaim";
            ExpectedCloseEvent.document_id           = "0431202304001";
            ExpectedCloseEvent.work_unit_status_code = "O";

            ExpectedCloseEventList.Add(ExpectedCloseEvent);

            // Check if expected CloseEvent correspond to Actual.
            CheckResults.CheckWorkUnitClose(ExpectedCloseEventList);

            //Here we check if number of Close an Open events are the same
            Assert.AreEqual(PacketParser.GetAllCloseEvents(Path.Combine(NunitSettings.BackupFolder, String.Concat(TestHelper.getTestName(), ".xml"))).Count, PacketParser.GetAllOpenEvents(Path.Combine(NunitSettings.BackupFolder, String.Concat(TestHelper.getTestName(), ".xml"))).Count);
        }
예제 #2
0
        public void Scenario3()
        {
            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);
            UserInputs.HotKey(KeyboardInput.SpecialKeys.ALT, "A");
            Thread.Sleep(5000);

            Console.WriteLine("SwitchToSession3");
            ViPrClass.SwitchToSession3();


            UserInputs.PressKey((int)VirtualKeys.F4);
            Thread.Sleep(1000);
            UserInputs.PressKey((int)VirtualKeys.Tab);
            Thread.Sleep(2000);


            Console.WriteLine("SetDocNumberAndSN");
            UserInputs.PressKey(6);
            Thread.Sleep(100);
            ViPrClass.EnterNumberInSession(NunitSettings.DocumentNumber);

            //ViPrClass.SetDocNumberAndSN("0431202304001", "9");

            UserInputs.PressEnter();
            Thread.Sleep(5000);
            UserInputs.PressEnter();
            Thread.Sleep(5000);
            UserInputs.PressKey((int)VirtualKeys.M);
            Thread.Sleep(100);
            UserInputs.PressKey((int)VirtualKeys.H);
            Thread.Sleep(100);
            UserInputs.PressKey((int)VirtualKeys.I);
            Thread.Sleep(100);

            UserInputs.PressEnter();
            Thread.Sleep(5000);

            Console.WriteLine("Return from SESSION3 to ViPr");
            ViPrClass.SwitchToViPr();

            UserInputs.PressKey((int)VirtualKeys.O);
            Thread.Sleep(5000);

            UserInputs.HotKey(KeyboardInput.SpecialKeys.ALT, "A");
            Thread.Sleep(5000);
            UserInputs.HotKey(KeyboardInput.SpecialKeys.CONTROL, "M");
            Thread.Sleep(5000);
            //SetPendReason "ALLI-ALLIANCE"
            UserInputs.PressKey((int)VirtualKeys.A);
            Thread.Sleep(2000);
            UserInputs.PressKey((int)VirtualKeys.A);
            Thread.Sleep(2000);
            UserInputs.PressKey((int)VirtualKeys.A);
            Thread.Sleep(2000);
            UserInputs.HotKey(KeyboardInput.SpecialKeys.CONTROL, "M");
            Thread.Sleep(5000);

            //Stop services
            Service.Stop(NunitSettings.ServiceWdName);
            Service.Stop(NunitSettings.ServiceDttName);
            Thread.Sleep(20000);

            ViPrClass.ExitVipr();

            // Create List of Expected hotkeys
            List <OpenSpan> ExpHotkeys = new List <OpenSpan>();

            ExpHotkeys.Add(OpenSpanEvents.F2_hotkey);
            ExpHotkeys.Add(OpenSpanEvents.AltA_hotkey);
            ExpHotkeys.Add(OpenSpanEvents.AltA_hotkey);
            ExpHotkeys.Add(OpenSpanEvents.F4_hotkey);
            ExpHotkeys.Add(OpenSpanEvents.AltA_hotkey);
            ExpHotkeys.Add(OpenSpanEvents.CtrlM_hotkey);
            ExpHotkeys.Add(OpenSpanEvents.CtrlM_hotkey);

            //Check if Expected hotkeys correspond to Actual
            CheckResults.CheckAllHotkeys(ExpHotkeys);

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

            ExpApplications.Add("\"C:\\Program Files\\ViPr\\ViPr.exe\"");
            ExpApplications.Add("\"C:\\Program Files\\E!PC\\EXTRA.exe\" -Embedding");
            ExpApplications.Add("Inquiry:Screen 3 - Medical History");
            ExpApplications.Add("\"C:\\Program Files\\ViPr\\ViPr.exe\"");

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

            // Check screen destroying.
            List <OpenSpanClose> ExpScreen7Destroy  = new List <OpenSpanClose>();
            OpenSpanClose        ExpectedCloseEvent = new OpenSpanClose();

            ExpectedCloseEvent.document_id           = NunitSettings.DocumentNumber;
            ExpectedCloseEvent.pend_reason_code      = "AAMC"; //this shoud be confirmed.
            ExpectedCloseEvent.work_unit_status_code = "O";

            ExpScreen7Destroy.Add(ExpectedCloseEvent);
            //Program.CheckScreen_7_DestroyEvent(ExpScreen7Destroy);

            //Here we check if number of Close an Open events are the same
            Assert.AreEqual(PacketParser.GetAllCloseEvents(Path.Combine(NunitSettings.BackupFolder, String.Concat(TestHelper.getTestName(), ".xml"))).Count, PacketParser.GetAllOpenEvents(Path.Combine(NunitSettings.BackupFolder, String.Concat(TestHelper.getTestName(), ".xml"))).Count);
        }