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); }
/// <summary> /// Registration Step 3. /// </summary> /// <param name="ngWebDriver"></param> /// <param name="userDataStep3"></param> public static void RegistrationStep3(NgWebDriver ngWebDriver, DataStep3 userDataStep3, string lng) { PageRregisterStep3 pageRegisterStep3 = new PageRregisterStep3(ngWebDriver, lng); pageRegisterStep3.WaitLoadPage(pageRegisterStep3); if (userDataStep3.CmbAccountType != null) { pageRegisterStep3.CmbAccountType.SetValueAfterClick(userDataStep3.CmbAccountType); } if (userDataStep3.CmbLeverage != null) { pageRegisterStep3.CmbLeverage.SetValueAfterClick(userDataStep3.CmbLeverage); } if (userDataStep3.CmbCurrencyBase != null) { pageRegisterStep3.CmbCurrencyBase.SetValueAfterClick(userDataStep3.CmbCurrencyBase); } if (userDataStep3.BtnVerifyYourProfileYes) { pageRegisterStep3.BtnVerifyYourProfileYes.Click(); } if (userDataStep3.BtnVerifyYourProfileNo) { pageRegisterStep3.BtnVerifyYourProfileNo.Click(); } if (userDataStep3.ChkReceiveCompanyNews) { if (!pageRegisterStep3.ChkReceiveCompanyNews.Selected) { pageRegisterStep3.ChkReceiveCompanyNews.Click(); } } if (userDataStep3.ChkReceiveTechnicalAnalysis) { if (!pageRegisterStep3.ChkReceiveTechnicalAnalysis.Selected) { pageRegisterStep3.ChkReceiveTechnicalAnalysis.Click(); } } if (userDataStep3.CmbLanguage != null) { pageRegisterStep3.CmbLanguage.SetValueAfterClick(userDataStep3.CmbLanguage); } if (userDataStep3.ChkAcceptRisks) { if (!pageRegisterStep3.ChkAcceptRisks.Selected) { pageRegisterStep3.ChkAcceptRisks.Click(); } } if (userDataStep3.ChkClientAgreement) { if (!pageRegisterStep3.ChkClientAgreement.Selected) { pageRegisterStep3.ChkClientAgreement.Click(); } } if (userDataStep3.BtnComplete) { pageRegisterStep3.BtnComplete.Click(); } }