Esempio n. 1
0
        public void ReCalculateVoulmeWhenRepeatDelete(string RepeatOrDelete)
        {
            // get last row of table Fluid from Xpath
            string       pathFluidTable = "/form[@name='frmMain']/?/?/form[@name='frmFluidBalanceModule']/?/?/tabpage[@name='tsFluidInput']/?/?/table[@class='TcxGridSite']";
            IList <Cell> lstCell        = UserCodeCollection_OR.GetLastRowOfTable(pathFluidTable);

            //// Validate Finishlevel (cell4), VolumeGiven (cell5), and TotalRunning(cell7). In code thesse number should be (number -1)

            if (RepeatOrDelete == "Repeat")
            {
                // Check FinishLevel=0
                Report.Log(ReportLevel.Info, "Validation", "Validate Finishlevel =0 when click on Finish button");
                Validate.AreEqual(lstCell[3].GetAttributeValue <string>("Text"), "0");
                Delay.Milliseconds(0);

                // Check VolumeGiven= startLevel
                Report.Log(ReportLevel.Info, "Validation", "Validate VolumeGiven equal StartLevel");
                Validate.AreEqual(lstCell[4].GetAttributeValue <string>("Text"), repo.StartLevel);
                Delay.Milliseconds(0);

                //recalculate RunningTotal
                repo.RunningTotal = Convert.ToString(Convert.ToInt32(repo.RunningTotal) + Convert.ToInt32(repo.StartLevel));
                //Recalculate Totalvolume(=VolumeGiven) in Summary tab
                repo.VolumeGiven = repo.RunningTotal;

                // Check TotalRunning
                Report.Log(ReportLevel.Info, "Validation", "Validate TotalRunningl is empty");
                Validate.AreEqual(lstCell[6].GetAttributeValue <string>("Text"), repo.RunningTotal);
                Delay.Milliseconds(0);
            }

            else if (RepeatOrDelete == "Delete")
            {
                //recalculate RunningTotal
                repo.RunningTotal = Convert.ToString(Convert.ToInt32(repo.RunningTotal) - Convert.ToInt32(repo.StartLevel));
                //Recalculate Totalvolume(=VolumeGiven) in Summary tab
                repo.VolumeGiven = repo.RunningTotal;

                // Check FinishLevel = its original
                Report.Log(ReportLevel.Info, "Validation", "Validate Finishlevel = original FinishLevel when click on Delete button");
                Validate.AreEqual(lstCell[3].GetAttributeValue <string>("Text"), repo.FinishLevel);
                Delay.Milliseconds(0);

                // Check VolumeGiven= its original
                Report.Log(ReportLevel.Info, "Validation", "Validate VolumeGiven equal StartLevel");
                Validate.AreEqual(lstCell[4].GetAttributeValue <string>("Text"), repo.VolumeGiven);
                Delay.Milliseconds(0);

                // Check TotalRunning
                Report.Log(ReportLevel.Info, "Validation", "Validate TotalRunningl is empty");
                Validate.AreEqual(lstCell[6].GetAttributeValue <string>("Text"), repo.RunningTotal);
                Delay.Milliseconds(0);
            }
        }
Esempio n. 2
0
        public void CompleteFinishLevel(string CompleteFLevel)
        {
            // get last row of table Fluid from Xpath
            string       pathFluidTable = "/form[@name='frmMain']/?/?/form[@name='frmFluidBalanceModule']/?/?/tabpage[@name='tsFluidInput']/?/?/table[@class='TcxGridSite']";
            IList <Cell> lstCell        = UserCodeCollection_OR.GetLastRowOfTable(pathFluidTable);

            if (CompleteFLevel == "Finish")
            {
                //Report.Log(ReportLevel.Info,"Click item 'AddFluidInput.ButtonFinish'", repo.AddFluidInput.ButtonFinishInfo, new RecordItemIndex(2));
                Report.Log(ReportLevel.Info, "Mouse", "Click item 'AddFluidInput.ButtonFinish'.", repo.AddFluidInput.CompleteFluidFinishLevelInfo);
                repo.AddFluidInput.ButtonFinish.Click();
                Delay.Milliseconds(200);
            }
        }