Beispiel #1
0
        public void SubmitForm()
        {
            // Arrange
            HomePage         homePage         = new HomePage(Driver);
            PracticeFormPage practiceFormPage = new PracticeFormPage(Driver);

            homePage.ClickOnFormButton();

            //Act
            practiceFormPage.EnterFirstName("Dan");
            practiceFormPage.EnterLastName("Popa");
            practiceFormPage.EnterEmail("*****@*****.**");
            practiceFormPage.ClickOnMaleRadioButton();
            practiceFormPage.EnderPhoneNumber("0123654879");
            //practiceFormPage.SelectDateOfBirth();
            practiceFormPage.EnterSubject("Math");
            practiceFormPage.SelectHobbies();
            //practiceFormPage.UploadPicture();
            practiceFormPage.EnterAddress("asfdklgnsfdkn sdgertg");
            practiceFormPage.SelectStateFromDropDown("NCR");
            practiceFormPage.SelectCityFromDropDown("Delhi");
            practiceFormPage.SubmitAction();


            //Assert
            Assert.IsTrue(practiceFormPage.VerifyElementIsDisplayed(practiceFormPage.ConfirmationThatFormWasSubmmited));
        }
 public void Setup()
 {
     Initialize();
     Driver.Navigate().GoToUrl("http://demoqa.com/automation-practice-form");
     _practiceFormPage = new PracticeFormPage(Driver);
     _user             = PracticeFormFactory.Create();
 }
Beispiel #3
0
 public void Setup()
 {
     Initialize();
     Driver.Url       = "https://demoqa.com/automation-practice-form";
     practiceFormPage = new PracticeFormPage(Driver);
     _user            = UserFactory.GetValidUser();
 }
Beispiel #4
0
 public void WhenTheUserEntersFiveSubjects()
 {
     PracticeFormPage.InputSubject("Physics");
     PracticeFormPage.InputSubject("English");
     PracticeFormPage.InputSubject("Accounting");
     PracticeFormPage.InputSubject("Chemistry");
     PracticeFormPage.InputSubject("Maths");
 }
Beispiel #5
0
 public PracticeFormSteps(IObjectContainer container, ScenarioContext scenarioContext)
 {
     this.container   = container;
     driver           = container.Resolve <IWebDriver>();
     config           = container.Resolve <IConfiguration>();
     PracticeFormPage = new PracticeFormPage(driver);
     _scenarioContext = scenarioContext;
 }
Beispiel #6
0
 public void ThenAllAppropriateFieldValidationMessagesAreShown()
 {
     PracticeFormPage.WaitForValidation(PracticeFormPage.FirstName);
     Assert.AreEqual("rgb(220, 53, 69)", PracticeFormPage.FirstName.GetCssValue("border-color"));
     Assert.AreEqual("rgb(220, 53, 69)", PracticeFormPage.LastName.GetCssValue("border-color"));
     Assert.AreEqual("rgba(220, 53, 69, 1)", PracticeFormPage.GenderMale.GetCssValue("color"));
     Assert.AreEqual("rgb(220, 53, 69)", PracticeFormPage.MobileNumber.GetCssValue("border-color"));
 }
 public void Setup()
 {
     Initialize();
     Driver.Navigate().GoToUrl("http://automationpractice.com/index.php");
     _practiceFormPage = new PracticeFormPage(Driver);
     _user             = PracticeFormFactory.Create();
     NavigateToForm(Driver);
 }
        public void Case1()
        {
            practiceForm = new PracticeFormPage(driver);
            practiceForm.NavigateToForm();
            practiceForm.FillForm();

            Assert.True(driver.FindElement(By.Id("example-modal-sizes-title-lg")).Displayed);
        }
 public void Setup()
 {
     Initialize();
     Driver.Navigate().
     GoToUrl("http://automationpractice.com/index.php?controller=authentication&back=my-account#account-creation");
     CreateAccount();
     _practiceFormPage = new PracticeFormPage(Driver);
     _user             = PracticeFormFactory.Create();
 }
