Esempio n. 1
0
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.00;

            Init();

            // Select Mode
            DRUGCodeCollection.SelectMode(Mode);
            Delay.Milliseconds(0);

            // Enter Dose/Rate
            DRUGCodeCollection.EnterDosage(Mode, Dosage);
            Delay.Milliseconds(0);

            // Enter Unit
            DRUGCodeCollection.EnterUnit(Mode, Unit);
            Delay.Milliseconds(0);
        }
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.00;

            Init();

            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'FrmORMain.Drugs.Drugs.DrugListItem' at Center.", repo.FrmORMain.Drugs.Drugs.DrugListItemInfo, new RecordItemIndex(0));
            repo.FrmORMain.Drugs.Drugs.DrugListItem.Click();
            Delay.Milliseconds(200);

            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'FrmORMain.Drugs.Drugs.EditDrug' at Center.", repo.FrmORMain.Drugs.Drugs.EditDrugInfo, new RecordItemIndex(1));
            repo.FrmORMain.Drugs.Drugs.EditDrug.Click();
            Delay.Milliseconds(200);

            Report.Log(ReportLevel.Info, "Get Value", "Getting attribute 'Text' from item 'FrmEditDrug.DrugTime' and assigning its value to variable 'TimeAddDrug'.", repo.FrmEditDrug.DrugTimeInfo, new RecordItemIndex(2));
            TimeAddDrug = repo.FrmEditDrug.DrugTime.Element.GetAttributeValueText("Text");
            Delay.Milliseconds(0);

            // Select Mode
            DRUGCodeCollection.SelectMode(NewMode);
            Delay.Milliseconds(0);

            // Enter new Dose/Rate
            DRUGCodeCollection.EnterDosage(NewMode, NewDosage);
            Delay.Milliseconds(0);

            // Enter new Unit
            DRUGCodeCollection.EnterUnit(NewMode, NewUnit);
            Delay.Milliseconds(0);

            // Reassign DoseUnit
            ReAssignDoseUnit(NewDoseUnit);
            Delay.Milliseconds(0);

            // Click Ok
            Report.Log(ReportLevel.Info, "Mouse", "Click Ok\r\nMouse Left Click item 'FrmEditDrug.OK' at Center.", repo.FrmEditDrug.OKInfo, new RecordItemIndex(7));
            repo.FrmEditDrug.OK.Click();
            Delay.Milliseconds(200);
        }
