//helper method to find elements private void Init() { //title page homepageTitle = By.XPath("/html/head/title"); //footer footerBC = By.XPath("/html/body/footer"); //all recent feed allYipsh2Header = By.XPath("//*[@class=\"yips-list\"]/h2"); //compose new yip class composeYip = new ComposeNewYip(this.driver); //Search box class searchBox = new SearchBox(this.driver); //navigation control class navControl = new Navigationcontrol(this.driver); yipListControl = new YipsListControl(this.driver); }
[TestCase("user", "password")] //enters valid username and password public void TestFirstYip(string user, string password) { //calls helper method InitLoginPage InitLoginPage(user, password, null, null, null); Thread.Sleep(2000); //creates instance of composenewyip object ComposeNewYip newyip = new ComposeNewYip(driver); Thread.Sleep(2000); //sends 'Desired text' into textarea based the 'Count' mentioned and clicks on yip button newyip.ComposeYip("Wind!", 5, true); //creates a yipsinyipslist object YipsInYipsList yipElement = new YipsInYipsList(driver); Thread.Sleep(6000); //verifies fullname, username and yip content yipElement.VerifyYipElements("Tom Sanders", "user", "Wind!Wind!Wind!Wind!Wind!"); }
[TestCase("user", "password")] //enters valid username and password public void TestComposeNewYip(string user, string password) { //calls helper method InitLoginPage InitLoginPage(user, password, null, null, null); Thread.Sleep(2000); //creates instance of composenewyip object ComposeNewYip newyip = new ComposeNewYip(driver); //sends 'Desired text' into textarea based the 'Count' mentioned and clicks on yip button newyip.ComposeYip("Wow!", 20, true); Thread.Sleep(2000); //calls verify method-- it checks the yiptext and the remaining count of charlabel newyip.Verify("", 140); Thread.Sleep(2000); //creates instance of NavigationControl object Navigationcontrol navControl = new Navigationcontrol(driver); //verifies navigation links VerifyNavigationControl(navControl); //signs out from homepage navControl.SignOut(); }