public void Test001_AddSuperUser() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Super User'"); HostSuperUserAccountsPage hostSuperUserAccountsPage = new HostSuperUserAccountsPage(_driver); hostSuperUserAccountsPage.OpenUsingButtons(_baseUrl); int itemNumber = hostSuperUserAccountsPage.FindElements(By.XPath(HostSuperUserAccountsPage.SuperUsersList)).Count; hostSuperUserAccountsPage.AddNewUser(_superUserName, _superUserDisplayName, _superUserEmail, _superUserPassword); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list increased by 1"); Assert.That(hostSuperUserAccountsPage.FindElements(By.XPath(HostSuperUserAccountsPage.SuperUsersList)).Count, Is.EqualTo(itemNumber + 1), "The Super user is not added correctly"); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the SuperUser is present in the list"); Assert.IsTrue(hostSuperUserAccountsPage.ElementPresent(By.XPath("//tr[td[contains(text(), '" + _superUserName + "')]]")), "The Super user is not added correctly"); }
public void Test002_EditSuperUser() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit Super User'"); HostSuperUserAccountsPage hostSuperUserAccountsPage = new HostSuperUserAccountsPage(_driver); hostSuperUserAccountsPage.OpenUsingButtons(_baseUrl); hostSuperUserAccountsPage.AddPhoneNumber(_superUserName, _phoneNumber); hostSuperUserAccountsPage.OpenUsingButtons(_baseUrl); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Phone Number is present in the list"); Assert.IsTrue(hostSuperUserAccountsPage.ElementPresent(By.XPath("//tr[td[contains(text(), '" + _superUserName + "')]]/td/span[text() = '" + _phoneNumber + "']")), "The Phone Number is not added correctly"); }
public void Test004_RemoveDeletedSuperUser() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Remove the Super User'"); HostSuperUserAccountsPage hostSuperUserAccountsPage = new HostSuperUserAccountsPage(_driver); hostSuperUserAccountsPage.OpenUsingButtons(_baseUrl); int itemNumber = hostSuperUserAccountsPage.FindElements(By.XPath(HostSuperUserAccountsPage.SuperUsersList)).Count; hostSuperUserAccountsPage.RemoveDeletedUser(_superUserName); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list decreased by 1"); Assert.That(hostSuperUserAccountsPage.FindElements(By.XPath(HostSuperUserAccountsPage.SuperUsersList)).Count, Is.EqualTo(itemNumber - 1), "The Super user is not removed correctly"); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the SuperUser is not present in the list"); Assert.IsFalse(hostSuperUserAccountsPage.ElementPresent(By.XPath("//tr[td[contains(text(), '" + _superUserName + "')]]")), "The Super user is not removed correctly"); }