예제 #1
0
 public Body(Formdata formdata)
 {
     BodyType = "formdata";
     Key      = formdata.Key;
     Value    = formdata.Value;
     Type     = formdata.Type;
 }
        public void WhenICompleteTheFormJonPoddrick(string fisrtname, string lastname, Table table)
        {
            logs.AssignCategory("AddGoogleAccount-UI-Spec-Test");
            logs.AssignAuthor(ConfigurationManager.AppSettings["Author"].ToString());

            foreach (var row in table.Rows)
            {
                Formdata data = new Formdata()
                {
                    FirstName     = fisrtname,
                    LastName      = lastname,
                    UserName      = row["UserName"],
                    NewPwd        = row["NewPwd"],
                    ConfirmPwd    = row["ConfirmPwd"],
                    Dob           = row["Dob"],
                    Gender        = row["Gender"],
                    Country       = row["Country"],
                    Number        = row["Number"],
                    RecoveryEmail = row["RecoveryEmail"],
                    Location      = row["Location"]
                };

                DemofwkPagefactory.landingPage.createAcc();
                logs.Log(LogStatus.Pass, "Create Account Clicked successfully.");
                exRepo.EndTest(logs);

                DemofwkPagefactory.googleAccountPage.fillDetails(data);
                logs.Log(LogStatus.Pass, "Data filled successfully.");
                exRepo.EndTest(logs);

                DemofwkPagefactory.verifyaccPage.contButton();
                logs.Log(LogStatus.Pass, "Clicked Continue successfully.");
                exRepo.EndTest(logs);
            }
        }
예제 #3
0
        public void fillDetails(Formdata data)
        {
            string uname;

            FirstName.SendKeys(data.FirstName);
            LastName.SendKeys(data.LastName);
            UserName.SendKeys(data.UserName);

            UserName.SendKeys(Keys.Tab);

            while (Initialiser.WaitforElementDisplayed(UsernameTaken) == true)
            {
                Random rnd = new Random();
                UserName.Clear();
                uname = RandomString.GenerateRandomString(7, rnd);
                UserName.SendKeys(data.UserName + uname);
                UserName.SendKeys(Keys.Tab);
            }

            CreatePwd.SendKeys(data.NewPwd);
            ConfirmPwd.SendKeys(data.ConfirmPwd);


            BirthMonthParentSelector.Click();
            string[] birthdetails = data.Dob.Split('-');
            BirthMonthParentSelector.FindElement(By.XPath("//div[@class='goog-menu goog-menu-vertical']//div[contains(text(),'" + birthdetails[0] + "')]")).Click();

            Day.SendKeys(birthdetails[1]);
            Year.SendKeys(birthdetails[2]);

            GenderParentSelector.Click();
            Genderselect.FindElement(By.XPath("//div[contains(text(),'" + data.Gender + "')]")).Click();

            Number.SendKeys(data.Number);
            Recoveryemail.SendKeys(data.RecoveryEmail);
            NextButton.Click();

            //Initialiser.ScrollElementIntoView(scroll);

            while (!Initialiser.WaitForElementEnabled(IagreeButton))
            {
                scroll.SendKeys(Keys.Down);
            }
            IagreeButton.Click();
        }
예제 #4
0
        public void WhenICompleteTheFormJonPoddrick(string fisrtname, string lastname, Table table)
        {
            foreach (var row in table.Rows)
            {
                Formdata data = new Formdata()
                {
                    FirstName     = fisrtname,
                    LastName      = lastname,
                    UserName      = row["UserName"],
                    NewPwd        = row["NewPwd"],
                    ConfirmPwd    = row["ConfirmPwd"],
                    Dob           = row["Dob"],
                    Gender        = row["Gender"],
                    Country       = row["Country"],
                    Number        = row["Number"],
                    RecoveryEmail = row["RecoveryEmail"],
                    Location      = row["Location"]
                };

                DemofwkPagefactory.landingPage.createAcc();
                DemofwkPagefactory.googleAccountPage.fillDetails(data);
                DemofwkPagefactory.verifyaccPage.contButton();
            }
        }