public void BackTest() { HomePage.Open(); HomePage.CheckOpened(); HomePage.Back(); ContactFormPage.CheckOpened(); }
public ContactFormSteps(IWebDriver driver, HomePage homePage, ContactFormPage contactFormPage, ErrorPage errorPage, SearchResultsPage searchResultsPage) { this.homePage = homePage; this.contactFormPage = contactFormPage; this.errorPage = errorPage; this.searchResultsPage = searchResultsPage; }
public void RefreshTest() { ContactFormPage.ContactSubmit.Click(); new Check().AreEquals(ContactFormPage.Result.GetText, "Summary: 3"); ContactFormPage.Refresh(); new Check().AreEquals(ContactFormPage.Result.GetText, ""); ContactFormPage.CheckOpened(); }
public void ClearCacheTest() { Cookie cookie = new Cookie("key", "value"); HomePage.WebDriver.Manage().Cookies.AddCookie(cookie); new Check().IsFalse(HomePage.WebDriver.Manage().Cookies.AllCookies.Count == 0); ContactFormPage.ClearCache(); new Check().IsTrue(HomePage.WebDriver.Manage().Cookies.AllCookies.Count == 0); }
public void AddCookieTest() { HomePage.WebDriver.Manage().Cookies.DeleteAllCookies(); new Check().IsTrue(HomePage.WebDriver.Manage().Cookies.AllCookies.Count == 0); Cookie cookie = new Cookie("key", "value"); ContactFormPage.AddCookie(cookie); new Check().AreEquals(HomePage.WebDriver.Manage().Cookies.GetCookieNamed(cookie.Name).Value, cookie.Value); }
public void SetUp() { Logger.Info("Navigating to Contact page."); ContactFormPage.Open(); ContactFormPage.CheckTitle(); ContactFormPage.IsOpened(); Logger.Info("Setup method finished"); Logger.Info("Start test: " + TestContext.CurrentContext.Test.Name); }
public void FillContactFormInvalidFileFormat() { var contactPage = new ContactFormPage(this.driver); User user = AccessExcelData.GetUserTestData("FillContactFormInvalidFileFormat"); contactPage.NavigateTo(); contactPage.FillContactForm(user); contactPage.AssertInvalidFileFormatErrorMessage("Unable to upload the file. Only Jpeg, jpg, doc, docx, pdf, txt, png files supported."); }
public void FillContactFormWithInvalidEmail() { var contactPage = new ContactFormPage(this.driver); User user = AccessExcelData.GetUserTestData("FillContactFormWithInvalidEmail"); contactPage.NavigateTo(); contactPage.FillContactForm(user); contactPage.AssertInvalidEmailErrorMessage("Please enter a valid e-mail address"); }
public void FillContactFormWithOutSubCategorySelected() { var contactPage = new ContactFormPage(this.driver); User user = AccessExcelData.GetUserTestData("FillContactFormWithOutSubCategorySelected"); contactPage.NavigateTo(); contactPage.FillContactForm(user); contactPage.AssertSubCategoryErrorMessage("Please select your sub-category"); }
public void FillContactFormWithOutMessage() { var contactPage = new ContactFormPage(this.driver); User user = AccessExcelData.GetUserTestData("FillContactFormWithOutMessage"); contactPage.NavigateTo(); contactPage.FillContactForm(user); contactPage.AssertMessageErrorMessage("Please enter your message"); }
public void FillContactFormWithOutProductSelected() { var contactPage = new ContactFormPage(this.driver); User user = AccessExcelData.GetUserTestData("FillContactFormWithOutProductSelected"); contactPage.NavigateTo(); contactPage.FillContactForm(user); contactPage.AssertProductErrorMessage("Please select a product type"); }
public void SetUp() { Logger.Info("Navigating to Metals and Colors page."); ContactFormPage.Open(); ContactFormPage.CheckTitle(); ContactFormPage.IsOpened(); ContactFormPage.FillAndSubmitForm(DEFAULT_TEXT, DEFAULT_TEXT + (new Random()).Next(), DEFAULT_TEXT + (new Random()).Next()); Logger.Info("Setup method finished"); Logger.Info("Start test: " + TestContext.CurrentContext.Test.Name); }
public void SuccessfullRegistration() { var contactPage = new ContactFormPage(this.driver); User user = AccessExcelData.GetUserTestData("Successfull registration"); contactPage.NavigateTo(); contactPage.FillContactForm(user); contactPage.SendButton.Click(); contactPage.AssertSuccessMessage("Thank you"); }
public void EnterToContactFormByUrl_PutRandomDataToContactForm_CheckConfirmationMessageAfterFilledContactForm() { driver.Navigate().GoToUrl("https://shopforautomation.wordpress.com/contact"); var contactFormPage = new ContactFormPage(driver); contactFormPage.Name.SendKeys(RandDataHelper.RandomStringByLength(10)); contactFormPage.Email.SendKeys(RandDataHelper.RandMail()); contactFormPage.CommentValue.SendKeys(RandDataHelper.RandomStringByLength(50)); contactFormPage.SubmitButton.Click(); var expectedMessage = "MESSAGE SENT (GO BACK)"; Assert.AreEqual(contactFormPage.ConfirmationMessage.Text, expectedMessage, $"It's looks like that your test has a bug. Test should has value {contactFormPage.ConfirmationMessage.Text} but has {expectedMessage}"); }
public void Contact_FillAllOfFields_CheckInformationAfterSubmitFormWithPageObject() { var driver = new ChromeDriver().AddReportPortal(); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://testpagefor.home.blog/contact/"); var contactFormPage = new ContactFormPage(driver); contactFormPage.ContactByContactForm("name", "*****@*****.**", "comment"); driver.WaitForClickable(contactFormPage.HeadingThree); var textAfterSubmit = driver.FindElement(contactFormPage.HeadingThree).Text; Assert.AreEqual(textAfterSubmit, "Message Sent (go back)"); driver.Close(); }
public void Foo() { var driver = new ChromeDriver().AddReportPortal(); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://testpagefor.home.blog/contact/"); var contactFormPage = new ContactFormPage(driver); contactFormPage.ContactByContactForm("name", "*****@*****.**", "comment"); driver.WaitForClickable(contactFormPage.HeadingThree); var textAfterSubmit = driver.FindElement(contactFormPage.HeadingThree).Text; Assert.AreEqual(textAfterSubmit, "Message Sent (go back)"); var actions = new Actions(driver); actions.Click(driver.FindElement(By.CssSelector("#contact-form-2 h3 a"))).Perform(); driver.Close(); }
public void ClickTest() { ContactFormPage.Open(); _logoImage.Click(); HomePage.IsOpened(); }
public void CheckOpenedTest() { ContactFormPage.CheckOpened(); }