public void EntryMainAddNewClient() { Utils.TimeOut(driver); AdminLoginPage loginPage = new AdminLoginPage(driver); MainPage mainTab = new MainPage(driver); ChangeClientName changeName = new ChangeClientName(driver); DisableEnableClient disableEnableClient = new DisableEnableClient(driver); AddClientNote addClientNote = new AddClientNote(driver); AddAClient addClient = new AddAClient(driver); loginPage.NavigateTo(); Utils.TimeOut(driver); loginPage.Login(Utils.partnerUserName, Utils.genericPassword); Assert.IsTrue(driver.FindElement(By.LinkText("Log Off")).Text.Equals("Log Off")); mainTab.AddNewClient(); Assert.AreEqual("Create Client", driver.FindElement(By.CssSelector("h2")).Text); Assert.AreEqual("Enter a name for the client:", driver.FindElement(By.CssSelector("th")).Text); Assert.IsTrue(driver.FindElement(By.Id("Name")).Displayed); addClient.ClientName(Utils.qaClient); addClient.Create(); Assert.AreEqual("The client name already exists", driver.FindElement(By.CssSelector("li")).Text); addClient.Cancel(); Assert.AreEqual("Manage Clients", driver.FindElement(By.CssSelector("h2.l")).Text); Assert.AreEqual("Client Name", driver.FindElement(By.CssSelector("th")).Text); Assert.IsTrue(driver.FindElement(By.CssSelector("A.mainbutton.inline-block.r")).Displayed); mainTab.NavigateTo(); mainTab.AddNewClient(); Assert.AreEqual("Create Client", driver.FindElement(By.CssSelector("h2")).Text); Assert.AreEqual("Enter a name for the client:", driver.FindElement(By.CssSelector("th")).Text); Assert.IsTrue(driver.FindElement(By.Id("Name")).Displayed); addClient.ClientName(Utils.GenerateUsername()); addClient.Create(); }
public void EntryMCVerifyAddNew() { Utils.TimeOut(driver); AdminLoginPage loginPage = new AdminLoginPage(driver); ManageClientsPage manageClients = new ManageClientsPage(driver); ChangeClientName changeName = new ChangeClientName(driver); DisableEnableClient disableEnableClient = new DisableEnableClient(driver); AddClientNote addClientNote = new AddClientNote(driver); AddAClient addClient = new AddAClient(driver); loginPage.NavigateTo(); loginPage.Login(Utils.partnerUserName, Utils.genericPassword); Assert.IsTrue(driver.FindElement(By.LinkText("Log Off")).Text.Equals("Log Off")); manageClients.NavigateTo(); Assert.IsTrue(driver.FindElement(By.XPath("//div[@id='wrapper']/div/table/tbody/tr/td[2]/div[2]/div[3]/a/strong/em")).Displayed); Assert.IsTrue(driver.FindElement(By.CssSelector("h2.l")).Text.Equals("Manage Clients")); Assert.IsTrue(driver.FindElement(By.CssSelector("th")).Text.Equals("Client Name")); Assert.IsTrue(driver.FindElement(By.XPath("//table[@id='clientList']/thead/tr/th[2]")).Text.Equals("Enabled Users")); Assert.IsTrue(driver.FindElement(By.XPath("//table[@id='clientList']/thead/tr/th[3]")).Text.Equals("Total Users")); Assert.IsTrue(driver.FindElement(By.Id("clientList")).Displayed); Assert.IsTrue(driver.FindElement(By.XPath("//table[@id='clientList']/tbody/tr/td")).Displayed); Assert.IsTrue(driver.FindElement(By.XPath("//table[@id='clientList']/tbody/tr/td[2]")).Displayed); Assert.IsTrue(driver.FindElement(By.XPath("//table[@id='clientList']/tbody/tr/td[3]")).Displayed); Assert.IsTrue(driver.FindElement(By.XPath("//table[@id='clientList']/tbody/tr/td[4]")).Displayed); Assert.IsTrue(driver.FindElement(By.LinkText(Utils.clientWithLongName)).Displayed); driver.FindElement(By.XPath("//table[@id='clientList']/tbody/tr[2]/td[4]")).Text.Equals("Enabled"); Assert.IsTrue(driver.FindElement(By.Id("help")).Displayed); Assert.IsTrue(driver.FindElement(By.CssSelector("A.mainbutton.inline-block.r")).Displayed); addClient.NavigateTo(); addClient.ClientName(Utils.qaClient); addClient.Create(); Assert.AreEqual("The client name already exists", driver.FindElement(By.CssSelector("li")).Text); addClient.Cancel(); Assert.AreEqual("Manage Clients", driver.FindElement(By.CssSelector("h2.l")).Text); Assert.AreEqual("Client Name", driver.FindElement(By.CssSelector("th")).Text); Assert.IsTrue(driver.FindElement(By.CssSelector("A.mainbutton.inline-block.r")).Displayed); addClient.NavigateTo(); addClient.ClientName(Utils.GenerateUsername()); addClient.Create(); }