public void Test001_UserSendsMessage() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'The authorized User can send the message :'"); var loginPage = new LoginPage(_driver); loginPage.LoginUsingDirectUrl(_baseUrl, _userNameNumberThree, _password); var userAccountPage = new UserAccountPage(_driver); userAccountPage.OpenMessagesLink(_baseUrl); var module = new MessageCenterModule(_driver); module.ComposeNewMessage(_userDisplayNameNumberOne, _subject, "Test Message"); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT New message is present in the inbox:"); Assert.That(module.WaitForElement(By.XPath("//ul[@id = 'inbox']//li[@class = 'ListCol-3']//a")).Text, Is.EqualTo(_subject), "Message subject is not found"); loginPage.LoginUsingDirectUrl(_baseUrl, _userNameNumberOne, _password); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Message icon contains number '1' for incoming message :"); Assert.That(loginPage.WaitForElement(By.XPath(ControlPanelIDs.MessageLink + "/span")).Text, Is.EqualTo("1")); module.OpenMessagesUsingIcon(); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT New message is present in the list:"); Assert.That(module.WaitForElement(By.XPath("//ul[@id = 'inbox']//li[@class = 'ListCol-3']//a")).Text, Is.EqualTo(_subject), "Message subject is not found"); }
public void Test003_SendNotification() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Send Notification'"); var mainPage = new MainPage(_driver); mainPage.OpenUsingUrl(_baseUrl); var loginPage = new LoginPage(_driver); loginPage.RegisterUser("RegisteredUserName", "RegisteredUserDisplayName", "*****@*****.**", _password); loginPage.LoginAsHost(_baseUrl); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Notification icon contains number '1' for incoming notification :"); Assert.That(loginPage.WaitForElement(By.XPath(ControlPanelIDs.NotificationLink + "/span")).Text, Is.EqualTo("1")); var module = new MessageCenterModule(_driver); module.OpenNotificationsUsingIcon(); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT New notification is present in the list:"); Assert.That(module.WaitForElement(By.XPath("//ul[@class = 'messages']//li[@class = 'ListCol-3']//span")).Text, Is.StringContaining("New User Registration"), "Notification subject is not found"); }