コード例 #1
0
ファイル: RegistrationsLinks.cs プロジェクト: 232629/test
        public void RegistrationsLinks(string lng)
        {
            #region Test Data
            var randomPart = RegistrationHelper.GetRandomNumberPhone(new Random(), 6);

            DataStep0 dataStep0 = new DataStep0();
            dataStep0.TxtEmail = randomPart + "@testing.test";
            Log.Info("Email new user = "******"******";
            Log.Info("Password new user = "******"TestNameUAE";
            dataStep0.TxtLastName  = "TestLastNameUAE";
            dataStep0.CmbCountry   = "United Arab Emirates";
            dataStep0.BtnNexStep   = true;
            #endregion

            //Before fill step 0

            //login
            PageLogin pageLogin = new PageLogin(ngWebDriver, lng);
            pageLogin.GoToPage(pageLogin.ExpectedUrl);
            pageLogin.WaitLoadPage(pageLogin);

            //register step 0
            PageRegister pageRegister = new PageRegister(ngWebDriver, lng);
            pageRegister.GoToPage(pageRegister.ExpectedUrl);
            pageRegister.WaitLoadPage(pageRegister);

            //register step 1
            PageRregisterStep1 pageRregisterStep1 = new PageRregisterStep1(ngWebDriver, lng);
            pageRregisterStep1.GoToPage(pageRregisterStep1.ExpectedUrl);
            pageRregisterStep1.WaitLoadPage(pageRegister, 1000);

            //register step 2
            PageRregisterStep2 pageRregisterStep2 = new PageRregisterStep2(ngWebDriver, lng);
            pageRregisterStep2.GoToPage(pageRregisterStep2.ExpectedUrl);
            pageRregisterStep2.WaitLoadPage(pageRegister, 1000);

            //register step 3
            PageRregisterStep3 pageRregisterStep3 = new PageRregisterStep3(ngWebDriver, lng);
            pageRregisterStep3.GoToPage(pageRregisterStep3.ExpectedUrl);
            pageRregisterStep3.WaitLoadPage(pageRegister, 1000);

            //redirect /register/thankyou to pageLogin
            PageThankYou pageThankYou = new PageThankYou(ngWebDriver, lng);
            pageThankYou.GoToPage(pageThankYou.ExpectedUrl);
            pageThankYou.WaitLoadPage(pageRegister, 1000);


            //After fill step 0 (page pageRegister not available)
            //login
            pageLogin.GoToPage(pageLogin.ExpectedUrl);
            pageLogin.WaitLoadPage(pageLogin);
            pageLogin.LnkCreateAnAccount.Click();
            pageRegister.WaitLoadPage(pageRegister);

            //Registration Step 0
            RegistrationHelper.RegistrationStep0(ngWebDriver, dataStep0, lng);
            pageRregisterStep1.WaitLoadPage(pageRregisterStep1);

            //register step 0
            pageRegister.GoToPage(pageRegister.ExpectedUrl);
            pageRegister.WaitLoadPage(pageRregisterStep1, 1000);

            //register step 1
            pageRregisterStep1.GoToPage(pageRregisterStep1.ExpectedUrl);
            pageRregisterStep1.WaitLoadPage(pageRregisterStep1);

            //register step 2
            pageRregisterStep2.GoToPage(pageRregisterStep2.ExpectedUrl);
            pageRregisterStep2.WaitLoadPage(pageRregisterStep1, 1000);

            //register step 3
            pageRregisterStep3.GoToPage(pageRregisterStep3.ExpectedUrl);
            pageRregisterStep3.WaitLoadPage(pageRregisterStep1, 1000);

            //redirect /register/thankyou to register/step1
            pageThankYou.WaitLoadPage(pageRregisterStep1);
        }
コード例 #2
0
        /// <summary>
        /// Registration Step 1.
        /// </summary>
        /// <param name="ngWebDriver"></param>
        /// <param name="userDataStep1"></param>
        public static void RegistrationStep1(NgWebDriver ngWebDriver, DataStep1 userDataStep1, string lng)
        {
            PageRregisterStep1 pageRegisterStep1 = new PageRregisterStep1(ngWebDriver, lng);

            pageRegisterStep1.WaitLoadPage(pageRegisterStep1);

            pageRegisterStep1.TxtAddress.Clear();
            if (userDataStep1.TxtAddress != null)
            {
                pageRegisterStep1.TxtAddress.SendKeys(userDataStep1.TxtAddress);
            }

            //only for UAT
            if (userDataStep1.TxtPostcode != null)
            {
                pageRegisterStep1.TxtPostcode.Clear();
                pageRegisterStep1.TxtPostcode.SendKeys(userDataStep1.TxtPostcode);
            }

            pageRegisterStep1.TxtCity.Clear();
            if (userDataStep1.TxtCity != null)
            {
                pageRegisterStep1.TxtCity.SendKeys(userDataStep1.TxtCity);
            }

            if (userDataStep1.CmbEmirate != null)
            {
                pageRegisterStep1.CmbEmirate.SetValueAfterClick(userDataStep1.CmbEmirate);
            }

            if (userDataStep1.TxtBirthdate != null)
            {
                if (pageRegisterStep1.UsedBrowser == "Chrome")
                {
                    pageRegisterStep1.TxtBirthdate.Clear();//need for Chrome
                }
                pageRegisterStep1.TxtBirthdate.SendKeys(userDataStep1.TxtBirthdate);
            }

            pageRegisterStep1.TxtPhone.Clear();
            if (userDataStep1.TxtPhone != null)
            {
                pageRegisterStep1.TxtPhone.SendKeys(userDataStep1.TxtPhone);
            }

            if (userDataStep1.TxtQq != null)
            {
                pageRegisterStep1.TxtQq.Clear();
                pageRegisterStep1.TxtQq.SendKeys(userDataStep1.TxtQq);
            }

            if (userDataStep1.CmbNationality != null)
            {
                pageRegisterStep1.CmbNationality.SetValueAfterClick(userDataStep1.CmbNationality);
            }

            if (userDataStep1.BtnNexStep)
            {
                pageRegisterStep1.BtnNexStep.Click();
            }
        }