public void VerifyWeatherReportedForCity() { try { HomePageOps homePageOps = new HomePageOps(); WeatherPageOps weatherPageOps = new WeatherPageOps(); WeatherDetails weatherDetailsFrmUI, weatherDetailsFrmAPI; WeatherReportingAPIHelper weatherReportingAPIHelper = new WeatherReportingAPIHelper(); //Getting Weatherreport details through API //Navigating to Weather reportinf page homePageOps.NaviagateToWeather(); //Selecting the city and getting Weather info weatherPageOps.SelectCity(TestContext.DataRow["CityName"].ToString()); weatherDetailsFrmUI = weatherPageOps.GetWeatherInfo(TestContext.DataRow["CityName"].ToString()); //Getting Weatherreport details through API weatherDetailsFrmAPI = weatherReportingAPIHelper.GetWeatherReportByCity(TestContext.DataRow["CityName"].ToString(), TestContext.DataRow["APIKey"].ToString()); if (!weatherDetailsFrmUI.CompareWeatherReport(weatherDetailsFrmUI, weatherDetailsFrmAPI)) { Assert.Fail("WeatherReport is not in specified range..!!"); } } catch (Exception e) { Logger.exception = e.Message + "\n" + e.StackTrace; throw e; } }
//Launches the url and dismiss the notification allow popup public void LaunchUrl() { UIHelper uiHelper = new UIHelper(); HomePageOps homePageOps = new HomePageOps(); if (ConfigurationManager.AppSettings["Browser"] == "Chrome") { ChromeOptions opt = new ChromeOptions(); opt.BinaryLocation = ConfigurationManager.AppSettings["Chrome"]; driver = new ChromeDriver(ConfigurationManager.AppSettings["ChromeDriver"], opt); driver.Navigate().GoToUrl(ConfigurationManager.AppSettings["NDTVurl"]); uiHelper.WaitForPageLoad(); homePageOps.DismissNotiicationAlert(); } //Else update code for repective browser }
public BaseTest() { loginPageOpsObj = new LoginPageOps(); SheetOpsObj = new SheetOps(); homePageOps = new HomePageOps(); }