Пример #1
0
 public void BackTest()
 {
     HomePage.Open();
     HomePage.CheckOpened();
     HomePage.Back();
     ContactFormPage.CheckOpened();
 }
Пример #2
0
 public ContactFormSteps(IWebDriver driver, HomePage homePage, ContactFormPage contactFormPage,
                         ErrorPage errorPage, SearchResultsPage searchResultsPage)
 {
     this.homePage          = homePage;
     this.contactFormPage   = contactFormPage;
     this.errorPage         = errorPage;
     this.searchResultsPage = searchResultsPage;
 }
Пример #3
0
 public void RefreshTest()
 {
     ContactFormPage.ContactSubmit.Click();
     new Check().AreEquals(ContactFormPage.Result.GetText, "Summary: 3");
     ContactFormPage.Refresh();
     new Check().AreEquals(ContactFormPage.Result.GetText, "");
     ContactFormPage.CheckOpened();
 }
Пример #4
0
        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);
        }
Пример #5
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);
        }
Пример #6
0
 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);
 }
Пример #7
0
        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.");
        }
Пример #8
0
        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");
        }
Пример #9
0
        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");
        }
Пример #10
0
        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");
        }
Пример #11
0
        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");
        }
Пример #12
0
 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);
 }
Пример #13
0
        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");
        }
Пример #14
0
        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();
        }
Пример #17
0
 public void ClickTest()
 {
     ContactFormPage.Open();
     _logoImage.Click();
     HomePage.IsOpened();
 }
Пример #18
0
 public void CheckOpenedTest()
 {
     ContactFormPage.CheckOpened();
 }