Beispiel #10
0
 public void WhenTheUserEntersInfoIntoAllMandatoryFields()
 {
     _scenarioContext["Type"] = "Mandatory";
     PracticeFormPage.FirstName.SendKeys(PracticeFormData.FirstName);
     PracticeFormPage.LastName.SendKeys(PracticeFormData.LastName);
     PracticeFormPage.Email.SendKeys(PracticeFormData.Email);
     PracticeFormPage.GenderSelection(PracticeFormData.Gender);
     PracticeFormPage.MobileNumber.SendKeys(PracticeFormData.MobileNumber);
     PracticeFormPage.PictureUpload.SendKeys(PracticeFormData.PictureUpload);
 }
        public void Setup()
        {
            InitializeMaximizedBrowser();

            _homePage         = new HomePage(Driver);
            _demoQAPage       = new DemoQAPage(Driver);
            _practiceFormPage = new PracticeFormPage(Driver);

            Driver.NavigateTo(_homePage.URL);
            _homePage.CategoryCard("Forms").Click();
            _demoQAPage.LeftPanelSubMenu("Practice Form").Click();
            _userRegistration = PracticeFormFactory.CreateValidUser();
        }
        public void Case2()
        {
            practiceForm = new PracticeFormPage(driver);
            driver.Navigate().GoToUrl("https://demoqa.com/");
            practiceForm.NavigateToForm();
            practiceForm.ScrollAndSubmit();

            Assert.True(practiceForm.IsAttributePresent(practiceForm.firstNameField, "required"));
            Assert.True(practiceForm.IsAttributePresent(practiceForm.lastNameField, "required"));
            Assert.True(practiceForm.IsAttributePresent(practiceForm.maleRadioBtn, "required"));
            Assert.True(practiceForm.IsAttributePresent(practiceForm.femaleRadioBtn, "required"));
            Assert.True(practiceForm.IsAttributePresent(practiceForm.otherRadioBtn, "required"));
            Assert.True(practiceForm.IsAttributePresent(practiceForm.mobileNumField, "required"));
        }
Beispiel #13
0
 public void WhenTheUserEntersInfoIntoAllFields()
 {
     _scenarioContext["Type"] = "All";
     PracticeFormPage.FirstName.SendKeys(PracticeFormData.FirstName);
     PracticeFormPage.LastName.SendKeys(PracticeFormData.LastName);
     PracticeFormPage.Email.SendKeys(PracticeFormData.Email);
     PracticeFormPage.GenderSelection(PracticeFormData.Gender);
     PracticeFormPage.MobileNumber.SendKeys(PracticeFormData.MobileNumber);
     PracticeFormPage.DOBSelection(PracticeFormData.DOB);
     PracticeFormPage.InputSubject(PracticeFormData.Subject);
     PracticeFormPage.HobbySelection(PracticeFormData.Hobbies);
     PracticeFormPage.PictureUpload.SendKeys(PracticeFormData.PictureUpload);
     PracticeFormPage.Address.SendKeys(PracticeFormData.Address);
     PracticeFormPage.StateSelection(PracticeFormData.State);
     PracticeFormPage.CitySelection(PracticeFormData.City);
 }
        public void Setup()
        {
            Initialize();
            Driver.Navigate().GoToUrl("http://automationpractice.com/index.php");

            _practiceFormPage = new PracticeFormPage(Driver);

            _practiceFormPage.ButtonSignIn.Click();

            Random randomGenerator = new Random();
            int    randomInt       = randomGenerator.Next(1000);

            _email = "username" + randomInt + "@xxx.com";

            this.WaitForLoad();
            _practiceFormPage.FieldEmailAddress.SendKeys(_email);

            _practiceFormPage.ButtonCreateAccount.Click();

            _user       = PracticeFormFactory.Create();
            _user.Email = _email;
        }
Beispiel #15
0
 public void ThenThePhoneNumberFieldsValidationIsShown()
 {
     PracticeFormPage.WaitForValidation(PracticeFormPage.MobileNumber);
     Assert.AreEqual("rgb(220, 53, 69)", PracticeFormPage.MobileNumber.GetCssValue("border-color"));
 }
Beispiel #16
0
 public void ThentheEmailFieldValidationIsShown()
 {
     PracticeFormPage.WaitForValidation(PracticeFormPage.Email);
     Assert.AreEqual("rgb(220, 53, 69)", PracticeFormPage.Email.GetCssValue("border-color"));
 }
Beispiel #17
0
 public void WhenTheUserClicksTheSubmitButton()
 {
     PracticeFormPage.ClickSubmitBtn();
 }
 public void Setup()
 {
     Initialize();
     Driver.Url        = "https://softuni.bg/";
     _practiceFormPage = new PracticeFormPage(Driver);
 }
Beispiel #19
0
 public void Setup()
 {
     Initialize();
     Driver.Url        = "http://www.google.com";
     _practiceFormPage = new PracticeFormPage(Driver);
 }