Esempio n. 3
0
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.00;

            Init();

            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'FrmORMain.OR_Modules.Drugs' at Center.", repo.FrmORMain.OR_Modules.DrugsInfo, new RecordItemIndex(0));
            repo.FrmORMain.OR_Modules.Drugs.Click();
            Delay.Milliseconds(200);

            // Click on Drug tab
            Report.Log(ReportLevel.Info, "Mouse", "Click on Drug tab\r\nMouse Left Click item 'FrmORMain.Drugs.Tabs.DrugsTab' at Center.", repo.FrmORMain.Drugs.Tabs.DrugsTabInfo, new RecordItemIndex(1));
            repo.FrmORMain.Drugs.Tabs.DrugsTab.Click();
            Delay.Milliseconds(200);

            // Press F4 to add drug
            Report.Log(ReportLevel.Info, "Keyboard", "Press F4 to add drug\r\nKey 'F4' Press.", new RecordItemIndex(2));
            Keyboard.Press(System.Windows.Forms.Keys.F4, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);

            // Save the time when add drug
            Report.Log(ReportLevel.Info, "Get Value", "Save the time when add drug\r\nGetting attribute 'Text' from item 'FrmEditDrug.DrugTime' and assigning its value to variable 'TimeAddDrug'.", repo.FrmEditDrug.DrugTimeInfo, new RecordItemIndex(3));
            TimeAddDrug = repo.FrmEditDrug.DrugTime.Element.GetAttributeValueText("Text");
            Delay.Milliseconds(0);

            // Press tab from Drug Product
            Report.Log(ReportLevel.Info, "Keyboard", "Press tab from Drug Product\r\nKey 'Tab' Press.", new RecordItemIndex(4));
            Keyboard.Press(System.Windows.Forms.Keys.Tab, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);

            // Open Add new drug window
            Report.Log(ReportLevel.Info, "Keyboard", "Open Add new drug window\r\nKey 'Enter' Press.", new RecordItemIndex(5));
            Keyboard.Press(System.Windows.Forms.Keys.Return, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);

            // Enter a new Drug name
            Report.Log(ReportLevel.Info, "Keyboard", "Enter a new Drug name\r\nKey sequence from variable '$DrugProduct'.", new RecordItemIndex(6));
            Keyboard.Press(DrugProduct);
            Delay.Milliseconds(100);

            Report.Log(ReportLevel.Info, "Keyboard", "Key 'Enter' Press.", new RecordItemIndex(7));
            Keyboard.Press(System.Windows.Forms.Keys.Return, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);

            // Press tab to focus on button OK
            Report.Log(ReportLevel.Info, "Keyboard", "Press tab to focus on button OK\r\nKey 'Tab' Press.", new RecordItemIndex(8));
            Keyboard.Press(System.Windows.Forms.Keys.Tab, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);

            // Press enter to save
            Report.Log(ReportLevel.Info, "Keyboard", "Press enter to save\r\nKey 'Enter' Press.", new RecordItemIndex(9));
            Keyboard.Press(System.Windows.Forms.Keys.Return, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);

            // Validate new drug is displayed in Drug name
            Report.Log(ReportLevel.Info, "Validation", "Validate new drug is displayed in Drug name\r\nValidating AttributeEqual (Text=$DrugProduct) on item 'FrmEditDrug.DrugProduct'.", repo.FrmEditDrug.DrugProductInfo, new RecordItemIndex(10));
            Validate.AttributeEqual(repo.FrmEditDrug.DrugProductInfo, "Text", DrugProduct);
            Delay.Milliseconds(0);

            // Select Mode
            DRUGCodeCollection.SelectMode(Mode);
            Delay.Milliseconds(0);

            // Enter Dose/Rate
            EnterDosageUsingTab(Mode, Dosage);
            Delay.Milliseconds(0);

            // EnterUnit
            EnterUnitUsingTab(Mode, Unit);
            Delay.Milliseconds(0);

            // EnterComment
            EnterCommentUsingTab(Comment);
            Delay.Milliseconds(0);

            // Enter Route
            EnterRouteUsingTab(Route);
            Delay.Milliseconds(0);

            // Press tab
            Report.Log(ReportLevel.Info, "Keyboard", "Press tab\r\nKey 'Tab' Press.", new RecordItemIndex(16));
            Keyboard.Press(System.Windows.Forms.Keys.Tab, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);

            // Press tab
            Report.Log(ReportLevel.Info, "Keyboard", "Press tab\r\nKey 'Tab' Press.", new RecordItemIndex(17));
            Keyboard.Press(System.Windows.Forms.Keys.Tab, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);

            // Press tab
            Report.Log(ReportLevel.Info, "Keyboard", "Press tab\r\nKey 'Tab' Press.", new RecordItemIndex(18));
            Keyboard.Press(System.Windows.Forms.Keys.Tab, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);

            // Press tab to Button OK
            Report.Log(ReportLevel.Info, "Keyboard", "Press tab to Button OK\r\nKey 'Tab' Press.", new RecordItemIndex(19));
            Keyboard.Press(System.Windows.Forms.Keys.Tab, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);

            // Press tab to Button Cancel
            Report.Log(ReportLevel.Info, "Keyboard", "Press tab to Button Cancel\r\nKey 'Tab' Press.", new RecordItemIndex(20));
            Keyboard.Press(System.Windows.Forms.Keys.Tab, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);

            Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '{Left}{Return}'.", new RecordItemIndex(21));
            Keyboard.Press("{Left}{Return}");
            Delay.Milliseconds(0);

            // Enter to click on OK  to Save Drug
            Report.Log(ReportLevel.Info, "Keyboard", "Enter to click on OK  to Save Drug\r\nKey 'Enter' Press.", new RecordItemIndex(22));
            Keyboard.Press(System.Windows.Forms.Keys.Return, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
            Delay.Milliseconds(0);
        }