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(); }
public HomePage Login(string login, string password) { loginForm.SendKeys(login); passwordForm.SendKeys(password); loginButton.Click(); return(new HomePage()); }
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()); }
public void Login(string login, string password) { loginField.Clear(); loginField.SendKeys(login); passwordField.Clear(); passwordField.SendKeys(password); submitBtn.Click(); }
public InboxPage Login(User user) { loginField.Clear(); loginField.SendKeys(user.login); passwordField.Clear(); passwordField.SendKeys(user.password); submitBtn.Click(); return(new InboxPage()); }
/// <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()); }
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(); }
/// <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()); }
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)); }
/// <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()); }
/// <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(), 'Нет сохраненных черновиков.')]"))); } }
/// <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(), 'Нет отправленных писем. ')]"))); } }
/// <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()); }
/// <summary> /// Opens draft to edit /// </summary> /// <returns>POM for mail form</returns> public NewMailPage OpenDraft() { _draftLine.Click(); return((NewMailPage) new NewMailPage().WaitForPageLoaded()); }
public void ClickCreate() { createBtn.Click(); }
public void SendEmail() { sendBtn.Click(); }
public RecycleBinPage NavigateToRecycle() { recycleBinMenuItem.Click(); return(new RecycleBinPage()); }
public WikiMonthEventsPage GoToMonthEventsPage() { OctoberEventsLink.Click(); return(new WikiMonthEventsPage()); }
/// <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()); }
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()); }
public EmailPage ClickCreateNewMessageButton() { createBtn.Click(); return(new EmailPage()); }
public void ClickButtonAddCar() { _btnAddCar.Click(); }
public void CreateNewIssue() { newIssueButton.Click(); newIssueSubject.SendKeys(GetRandomString(8)); newIssueCommitButton.Click(); }
/// <summary> /// Opens user card /// </summary> /// <returns></returns> public UserCardPage OpenUserCard() { openUserDataButton.Click(); return((UserCardPage) new UserCardPage().WaitForPageLoaded()); }
public NewMailPage OpenNewMessageForm() { createMessageButton.Click(); return((NewMailPage) new NewMailPage().WaitForPageLoaded()); }