public InboxPage LogIn(User user)
        {
            Login.Clear();
            Login.SendKeys(user.email);
            NextButton.Click();
            Password.SendKeys(user.password);
            PasswordNext.Click();

            return(new InboxPage());
        }
        public void ChangeLanguageToUkrainian()
        {
            BaseElement Language = new BaseElement(LanguageUkraineLabel);

            Language.WaitForIsVisible();
            Language.Click();
        }
Esempio n. 3
0
 public HomePage Login(string login, string password)
 {
     loginForm.SendKeys(login);
     passwordForm.SendKeys(password);
     loginButton.Click();
     return(new HomePage());
 }
Esempio n. 4
0
        private void ChangeLanguage()
        {
            BaseElement     element = settings.Browser.Window.FindElement <Contaner>(By.XPath(LanguageButton));
            Action <string> logger  = (string msg) => Log(LogType.Info, msg, null, null);
            var             data    = new LanguageDropDown(element, logger, settings.Browser, pageSettings.Timeout);

            if (data.Items.Any(x => x.Name == LocalisationKeeper.LanguageNames[GenericParams.Language][pageSettings.Language]))
            {
                foreach (var item in data.Items)
                {
                    if (item.Name == LocalisationKeeper.LanguageNames[GenericParams.Language][pageSettings.Language])
                    {
                        item.Click();
                        BrowserWait.Wait(pageSettings.Timeout, (IBrowser b) =>
                        {
                            return(b.Window.Title == LocalisationKeeper.Get(Test_1.Title, pageSettings.Language));
                        });
                        break;
                    }
                }
            }
            else
            {
                element.Click();
            }
        }
 /// <summary>
 /// Fills form fields with data
 /// </summary>
 /// <param name="to">Send to parameter</param>
 /// <param name="topic"></param>
 /// <param name="message"></param>
 /// <returns></returns>
 public HomePage CreateDraft(string to, string topic, string message)
 {
     ToField.SendKeys(to);
     TopicField.SendKeys(topic);
     MessageArea.SendKeys(message);
     CloseButton.Click();
     return(new HomePage());
 }
Esempio n. 6
0
 public void Login(string login, string password)
 {
     loginField.Clear();
     loginField.SendKeys(login);
     passwordField.Clear();
     passwordField.SendKeys(password);
     submitBtn.Click();
 }
Esempio n. 7
0
 public InboxPage Login(User user)
 {
     loginField.Clear();
     loginField.SendKeys(user.login);
     passwordField.Clear();
     passwordField.SendKeys(user.password);
     submitBtn.Click();
     return(new InboxPage());
 }
Esempio n. 8
0
        /// <summary>
        /// Login with creds
        /// </summary>
        /// <param name="email">user email</param>
        /// <param name="password">user password</param>
        /// <returns>Home page model</returns>
        public HomePage Login(string email, string password)
        {
            emailInput.SendKeys(email);
            emailNextButton.Click();
            passwordInput.WaitForElementIsVisible();
            passwordInput.SendKeys(password);
            passwordNextButton.Click();

            return((HomePage) new HomePage().WaitForPageLoaded());
        }
        public InboxPage InputLogin(string login, string password)
        {
            Login.Clear();
            Login.SendKeys(login);
            NextButton.Click();
            Password.SendKeys(password);
            PasswordNestButton.Click();

            return(new InboxPage());
        }
Esempio n. 10
0
 public void CreateDraftEmail(string address, string subject, string expectedTestBody)
 {
     addresseeField.SendKeys(address);
     subjectField.SendKeys(subject);
     Browser.GetDriver().SwitchTo().Frame(this.bodyTextFrame.GetElement());
     bodyTextField.SendKeys(expectedTestBody);
     Browser.GetDriver().SwitchTo().DefaultContent();
     saveBtn.Click();
     draftEmailSavedLbl.WaitForIsVisible();
 }
Esempio n. 11
0
        /// <summary>
        /// Deletes all mails to thrash folder
        /// </summary>
        /// <returns></returns>
        public HomePage DeleteAll()
        {
            if (GetMailsList().Count > 0)
            {
                _checkAllSent.Click();
                _deleteSentButton.Click();
                ((ConfirmDeleteModal) new ConfirmDeleteModal().WaitForPageLoaded()).ConfirmDelete();
            }

            return(new HomePage());
        }
Esempio n. 12
0
        public static BasePage NavigatePageTo(BaseElement pointMenuToHover, BaseElement pointMenuToClick, SitePages.Pages page)
        {
            WDriver.HoverOnElement(pointMenuToHover);

            var elementToClick = pointMenuToClick.FindElement(pointMenuToClick.Locator);

            WDriver.SetBackgroundColorForElement(elementToClick);
            pointMenuToClick.Click();

            return(SitePages.GetPage(page));
        }
