// readonly string _whichTest; public CFarmXmlTest(BrowserDriver driver, GeneralTestMethods gMethods, CFarmXmlLister cFarmXml, string username, string url) { //don't use _whichTest, look at which nodes are present in the xml. // _whichTest = whichTest; this.driver = driver; this.gMethods = gMethods; gMethods.SetErrorStrings("none", "CFarmXmlTestConstructor"); CFarmIntro(username, url); ActivitiesSetup(cFarmXml); if (cFarmXml._xmlDoc.CFarmCroplandsData != null) //(whichTest.Contains("Croplands")) { var CFarmXmlCroplands = new CFarmXmlCroplands(gMethods, driver, cFarmXml._xmlDoc.CFarmCroplandsData); } if (cFarmXml._xmlDoc.CFarmAnimalAgData != null) //(whichTest.Contains("AnimalAg")) { var CFarmXmlAnimalAg = new CFarmXmlAnimalAg(gMethods, driver, cFarmXml._xmlDoc.CFarmAnimalAgData); } if (cFarmXml._xmlDoc.CFarmAgroforestryData != null)//(whichTest.Contains("Agroforestry")) { var CFarmXmlAgroforestry = new CFarmXmlAgroforestry(gMethods, driver, cFarmXml._xmlDoc.CFarmAgroforestryData); } if (cFarmXml._xmlDoc.CFarmForestryData != null)//(whichTest.Contains("Forestry")) { var CFarmXmlForestry = new CFarmXmlForestry(gMethods, driver, cFarmXml._xmlDoc.CFarmForestryData); } }
public CFarmAnimalAg(GeneralTestMethods gMethods, BrowserDriver driver, string whichTest) { this.gMethods = gMethods; this.driver = driver; _whichTest = whichTest; PropertyLocation(); AnimalTypes(); //Herds(); // "Ok" button gMethods.FindAndClick(By.XPath("/html/body/div[10]/div[3]/div/div/em/button"), driver, true); NumberOfDiets(); AnimalDetails(); Weight(); FeedDetails(); //PregnancyAndMilk(); //TypesOfFeed(); //FeedingSituation(); ManureSystemTypes(); ManureSystemDetails(); ManureDetails(); CreateCropScenario(true, "Future"); EndAnimalAg(); }
public CFarmReport(GeneralTestMethods gMethods, BrowserDriver driver, string whichTest) { this.gMethods = gMethods; this.driver = driver; this.whichTest = whichTest; AddToExpectedValues(); // This exists to check if the Report page finished loading gMethods.WaitForElement(By.XPath("/html/body/div[2]/div[3]/div/div[2]/div[1]/div/div[1]/div[3]"), driver); gMethods.AddDelay(2000); if (whichTest.Contains("Cropland")) { CroplandsReport(); } else if (whichTest.Contains("AnimalAg")) { AnimalAgReport(); } else if (whichTest.Contains("Agroforestry")) { AgroforestryReport(); } else if (whichTest.Contains("Forestry")) { ForestryReport(); } //gMethods.SendEmail(null, EmailDataString(), null); }
public CFarmAgroforestry(GeneralTestMethods gMethods, BrowserDriver driver, string whichTest) { this.gMethods = gMethods; this.driver = driver; ManagementLocation(); CurrentAgroforestry(); EndAgroforestry(); }
public CFarmForestry(GeneralTestMethods gMethods, BrowserDriver driver) { this.gMethods = gMethods; this.driver = driver; ParcelLocationsPage(); StandManagement(); EndForestry(); }
public CFarmXmlForestry(GeneralTestMethods gMethods, BrowserDriver driver, CFarmXmlLister.CFarmForestryData xmlForestry) { this.gMethods = gMethods; this.driver = driver; this.xmlForestry = xmlForestry; ParcelLocationsPage(); StandManagement(); EndForestry(); }
public CFarmTest(string whichBrowser, string whichTest) { driver = new BrowserDriver(whichBrowser); gMethods = new GeneralTestMethods(); _whichTest = whichTest; _whichBrowser = whichBrowser; gMethods.SetErrorStrings("none", "CFarmTestConstructor"); try { CFarmIntro(); ActivitiesSetup(); if (whichTest == "CFarmCroplands") { CFarmCroplands CFarmCroplands = new CFarmCroplands(gMethods, driver, _whichTest); } if (whichTest == "CFarmCroplandsDemo") { CFarmCroplandsDemo(); } if (whichTest == "CFarmAnimalAg") { CFarmAnimalAg CFarmAnimalAg = new CFarmAnimalAg(gMethods, driver, _whichTest); } if (whichTest == "CFarmAgroforestry") { CFarmAgroforestry CFarmAgroforestry = new CFarmAgroforestry(gMethods, driver, _whichTest); } if (whichTest == "CFarmForestry") { CFarmForestry CFarmForestry = new CFarmForestry(gMethods, driver); } if (whichTest == "CFarmComprehensive") { CFarmCroplands CFarmCroplands = new CFarmCroplands(gMethods, driver, whichTest); CFarmAnimalAg CFarmAnimalAg = new CFarmAnimalAg(gMethods, driver, whichTest); CFarmAgroforestry CFarmAgroforestry = new CFarmAgroforestry(gMethods, driver, whichTest); CFarmForestry CFarmForesty = new CFarmForestry(gMethods, driver); } CFarmReport CFarmReport = new CFarmReport(gMethods, driver, _whichTest); // This exists to check if the Report page finished loading //gMethods.FindAndClick(By.XPath("/html/body/div[2]/div[3]/div/div[2]/div[1]/div/div[1]/div[3]"), driver, true); } catch (Exception e) { //gMethods.SendEmail(null,null,null); } driver.Driver.Quit(); }
///CFarmXmlLister.CFarmCroplandsData xmlCroplands; ///constructor public CFarmXmlScratch(GeneralTestMethods gMethods, BrowserDriver driver /*place holder for CFarmXmlLister*/) { this.gMethods = gMethods; this.driver = driver; ///this.lister = passed lister ///add methods to be called in constructor here /* * foreach (var scenario in *CFarmXmlLister*.CroplandsScenarioList) * { * if (scenario.Name != "Baseline") //Creating a crop scenario isn't avialable until after the Baseline is complete * { * CreateCropScenario(scenario); * } * if (scenario.CopyFromBaseline != true) //If a future scenario copies the baseline, input data is already complete * { * foreach (var scenarioData in scenario.ScenarioDataList) * { * if (scenario.ScenarioDataList.IndexOf(scenarioData) != 0) * { * // "Ok" button for unfinished scenario * gMethods.FindAndClick(By.XPath("//div[contains(@id,'messagebox')]/div[3]/div/div/em/button"), driver, true); * } * * CropAndPlant(scenarioData); * TillagePage(scenarioData); * NitrogenPage(scenarioData); * ManurePage(scenarioData); * IrrigationPage(scenarioData); * LimingPage(scenarioData); * BurningPage(scenarioData); * CopyCrop(scenarioData, scenario.Name); * } * } * else * { * gMethods.AddDelay(6000); * * // "Skip Ahead" button * gMethods.FindAndClick(By.XPath("//span[contains(.,'Skip Ahead >>')]"), driver, true); * * CopyCrop(null, null); * } * EndScenario(scenario); * } * EndCroplands(); */ }
public CFarmXmlAgroforestry(GeneralTestMethods gMethods, BrowserDriver driver, CFarmXmlLister.CFarmAgroforestryData xmlAgroforestry) { this.gMethods = gMethods; this.driver = driver; this.xmlAgroforestry = xmlAgroforestry; ManagementLocation(); foreach (var species in xmlAgroforestry.AgroforestrySpeciesList) { CurrentAgroforestry(species); } EndAgroforestry(); }
public CFarmCroplands(GeneralTestMethods gMethods, BrowserDriver driver, string whichTest) { this.gMethods = gMethods; this.driver = driver; ParcelLocationsPage(); HistoricManagementPage(); CropAndPlant(); TillagePage(); NitrogenPage(); // "Next" button gMethods.FindAndClick(By.XPath("/html/body/div[2]/div[3]/div/div[2]/div[8]/span/a/span[2]"), driver, true); IrrigationPage(); EndCrops(false); CreateCropScenario(true, "Future"); EndCrops(true); }
public CFarmEmail(GeneralTestMethods gMethods) { this.gMethods = gMethods; emailList = new List <string>(); //emailList.Add("*****@*****.**"); emailList.Add("*****@*****.**"); //emailList.Add("*****@*****.**"); //emailList.Add("*****@*****.**"); //emailList.Add("*****@*****.**"); //emailList.Add("*****@*****.**"); //emailList.Add("*****@*****.**"); //emailList.Add("*****@*****.**"); //emailList.Add("*****@*****.**"); //emailList.Add("*****@*****.**"); // 0 is tests done, 1 is tests passed testPassCount = new int[2]; }
public CFarmXmlReport(GeneralTestMethods gMethods, BrowserDriver driver, CFarmXmlLister cFarmXml, CFarmXmlLister.CFarmReportData xmlReport) { this.gMethods = gMethods; this.driver = driver; //this.whichTest = whichTest; this.xmlReport = xmlReport; CroplandReports = new List <CroplandValues>(); AnimalAgReports = new List <AnimalAgValues>(); AgroforestryReports = new List <AgroforestryValues>(); ForestryReports = new List <ForestryValues>(); gMethods.AddDelay(2000); // If the xml filename contains these strings if (cFarmXml._xmlDoc.CFarmCroplandsData != null)//(whichTest.Contains("Cropland")) { gMethods.Wait30Minutes(By.XPath("//span[contains(.,'100% Complete')]"), driver); CroplandsReport(); } if (cFarmXml._xmlDoc.CFarmAnimalAgData != null)//(whichTest.Contains("AnimalAg")) { gMethods.WaitLongTime(By.XPath("//span[contains(.,'Source') and not(contains(@display,'none'))]"), driver); AnimalAgReport(); } if (cFarmXml._xmlDoc.CFarmAgroforestryData != null) //(whichTest.Contains("Agroforestry")) { gMethods.WaitLongTime(By.XPath("//span[contains(.,'Source') and not(contains(@display,'none'))]"), driver); AgroforestryReport(); } if (cFarmXml._xmlDoc.CFarmForestryData != null) //(whichTest.Contains("Forestry")) { gMethods.WaitLongTime(By.XPath("//span[contains(.,'Source') and not(contains(@display,'none'))]"), driver); ForestryReport(); } }