public void TestViewStudentPageContent() { var page = new ViewStudentsage(driver); page.Open(); Assert.AreEqual("Students", page.GetPageTitle()); Assert.AreEqual("Registered Students", page.GetPageHeadingText()); var students = page.GetRegisteredStudents(); foreach (string st in students) { Assert.IsTrue(st.IndexOf("(") > 0); Assert.IsTrue(st.IndexOf(")") == st.Length - 1); } }
public void TestAddStudentPage_AddValidStudent() { var page = new AddStudentPage(driver); page.Open(); string name = "Pesho" + DateTime.Now.Ticks; string email = "pesho" + DateTime.Now.Ticks + "@gmail.com"; page.AddStudent(name, email); var viewStudentsPage = new ViewStudentsage(driver); Assert.IsTrue(viewStudentsPage.IsOpen()); var students = viewStudentsPage.GetRegisteredStudents(); string NewStudent = name + " (" + email + ")"; Assert.Contains(NewStudent, students); }