コード例 #1
0
 /// <summary>
 /// Register user.
 /// </summary>
 /// <param name="user"></param>
 public void RegisterUser(User user, WebDriverWait wait, RegistrationPageLocators locators)
 {
     wait.Until(ExpectedConditions.ElementToBeClickable(locators.emailLocator)).SendKeys(user.Email);
     wait.Until(ExpectedConditions.ElementToBeClickable(locators.passwordLocator)).SendKeys(user.Password);
     wait.Until(ExpectedConditions.ElementToBeClickable(locators.loginButtonLocator)).Click();
     wait.Until(ExpectedConditions.ElementToBeClickable(locators.myProfileLocator)).Click();
 }
コード例 #2
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();
        }
コード例 #3
0
 /// <summary>
 /// Seccesfull registration.
 /// </summary>
 /// <param name="user"></param>
 /// <param name="wait"></param>
 /// <param name="locators"></param>
 /// <returns>Homepage.</returns>
 public HomePage RegistrationUserSuccesful(User user, WebDriverWait wait, RegistrationPageLocators registrationPageLocators)
 {
     RegisterUser(user, wait, registrationPageLocators);
     return(new HomePage(driver));
 }