[TestCase("pinkfloyd", "password")] //enters valid username and password public void TestExplorePageTitleAndFooter(string user, string password) { //calls helper method InitLoginPage InitLoginPage(user, password, null, null, null); Thread.Sleep(2000); //creates instance of NavigationControl object Navigationcontrol navControl = new Navigationcontrol(driver); navControl.GotoExplore(); Thread.Sleep(2000); //creates new Explore page object ExploreTitleAndFooter exploreTitleFooter = new ExploreTitleAndFooter(driver); Thread.Sleep(2000); //explore title var expected = "Explore - BC Yips!"; var actual = driver.Title; Assert.AreEqual(expected, actual); //verifies footer on home page expected = "© 2020 - Bellevue College"; actual = exploreTitleFooter.FooterBC.Text; Assert.AreEqual(expected, actual, "Footer does not match"); }
//helper method to find elements private void Init() { //h3 header topHashtags = By.XPath("//*[@class=\"trending-hashtags\"]/header/h3"); topYippers = By.XPath("//*[@class=\"Explore\"]//section[2]/header/h3"); //explore title and footer class expTitleFooter = new ExploreTitleAndFooter(this.driver); //navigation control class navControl = new Navigationcontrol(this.driver); }