Beispiel #1
0
        public void MyCountryIsNotListed(string lng)
        {
            #region Test Data

            #endregion

            //Login page
            PageLogin pageLogin = new PageLogin(ngWebDriver, lng);
            pageLogin.GoToPage(pageLogin.ExpectedUrl);
            Assert.AreEqual(pageLogin.ExpectedUrl, ngWebDriver.Url);
            pageLogin.LnkCreateAnAccount.Click();
            ngWebDriver.WaitForAngular();
            //Register page
            PageRegister pageRegister = new PageRegister(ngWebDriver, lng);
            pageRegister.CmbCountry.SetValueAfterClick("My country is not listed");
            //ngWebDriver.WaitForAngular();

            Thread.Sleep(5000);

            switch (lng)
            {
            case "en":
                Assert.AreEqual(@"https://direct.fxpro.com/register?lang=en#step1", ngWebDriver.WrappedDriver.Url);
                break;

            case "ar":
                Assert.AreEqual(@"https://direct.fxpro.com/register?lang=ar#step1", ngWebDriver.WrappedDriver.Url);
                break;
            }
        }
Beispiel #2
0
        public static void Set(IWebDriver webDriver, string baseUrl, string regulator)
        {
            switch (regulator.ToLower())
            {
            case "fca":
                webDriver.Navigate().GoToUrl(baseUrl + "/en/register?c=cy&j=fca");
                break;

            case "mena":
                webDriver.Navigate().GoToUrl(baseUrl + "/en/register?c=sa&j=mena");
                break;

            case "scb":
                webDriver.Navigate().GoToUrl(baseUrl + "/en/register?c=cy&j=gm");
                break;

            case "cysec":
                webDriver.Navigate().GoToUrl(baseUrl + "/en/register?c=cy&j=cysec");
                break;

            default:
                Log.Error("Regulator was not set.");
                break;
            }

            PageRegister pageRegister = new PageRegister(webDriver);

            Wait.ElementIsVisible(webDriver, pageRegister.LnkLogin);
            Thread.Sleep(4000);
            pageRegister.LnkLogin.Click();
            PageLogin pageLogin = new PageLogin(webDriver);

            Wait.UrlMatches(webDriver, pageLogin.ExpectedUrl);
            Thread.Sleep(4000);
        }
Beispiel #3
0
        public void Test(string lng)
        {
            #region Test Data

            var login = "******";

            #endregion

            PageLogin pageLogin = new PageLogin(webDriver, lng);
            pageLogin.GoToPage(pageLogin.ExpectedUrl);


            pageLogin.LnkRegister.Click();

            PageRegister pageRegister = new PageRegister(webDriver, lng);
        }
Beispiel #4
0
        public void Test(string lng)
        {
            #region Test Data

            var login = "******";

            #endregion

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


            pageLogin.LnkCreateAnAccount.Click();

            PageRegister pageRegister = new PageRegister(ngWebDriver, lng);
            pageRegister.WaitLoadPage(pageRegister);
        }
Beispiel #5
0
        /// <summary>
        /// Registration Step 0.
        /// </summary>
        /// <param name="ngWebDriver"></param>
        /// <param name="userDataStep0"></param>
        public static void RegistrationStep0(NgWebDriver ngWebDriver, DataStep0 userDataStep0, string lng)
        {
            PageRegister pageRegister = new PageRegister(ngWebDriver, lng);

            Assert.AreEqual(pageRegister.ExpectedUrl, ngWebDriver.Url);

            pageRegister.TxtEmail.Clear();
            if (userDataStep0.TxtEmail != null)
            {
                pageRegister.TxtEmail.SendKeys(userDataStep0.TxtEmail);
            }

            pageRegister.TxtPassword.Clear();
            if (userDataStep0.TxtPassword != null)
            {
                pageRegister.TxtPassword.SendKeys(userDataStep0.TxtPassword);
            }

            pageRegister.TxtFirstName.Clear();
            if (userDataStep0.TxtFirstName != null)
            {
                pageRegister.TxtFirstName.SendKeys(userDataStep0.TxtFirstName);
            }

            pageRegister.TxtLastName.Clear();
            if (userDataStep0.TxtLastName != null)
            {
                pageRegister.TxtLastName.SendKeys(userDataStep0.TxtLastName);
            }

            if (userDataStep0.CmbCountry != null)
            {
                pageRegister.CmbCountry.SetValueAfterClick(userDataStep0.CmbCountry);
            }

            if (userDataStep0.BtnNexStep)
            {
                pageRegister.BtnRegister.Click();
            }
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        public void RegistrationNewUser_UAE_No_No_No_Screenshot(string lng)
        {
            #region Test Data

            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);
            Assert.AreEqual(pageLogin.ExpectedUrl, webDriver.Url);
            AssertHelper.AssertScreenShot(webDriver, pageLogin.ScreenShot, 0);
            pageLogin.LnkRegister.Click();
            //webDriver.WaitForAngular();

            //Registration Step 0
            PageRegister pageRegister = new PageRegister(webDriver, lng);
            AssertHelper.AssertScreenShot(webDriver, pageRegister.ScreenShot, 0);
            RegistrationHelper.RegistrationStep0(webDriver, dataStep0, lng);

            //Registration Step 1
            PageRregisterStep1 pageRegisterStep1 = new PageRregisterStep1(webDriver, lng);
            AssertHelper.AssertScreenShot(webDriver, pageRegisterStep1.ScreenShot, 0);
            RegistrationHelper.RegistrationStep1(webDriver, dataStep1, lng);

            //Registration Step 2
            PageRregisterStep2 pageRegisterStep2 = new PageRregisterStep2(webDriver, lng);
            AssertHelper.AssertScreenShot(webDriver, pageRegisterStep2.ScreenShot, 0);
            RegistrationHelper.RegistrationStep2(webDriver, dataStep2, lng);

            //Registration Step 3
            PageRregisterStep3 pageRegisterStep3 = new PageRregisterStep3(webDriver, lng);
            AssertHelper.AssertScreenShot(webDriver, pageRegisterStep3.ScreenShot, 0);
            RegistrationHelper.RegistrationStep3(webDriver, dataStep3, lng);

            PageTradingAccountsReal pageTradingAccountsReal = new PageTradingAccountsReal(webDriver, lng);
            Wait.UrlContains(webDriver, pageTradingAccountsReal.ExpectedUrl);
        }
        public void BadPartnerLinkRegistrationNewUser(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;

            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";
            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 Register
            PageRegister pageRegister = new PageRegister(ngWebDriver, lng);

            //Partner ups-0123456789 is not exist
            pageRegister.GoToPage(pageRegister.BaseUrl + "/partner/ups1234567890");
            pageRegister.WaitLoadPage(pageRegister);

            //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);
        }