Beispiel #1
0
        public void AnimalAgReport()
        {
            string reportValue;
            int    scenarioCount = 0;

            foreach (var scenario in xmlReport.AnimalAgReportScenarioList)
            {
                int typeCount = 1;
                foreach (var report in scenario.AnimalAgReportList)
                {
                    var aValues = new AnimalAgValues();

                    aValues.SetExpected(report);

                    //Select AnimalAg Tab
                    gMethods.FindAndClick(By.XPath("//div[contains(@id,'reportTabs')]/div/div/div/div[*]/em/button/span[contains(.,'Animal Agriculture')]"), driver, true);

                    gMethods.AddDelay(2000);

                    // Grabs the values off the report table and compares to expected values
                    for (int i = 0; i < 2; i++)
                    {
                        reportValue = gMethods.FindValue(By.XPath("//div[contains(@id,'animalReportContainer')]/div/div[1]/div/table/tbody/tr[" + (typeCount * 3) + "]/td/table/tbody/tr[" + (i + 2) + "]/td[" + (scenarioCount + 6) + "]/div"), driver);

                        gMethods.AddDelay(300);

                        aValues.SetActual(i, reportValue);
                    }

                    reportValue = gMethods.FindValue(By.XPath("//div[contains(@id,'animalReportContainer')]/div/div[1]/div/table/tbody/tr[" + (typeCount * 3 + 1) + "]/td[" + (scenarioCount + 6) + "]/div"), driver);

                    aValues.SetActual(2, reportValue);

                    aValues.CalculatePYield();

                    AnimalAgReports.Add(aValues);

                    typeCount++;
                }
                scenarioCount++;
                if (scenario.Name != "Baseline")
                {
                    scenarioCount++;
                }
            }
        }
Beispiel #2
0
        public void CreateAnimalAgTable(HtmlTextWriter writer, AnimalAgValues values)
        {
            var Expected = values.GetExpected();
            var Actual   = values.GetActual();
            var PYield   = values.GetPYield();


            //Animal Ag Table
            writer.RenderBeginTag("table style='width:100%' border='2' border-collapse: 'collapse'");
            CreateHeaderRow(writer, values.ScenarioName, values.TypeName, "", "");
            CreateHeaderRow(writer, "Animal Ag", "Expected", "Reported", "Percent Yield");
            CreateNormalRow(writer, "Methane", Expected[0].ToString(), Actual[0], PYield[0]);
            CreateNormalRow(writer, "Nitrous Oxide", Expected[1].ToString(), Actual[1], PYield[1]);
            CreateNormalRow(writer, "Total", Expected[2].ToString(), Actual[2], PYield[2]);
            CreateNormalRow(writer, "Site", "", "", MainWindow.getTestLoc());
            writer.RenderEndTag();
            writer.Write("<br>");
        }
Beispiel #3
0
        public object createAnimalAgReport(AnimalAgValues values)
        {
            var Expected = values.GetExpected();
            var Actual   = values.GetActual();
            var PYield   = values.GetPYield();

            var aReport = new
            {
                scenario = values.ScenarioName,
                type     = values.TypeName,
                CH4      = MakeReportObj(Expected[0].ToString(), Actual[0], PYield[0]),
                N2O      = MakeReportObj(Expected[1].ToString(), Actual[1], PYield[1]),
                Total    = MakeReportObj(Expected[2].ToString(), Actual[2], PYield[2]),
            };


            return(aReport);
        }