Exemple #1
0
        static void Main(string[] args)
        {
            User          user   = new User();
            IWebDriver    driver = new FirefoxDriver();
            WebDriverWait wait   = new WebDriverWait(driver, TimeSpan.FromSeconds(11));

            RegistrationPageLocators registrationPageLocators = new RegistrationPageLocators();
            RegistrationPage         registrationPage         = new RegistrationPage(driver);

            registrationPage.GoToRegistrationPage(driver);
            HomePage homePage = registrationPage.RegistrationUserSuccesful(user, wait, registrationPageLocators);

            HomePageLocators homePageLocators = new HomePageLocators();
            MessagesPage     messagesPage     = homePage.GoToMessagesPage(driver, homePageLocators, wait);

            MessagesPageLocators messagesPageLocators = new MessagesPageLocators();
            LastDialogPage       lastDialogPage       = messagesPage.GoToLastDialog(driver, messagesPageLocators, wait);

            LastDialogLocators lastDialogLocators = new LastDialogLocators();

            Console.WriteLine("Last mesage : " + lastDialogPage.GetTextOfLastMessage(driver, lastDialogLocators, wait));

            driver.Quit();
        }
Exemple #2
0
 /// <summary>
 /// Get text of last message.
 /// </summary>
 /// <param name="driver"></param>
 /// <param name="lastDialogLocators"></param>
 /// <param name="wait"></param>
 /// <returns>Text of last message.</returns>
 public string GetTextOfLastMessage(IWebDriver driver, LastDialogLocators lastDialogLocators, WebDriverWait wait)
 {
     return(wait.Until(ExpectedConditions.ElementIsVisible(lastDialogLocators.lastMassageLocator)).Text);
 }