コード例 #1
0
        public InboxPage LogIn(User user)
        {
            Login.Clear();
            Login.SendKeys(user.email);
            NextButton.Click();
            Password.SendKeys(user.password);
            PasswordNext.Click();

            return(new InboxPage());
        }
コード例 #2
0
        public void ChangeLanguageToUkrainian()
        {
            BaseElement Language = new BaseElement(LanguageUkraineLabel);

            Language.WaitForIsVisible();
            Language.Click();
        }
コード例 #3
0
 public HomePage Login(string login, string password)
 {
     loginForm.SendKeys(login);
     passwordForm.SendKeys(password);
     loginButton.Click();
     return(new HomePage());
 }
コード例 #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();
            }
        }
コード例 #5
0
 /// <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());
 }
コード例 #6
0
 public void Login(string login, string password)
 {
     loginField.Clear();
     loginField.SendKeys(login);
     passwordField.Clear();
     passwordField.SendKeys(password);
     submitBtn.Click();
 }
コード例 #7
0
ファイル: HomePage.cs プロジェクト: AlenaNilava/Hometask-7
 public InboxPage Login(User user)
 {
     loginField.Clear();
     loginField.SendKeys(user.login);
     passwordField.Clear();
     passwordField.SendKeys(user.password);
     submitBtn.Click();
     return(new InboxPage());
 }
コード例 #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());
        }
コード例 #9
0
        public InboxPage InputLogin(string login, string password)
        {
            Login.Clear();
            Login.SendKeys(login);
            NextButton.Click();
            Password.SendKeys(password);
            PasswordNestButton.Click();

            return(new InboxPage());
        }
コード例 #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();
 }
コード例 #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());
        }
コード例 #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));
        }
コード例 #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());
 }
コード例 #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(), 'Нет сохраненных черновиков.')]")));
     }
 }
コード例 #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(), 'Нет отправленных писем. ')]")));
     }
 }
コード例 #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());
        }
コード例 #17
0
 /// <summary>
 /// Opens draft to edit
 /// </summary>
 /// <returns>POM for mail form</returns>
 public NewMailPage OpenDraft()
 {
     _draftLine.Click();
     return((NewMailPage) new NewMailPage().WaitForPageLoaded());
 }
コード例 #18
0
 public void ClickCreate()
 {
     createBtn.Click();
 }
コード例 #19
0
 public void SendEmail()
 {
     sendBtn.Click();
 }
コード例 #20
0
 public RecycleBinPage NavigateToRecycle()
 {
     recycleBinMenuItem.Click();
     return(new RecycleBinPage());
 }
コード例 #21
0
 public WikiMonthEventsPage GoToMonthEventsPage()
 {
     OctoberEventsLink.Click();
     return(new WikiMonthEventsPage());
 }
コード例 #22
0
 /// <summary>
 /// Confirm deleting by clicking OK on dialog modal
 /// </summary>
 /// <returns></returns>
 public HomePage ConfirmDelete()
 {
     _confirmDeleteButton.Click();
     return(new HomePage());
 }
コード例 #23
0
 public SmartPhonesPage GoToSmartPhonesPage()
 {
     SmartPhonesMenu.Click();
     return(new SmartPhonesPage());
 }
コード例 #24
0
 public LanguageDropDown(BaseElement languageDD, Action <string> logger, IBrowser browser, TimeSpan timeout)
 {
     this.logger = logger;
     languageDD.Click();
     elements = GetLanguages(browser, timeout);
 }
コード例 #25
0
 public CurrentEventsPage GoToCurrenEventsPage()
 {
     CurrentEventsLink.Click();
     return(new CurrentEventsPage());
 }
コード例 #26
0
ファイル: InboxPage.cs プロジェクト: AlenaNilava/Hometask-7
 public EmailPage ClickCreateNewMessageButton()
 {
     createBtn.Click();
     return(new EmailPage());
 }
コード例 #27
0
ファイル: CompareCarsPage.cs プロジェクト: gj-arrow/4-task
 public void ClickButtonAddCar()
 {
     _btnAddCar.Click();
 }
コード例 #28
0
 public void CreateNewIssue()
 {
     newIssueButton.Click();
     newIssueSubject.SendKeys(GetRandomString(8));
     newIssueCommitButton.Click();
 }
コード例 #29
0
 /// <summary>
 /// Opens user card
 /// </summary>
 /// <returns></returns>
 public UserCardPage OpenUserCard()
 {
     openUserDataButton.Click();
     return((UserCardPage) new UserCardPage().WaitForPageLoaded());
 }
コード例 #30
0
 public NewMailPage OpenNewMessageForm()
 {
     createMessageButton.Click();
     return((NewMailPage) new NewMailPage().WaitForPageLoaded());
 }