public void CreateRealAccount(string accountType, string lng) { #region Test Data List <string> CurrencyList = new List <string>(); switch (accountType) { case "MT4": CurrencyList.Add("EUR"); CurrencyList.Add("GBP"); CurrencyList.Add("USD"); break; case "MT5": CurrencyList.Add("EUR"); CurrencyList.Add("GBP"); CurrencyList.Add("USD"); break; case "cTrader": CurrencyList.Add("EUR"); CurrencyList.Add("GBP"); CurrencyList.Add("USD"); break; default: break; } #endregion LoginHelper.Login(ngWebDriver, lng); PageTradingAccountsReal pageTradingAccountsReal = new PageTradingAccountsReal(ngWebDriver, lng); pageTradingAccountsReal.WaitLoadPage(pageTradingAccountsReal); PageCreateRealAccount pageCreateRealAccount = new PageCreateRealAccount(ngWebDriver, lng); for (int i = 0; i < CurrencyList.Count; i++) { pageTradingAccountsReal.LnkCreateNewAccount.Click(); pageCreateRealAccount.WaitLoadPage(pageCreateRealAccount); pageCreateRealAccount.CmbSelectAccountType.SetValueAfterClick(accountType); pageCreateRealAccount.CmbSelectLeverage.SetValueAfterClick(0); //checking currencies' list pageCreateRealAccount.CmbSelectCurrencyBase.GetValuesList().Should().BeEquivalentTo(CurrencyList); pageCreateRealAccount.CmbSelectCurrencyBase.SetValueAfterClick(i); pageCreateRealAccount.BtnCreate.Click(); pageCreateRealAccount.WaitLoadPage(pageTradingAccountsReal); Thread.Sleep(3000); } }
public void Partner_UAE_No_No_No(string lng) { #region Test Data var goodPartner1Name = "good_partner1"; var goodPartner1Id = "0808331"; var goodPartner2Name = "good_partner2"; var goodPartner2Id = "0808332"; var goodPartner3MenaName = "good_partner3"; var goodPartner3MenaId = "0808333"; var goodPartner3GmName = "good_partner3"; var goodPartner3GmId = "0808334"; var randomPart = RegistrationHelper.GetRandom(8); 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; DataStep1 dataStep1 = new DataStep1(); dataStep1.TxtAddress = "Al Safa Street 1"; dataStep1.TxtCity = "Dubai"; dataStep1.CmbEmirate = "Dubai"; dataStep1.TxtBirthdate = "01/01/1990"; dataStep1.TxtPhone = "971500000000"; dataStep1.CmbNationality = "United Arab Emirates"; dataStep1.BtnNexStep = true; DataStep2 dataStep2 = new DataStep2(); //Employment Information dataStep2.CmbEmployment = "Employed"; dataStep2.CmbEmploymentType = "Financial Services"; dataStep2.CmbLevelOfEducation = "High School"; //Financial Information dataStep2.CmbAnnualIncome = "> $1,000,000"; dataStep2.CmbEstimatedNetWorth = "$1,000,000 - $5,000,000"; dataStep2.CmbSourceOfIncome = "Savings / Investments"; dataStep2.CmbDeposit = "> $1,000,000"; dataStep2.ChkToTradeCFDs = true; dataStep2.UsCitizen = new DataStep2.DataUsCitizen(btnUScitizen: false); //Trading Experience dataStep2.CmbTradingExperience = "No"; dataStep2.ChkHaveRelevantEducational = true; dataStep2.ChkIRegularlyMonitorNews = true; dataStep2.ChkIHaveReadMaterialOnTrading = true; dataStep2.CmbQuestion1 = "500 EUR"; dataStep2.CmbQuestion2 = "A take profit order"; dataStep2.CmbQuestion3 = "1:50"; dataStep2.ChkProfessionalClientYes = true; dataStep2.CmbLeveragedProductExperience = "Other (please specify)"; dataStep2.TxtLeveragedProductExperienceOther = "I am good"; dataStep2.BtnNexStep = true; DataStep3 dataStep3 = new DataStep3(); dataStep3.CmbAccountType = "MT4"; dataStep3.CmbCurrencyBase = "EUR"; dataStep3.BtnVerifyYourProfileNo = true; dataStep3.ChkReceiveCompanyNews = true; dataStep3.ChkReceiveTechnicalAnalysis = true; dataStep3.ChkAcceptRisks = true; dataStep3.CmbLanguage = "English"; dataStep3.ChkClientAgreement = true; dataStep3.BtnComplete = true; #endregion //Login page PageLogin pageLogin = new PageLogin(webDriver, lng); pageLogin.LnkRegister.Click(); //Registration Step 0 RegistrationHelper.RegistrationStep0(webDriver, dataStep0, lng); //Registration Step 1 RegistrationHelper.RegistrationStep1(webDriver, dataStep1, lng); //Registration Step 2 RegistrationHelper.RegistrationStep2(webDriver, dataStep2, lng); //Registration Step 3 RegistrationHelper.RegistrationStep3(webDriver, dataStep3, lng); PageTradingAccountsReal pageTradingAccountsReal = new PageTradingAccountsReal(webDriver, lng); Wait.ElementIsVisible(webDriver, pageTradingAccountsReal.LnkCreateNewAccount); //null //without partner; Jurisdiction = mena; Country = UAT; default; default pageTradingAccountsReal.LnkCreateNewAccount.Click(); PageCreateRealAccount pageCreateRealAccount = new PageCreateRealAccount(webDriver, lng); //NO pageCreateRealAccount.CmbSelectAccountType.GetValuesList().Should().BeEquivalentTo(new[] { "cTrader", "MT4", "MT5" }); pageCreateRealAccount.CmbSelectAccountType.SetValueAfterClick(0); pageCreateRealAccount.CmbSelectCurrencyBase.GetValuesList().Should().BeEquivalentTo(new[] { "EUR", "GBP", "USD" }); //0808331 //good_partner1; Jurisdiction = mena; Country = all; mt4m, xtrader; EUR, USD pageTradingAccountsReal.GoToPage(pageTradingAccountsReal.BaseUrl + "/partner/" + goodPartner1Id); pageTradingAccountsReal.LnkCreateNewAccount.Click(); //YES //Assert.AreEqual(goodPartner1Name, pageCreateRealAccount.CmbSelectPartnership.GetValue()); Assert.AreEqual(goodPartner1Id, pageCreateRealAccount.CmbSelectPartnership.GetValue()); pageCreateRealAccount.CmbSelectAccountType.GetValuesList().Should().BeEquivalentTo(new[] { "MT4", "cTrader" }); pageCreateRealAccount.CmbSelectAccountType.SetValueAfterClick(0); pageCreateRealAccount.CmbSelectCurrencyBase.GetValuesList().Should().BeEquivalentTo(new[] { "EUR", "USD" }); Thread.Sleep(3000); //0808332 //good_partner2; Jurisdiction = gm; Country = other; default; default pageTradingAccountsReal.GoToPage(pageTradingAccountsReal.BaseUrl + "/partner/" + goodPartner2Id); pageTradingAccountsReal.LnkCreateNewAccount.Click(); //NO pageCreateRealAccount.CmbSelectAccountType.GetValuesList().Should().BeEquivalentTo(new[] { "cTrader", "MT4", "MT5" }); pageCreateRealAccount.CmbSelectAccountType.SetValueAfterClick(0); pageCreateRealAccount.CmbSelectCurrencyBase.GetValuesList().Should().BeEquivalentTo(new[] { "EUR", "GBP", "USD" }); Thread.Sleep(3000); //0808333 //goodPartner3Mena; Jurisdiction = mena; Country = UAE; xtrader; GBP pageTradingAccountsReal.GoToPage(pageTradingAccountsReal.BaseUrl + "/partner/" + goodPartner3MenaId); pageTradingAccountsReal.LnkCreateNewAccount.Click(); //YES //Assert.AreEqual(goodPartner3MenaName, pageCreateRealAccount.CmbSelectPartnership.GetValue()); Assert.AreEqual(goodPartner3MenaId, pageCreateRealAccount.CmbSelectPartnership.GetValue()); pageCreateRealAccount.CmbSelectAccountType.GetValuesList().Should().BeEquivalentTo(new[] { "cTrader" }); pageCreateRealAccount.CmbSelectAccountType.SetValueAfterClick(0); pageCreateRealAccount.CmbSelectCurrencyBase.GetValuesList().Should().BeEquivalentTo(new[] { "GBP" }); Thread.Sleep(3000); //0808334 //goodPartner3Gm; Jurisdiction = mena; Country = UAE; default; default pageTradingAccountsReal.GoToPage(pageTradingAccountsReal.BaseUrl + "/partner/" + goodPartner3GmId); pageTradingAccountsReal.LnkCreateNewAccount.Click(); //NO pageCreateRealAccount.CmbSelectAccountType.GetValuesList().Should().BeEquivalentTo(new[] { "cTrader", "MT4", "MT5" }); pageCreateRealAccount.CmbSelectAccountType.SetValueAfterClick(0); pageCreateRealAccount.CmbSelectCurrencyBase.GetValuesList().Should().BeEquivalentTo(new[] { "EUR", "GBP", "USD" }); }
public void Partner_Thai_No_No_No(string lng) { #region Test Data var goodPartner1Name = "good_partner1"; var goodPartner1Id = "0808331"; var goodPartner2Name = "good_partner2"; var goodPartner2Id = "0808332"; var goodPartner3MenaName = "good_partner3"; var goodPartner3MenaId = "0808333"; var goodPartner3GmName = "good_partner3"; var goodPartner3GmId = "0808334"; 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 = "******"TestNameThailand"; dataStep0.TxtLastName = "TestLastNameThailand"; dataStep0.CmbCountry = "Thailand"; dataStep0.BtnNexStep = true; DataStep1 dataStep1 = new DataStep1(); dataStep1.TxtAddress = "Walking Street 1"; dataStep1.TxtPostcode = "1234567890"; dataStep1.TxtCity = "Muang Pattaya"; dataStep1.TxtBirthdate = "01/01/1990"; dataStep1.TxtPhone = "66000000000"; dataStep1.CmbNationality = "Thailand"; dataStep1.BtnNexStep = true; DataStep2 dataStep2 = new DataStep2(); //Employment Information dataStep2.CmbEmployment = "Employed"; dataStep2.CmbEmploymentType = "Financial Services"; dataStep2.CmbLevelOfEducation = "High School"; //Financial Information dataStep2.CmbAnnualIncome = "> $1,000,000"; dataStep2.CmbEstimatedNetWorth = "$1,000,000 – $5,000,000"; dataStep2.CmbSourceOfIncome = "Savings / Investments"; dataStep2.CmbDeposit = "> $1,000,000"; dataStep2.ChkToTradeCFDs = true; //Trading Experience dataStep2.CmbTradingExperience = "No"; dataStep2.ChkHaveRelevantEducational = true; dataStep2.ChkIRegularlyMonitorNews = true; dataStep2.ChkIHaveReadMaterialOnTrading = true; dataStep2.BtnNexStep = true; DataStep3 dataStep3 = new DataStep3(); dataStep3.CmbAccountType = "MT5"; dataStep3.CmbLeverage = "1:50"; dataStep3.CmbCurrencyBase = "EUR"; dataStep3.BtnVerifyYourProfileNo = true; dataStep3.ChkReceiveCompanyNews = true; dataStep3.ChkReceiveTechnicalAnalysis = true; dataStep3.ChkAcceptRisks = true; dataStep3.CmbLanguage = "English"; dataStep3.ChkClientAgreement = true; dataStep3.BtnComplete = true; #endregion //Login page PageLogin pageLogin = new PageLogin(ngWebDriver, lng); pageLogin.GoToPage(pageLogin.ExpectedUrl); Assert.AreEqual(pageLogin.ExpectedUrl, ngWebDriver.Url); pageLogin.LnkCreateAnAccount.Click(); ngWebDriver.WaitForAngular(); //Registration Step 0 RegistrationHelper.RegistrationStep0(ngWebDriver, dataStep0, lng); //Registration Step 1 RegistrationHelper.RegistrationStep1(ngWebDriver, dataStep1, lng); //Registration Step 2 RegistrationHelper.RegistrationStep2(ngWebDriver, dataStep2, lng); //Registration Step 3 RegistrationHelper.RegistrationStep3(ngWebDriver, dataStep3, lng); PageTradingAccountsReal pageTradingAccountsReal = new PageTradingAccountsReal(ngWebDriver, lng); pageTradingAccountsReal.WaitLoadPage(pageTradingAccountsReal); //null //without partner; Jurisdiction = mena; Country = Arabia; default; default pageTradingAccountsReal.LnkCreateNewAccount.Click(); PageCreateRealAccount pageCreateRealAccount = new PageCreateRealAccount(ngWebDriver, lng); pageCreateRealAccount.WaitLoadPage(pageCreateRealAccount); //NO pageCreateRealAccount.CmbSelectAccountType.GetValuesList().Should().BeEquivalentTo(new[] { "cTrader", "MT4", "MT5" }); pageCreateRealAccount.CmbSelectAccountType.SetValueAfterClick(0); pageCreateRealAccount.CmbSelectCurrencyBase.GetValuesList().Should().BeEquivalentTo(new[] { "EUR", "GBP", "USD" }); //0808331 //good_partner1; Jurisdiction = mena; Country = all; mt4m, xtrader; EUR, USD pageTradingAccountsReal.GoToPage(pageTradingAccountsReal.BaseUrl + "/partner/" + goodPartner1Id); pageTradingAccountsReal.WaitLoadPage(pageTradingAccountsReal); pageTradingAccountsReal.LnkCreateNewAccount.Click(); pageCreateRealAccount.WaitLoadPage(pageCreateRealAccount); //YES Assert.AreEqual(goodPartner1Name, pageCreateRealAccount.CmbSelectPartnership.GetValue()); pageCreateRealAccount.CmbSelectAccountType.GetValuesList().Should().BeEquivalentTo(new[] { "MT4", "cTrader" }); pageCreateRealAccount.CmbSelectAccountType.SetValueAfterClick(0); pageCreateRealAccount.CmbSelectCurrencyBase.GetValuesList().Should().BeEquivalentTo(new[] { "EUR", "USD" }); Thread.Sleep(3000); //0808332 //good_partner2; Jurisdiction = gm; Country = other; default; default pageTradingAccountsReal.GoToPage(pageTradingAccountsReal.BaseUrl + "/partner/" + goodPartner2Id); pageTradingAccountsReal.WaitLoadPage(pageTradingAccountsReal); pageTradingAccountsReal.LnkCreateNewAccount.Click(); pageCreateRealAccount.WaitLoadPage(pageCreateRealAccount); //NO pageCreateRealAccount.CmbSelectAccountType.GetValuesList().Should().BeEquivalentTo(new[] { "cTrader", "MT4", "MT5" }); pageCreateRealAccount.CmbSelectAccountType.SetValueAfterClick(0); pageCreateRealAccount.CmbSelectCurrencyBase.GetValuesList().Should().BeEquivalentTo(new[] { "EUR", "GBP", "USD" }); Thread.Sleep(3000); //0808333 //goodPartner3Mena; Jurisdiction = mena; Country = Arabia; null; null pageTradingAccountsReal.GoToPage(pageTradingAccountsReal.BaseUrl + "/partner/" + goodPartner3MenaId); pageTradingAccountsReal.WaitLoadPage(pageTradingAccountsReal); pageTradingAccountsReal.LnkCreateNewAccount.Click(); pageCreateRealAccount.WaitLoadPage(pageCreateRealAccount); //YES Assert.AreEqual(goodPartner3MenaName, pageCreateRealAccount.CmbSelectPartnership.GetValue()); Thread.Sleep(3000); //0808334 //goodPartner3Gm; Jurisdiction = mena; Country = UAE; default; default pageTradingAccountsReal.GoToPage(pageTradingAccountsReal.BaseUrl + "/partner/" + goodPartner3GmId); pageTradingAccountsReal.WaitLoadPage(pageTradingAccountsReal); pageTradingAccountsReal.LnkCreateNewAccount.Click(); pageCreateRealAccount.WaitLoadPage(pageCreateRealAccount); //NO pageCreateRealAccount.CmbSelectAccountType.GetValuesList().Should().BeEquivalentTo(new[] { "cTrader", "MT4", "MT5" }); pageCreateRealAccount.CmbSelectAccountType.SetValueAfterClick(0); pageCreateRealAccount.CmbSelectCurrencyBase.GetValuesList().Should().BeEquivalentTo(new[] { "EUR", "GBP", "USD" }); }