Esempio n. 13
0
 /// <summary>
 /// Deletes all mails from trash folder
 /// </summary>
 /// <returns></returns>
 public HomePage DeleteAll()
 {
     if (GetTrashMailsList().Count > 0)
     {
         _checkAllTrash.Click();
         _deleteTrashButton.Click();
         Thread.Sleep(100);
         //new ElementWithLogger(new Element(By.XPath("//td[text()='Нет цепочек в корзине.']"), "Clear page indicator")).WaitForElementIsVisible();
     }
     return(new HomePage());
 }
Esempio n. 14
0
 /// <summary>
 /// Opens drafts tab
 /// </summary>
 /// <returns></returns>
 public DraftsPage OpenDrafts()
 {
     openDraftsButton.Click();
     try
     {
         return((DraftsPage) new DraftsPage().WaitForPageLoaded(By.XPath("(//font[text()='Черновик'])[2]")));
     }
     catch (Exception e)
     {
         return((DraftsPage) new DraftsPage().WaitForPageLoaded(By.XPath("//td[contains(text(), 'Нет сохраненных черновиков.')]")));
     }
 }
Esempio n. 15
0
 /// <summary>
 /// Opens sent tab
 /// </summary>
 /// <returns></returns>
 public SentPage OpenSent()
 {
     openSentButton.Click();
     try
     {
         return((SentPage) new SentPage().WaitForPageLoaded(By.XPath("//td/div[contains(text(), 'Кому: ')][2]")));
     }
     catch (Exception e)
     {
         return((SentPage) new SentPage().WaitForPageLoaded(By.XPath("//td[contains(text(), 'Нет отправленных писем. ')]")));
     }
 }
Esempio n. 16
0
        /// <summary>
        /// Confirms sending email
        /// </summary>
        /// <returns></returns>
        public HomePage SendMail()
        {
            new WebDriverWait(Browser.Browser.GetDriver(), TimeSpan.FromSeconds(Browser.Browser.TimeoutForElement))
            .Until(
                condition =>
            {
                try
                {
                    return(new ElementWithLogger(new Element(By.CssSelector("div.oL.aDm.az9 span"), "send mail")).GetText() != "");
                }
                catch (StaleElementReferenceException)
                {
                    return(false);
                }
                catch (NoSuchElementException)
                {
                    return(false);
                }
            });

            SubmitButton.Click();
            return(new HomePage());
        }
Esempio n. 17
0
 /// <summary>
 /// Opens draft to edit
 /// </summary>
 /// <returns>POM for mail form</returns>
 public NewMailPage OpenDraft()
 {
     _draftLine.Click();
     return((NewMailPage) new NewMailPage().WaitForPageLoaded());
 }
Esempio n. 18
0
 public void ClickCreate()
 {
     createBtn.Click();
 }
Esempio n. 19
0
 public void SendEmail()
 {
     sendBtn.Click();
 }
Esempio n. 20
0
 public RecycleBinPage NavigateToRecycle()
 {
     recycleBinMenuItem.Click();
     return(new RecycleBinPage());
 }
Esempio n. 21
0
 public WikiMonthEventsPage GoToMonthEventsPage()
 {
     OctoberEventsLink.Click();
     return(new WikiMonthEventsPage());
 }
Esempio n. 22
0
 /// <summary>
 /// Confirm deleting by clicking OK on dialog modal
 /// </summary>
 /// <returns></returns>
 public HomePage ConfirmDelete()
 {
     _confirmDeleteButton.Click();
     return(new HomePage());
 }
 public SmartPhonesPage GoToSmartPhonesPage()
 {
     SmartPhonesMenu.Click();
     return(new SmartPhonesPage());
 }
Esempio n. 24
0
 public LanguageDropDown(BaseElement languageDD, Action <string> logger, IBrowser browser, TimeSpan timeout)
 {
     this.logger = logger;
     languageDD.Click();
     elements = GetLanguages(browser, timeout);
 }
 public CurrentEventsPage GoToCurrenEventsPage()
 {
     CurrentEventsLink.Click();
     return(new CurrentEventsPage());
 }
Esempio n. 26
0
 public EmailPage ClickCreateNewMessageButton()
 {
     createBtn.Click();
     return(new EmailPage());
 }
Esempio n. 27
0
 public void ClickButtonAddCar()
 {
     _btnAddCar.Click();
 }
Esempio n. 28
0
 public void CreateNewIssue()
 {
     newIssueButton.Click();
     newIssueSubject.SendKeys(GetRandomString(8));
     newIssueCommitButton.Click();
 }
Esempio n. 29
0
 /// <summary>
 /// Opens user card
 /// </summary>
 /// <returns></returns>
 public UserCardPage OpenUserCard()
 {
     openUserDataButton.Click();
     return((UserCardPage) new UserCardPage().WaitForPageLoaded());
 }
Esempio n. 30
0
 public NewMailPage OpenNewMessageForm()
 {
     createMessageButton.Click();
     return((NewMailPage) new NewMailPage().WaitForPageLoaded());
 }