Beispiel #1
0
        public void CustomerLogIn(
            string logHeader,
            bool isFirstTime,
            string brokerMail
            )
        {
            actionBot.WriteToLog("Begin method: " + logHeader);
            SharedServiceClass.WaitForAjaxReady(Driver);
            string url = String.Concat(EnvironmentConfig.GetString("ENV_address"), BrandConfig.GetString("Brand_url"), IsRunLocal, BrandConfig.GetString("CustomerLogIn"));

            Driver.Navigate().GoToUrl(url);
            actionBot.WriteToLog("Nevigate to url: " + url);

            //Insert register customer's e-mail to the user name field.
            actionBot.SendKeys(By.Id("UserName"), brokerMail, "(user name field)");

            //Insert password to the password field. Default: '123456'
            actionBot.SendKeys(By.Id("Password"), "123123", "(password field)");

            //Click on submit button.
            actionBot.Click(By.Id("loginSubmit"), "(login button)");

            if (isFirstTime)
            {
                actionBot.Click(By.CssSelector("div.automation-popup-content > div.alignright > button.button"), "(automation - accept terms button)");
            }

            actionBot.WriteToLog("End method: " + logHeader + Environment.NewLine);
        }
Beispiel #2
0
        public void BrokerLogIn(
            string logHeader,
            string brokerMail
            )
        {
            actionBot.WriteToLog("Begin method: " + logHeader);

            SharedServiceClass.WaitForAjaxReady(Driver);

            //Navigate to broker log-in page.
            string url = String.Concat(EnvironmentConfig.GetString("ENV_address"), BrandConfig.GetString("Brand_url"), IsRunLocal, BrandConfig.GetString("BrokerLoginHost"));

            Driver.Navigate().GoToUrl(url);
            actionBot.WriteToLog("Nevigate to url: " + url);

            //Insert a registered broker's email address and focus out.
            actionBot.SendKeys(By.Id("LoginEmail"), brokerMail, "(registered broker email address)");

            //Insert a valid password to the password field and focus out.
            actionBot.SendKeys(By.Id("LoginPassword"), "123456", "(password field)");

            //Click sign up.
            actionBot.Click(By.Id("LoginBrokerButton"), "(sign up button)");

            //Accept terms button only appears when terms are changed. TODO: check why this button shows up without terms change.
            try {
                actionBot.Click(By.Id("AcceptTermsButton"), "(accept terms button)", 2);
            } catch { }

            actionBot.WriteToLog("End method: " + logHeader + Environment.NewLine);
        }
Beispiel #3
0
        //origin - BrokerFillLead: when broker fills lead's wizard; ClientSignup: when accessing from main wizard page.
        public void PerformWizardStepFourPayPal(
            string logHeader,
            string origin,
            string loginVal,
            string passVal
            )
        {
            actionBot.WriteToLog("Begin method: " + logHeader);

            SharedServiceClass.WaitForBlockUiOff(Driver);

            actionBot.Click(By.Id("link_account_see_more_less"), "(see full data source button)");
            //SharedServiceClass.JqueryElementReady(Driver, ".marketplace-button-account-paypal");
            //Step 1 - Click on relevant data source.

            actionBot.Click(By.CssSelector("a.marketplace-button-account-paypal"), "(data source button)");
            //actionBot.Click(By.CssSelector("a.marketplace-button-account-paypal"), "(data source button)");

            //PayPal Click continue.
            actionBot.Click(By.Id("paypalContinueBtn"), "(continue to PayPal button)");

            //Move focus to the pop-uped window.
            actionBot.SwitchToWindow(2, "(PayPal add account window)");

            //Verify the pop-up address is correct.
            actionBot.WriteToLog("Begin assert: Verify web address contains the sub-string: 'webscr'");
            SharedServiceClass.WebAddressContains(Driver, "webscr", 20);
            actionBot.WriteToLog("Positively asserted: Web address contains the sub-string.");

            //Step 3 - Insert prepared credentials and click sign in.
            try {
                actionBot.SendKeys(By.Id("login_email"), loginVal, "(data source login field)", 20);

                actionBot.SendKeys(By.Id("login_password"), passVal, "(data source password field)");

                actionBot.Click(By.Id("login.x"), "(data source login button)");
            } catch (Exception e) {
                actionBot.WriteToLog("Paypal is already in session. Moving to grant premission page automaticaly.");
            }

            actionBot.Click(By.Name("grant.x"), "(PayPal continue to Ezbob/Everline button)");

            //Move focus back to Ezbob/Everline window.
            actionBot.SwitchToWindow(1, "(back to Ezbob/Everline application window)");

            SharedServiceClass.WaitForAjaxReady(Driver);

            //Step 4 - Click complete.
            actionBot.Sleep(5000);
            actionBot.Click(By.Id("finish-wizard"), "(complete button)");
            //actionBot.JQueryClick("#finish-wizard", "(complete button)");

            //Step 5 - Accept dialog.
            if (String.Equals("ClientSignup", origin))
            {
                actionBot.Click(By.XPath("//button[@ui-event-control-id='profile:request-processing-continue-popup-nodecision']"), "(accept dialog button)");
            }

            actionBot.WriteToLog("End method: " + logHeader + Environment.NewLine);
        }
Beispiel #4
0
        //This procedure follows C91.
        public void PerformWizardStepThree(
            string logHeader,
            string businessType,
            string indType,
            string revenue
            )
        {
            actionBot.WriteToLog("Begin method: " + logHeader);

            SharedServiceClass.WaitForAjaxReady(Driver);

            //Step 1 - In the Type of Business field, select relevant property and focus out.
            actionBot.SelectByValue(By.Id("TypeOfBusiness"), businessType, "(type of business select)");

            //Step 2 - In the Type of Industry field, select relevant property and focus out.
            actionBot.SelectByValue(By.Id("IndustryType"), indType, "(type of industry select)");

            //Step 3 - Insert any amount to the Total annual revenue field and focus out.
            actionBot.SendKeys(By.Id("OverallTurnOver"), revenue, "(total annual revenue field)");

            //actionBot.MoveToElement(By.Id("companyContinueBtn"));
            actionBot.MoveToBottom();
            //Step 4 - Click continue.
            actionBot.Click(By.Id("companyContinueBtn"), "(continue button)");
            //actionBot.JQueryClick("#companyContinueBtn", "(continue button)");

            //TODO: find out when this dialog is displayed, and create more acurate scenario for it.
            try {
                SharedServiceClass.WaitForBlockUiOff(Driver);

                //Click the correct address.
                actionBot.Click(By.CssSelector("div.ui-dialog > div.ui-dialog-content > ul.targets > li"), "(sellect address from list)", 25);

                //Click OK.
                actionBot.Click(By.CssSelector("button.button.btn-green.btnTargetOk.ev-btn-org"), "(address OK button)");
            } catch { }

            actionBot.WriteToLog("End method: " + logHeader + Environment.NewLine);
        }
Beispiel #5
0
        //Precondition: be loggedin to customer.
        public void CustomerTakeLoan(
            string logHeader,
            string fName,
            string lName,
            string accountNum,
            string sort1,
            string sort2,
            string sort3,
            char accType,
            string cardHolderName,
            string cardType,
            string cardNumber,
            string expDate,
            string securityCode,
            double?loanFraction = null
            )
        {
            actionBot.WriteToLog("Begin method: " + logHeader);

            SharedServiceClass.WaitForAjaxReady(Driver);

            //Click on the take loan button.
            //actionBot.ClickAssert(By.CssSelector("button.button.btn-green.get-cash.ev-btn-org"), By.XPath("//label[@for='preAgreementTermsRead']"), "(take loan button)");
            actionBot.Click(By.CssSelector("button.button.btn-green.get-cash.ev-btn-org"), "(take loan button)");

            if (loanFraction != null)
            {
                //Click on slider to vary the loan ammount.
                IWebElement rangeSelector   = SharedServiceClass.ElementIsClickable(Driver, By.CssSelector("div.ui-slider-range.ui-widget-header.ui-slider-range-min"));//Driver.FindElement(By.CssSelector("div.ui-slider-range.ui-widget-header.ui-slider-range-min")));
                int         clickCoordinate = (int)(rangeSelector.Size.Width * loanFraction);
                Actions     moveAction      = new Actions(Driver);
                moveAction.MoveToElement(rangeSelector, clickCoordinate, 0).Click().Build().Perform();
                actionBot.WriteToLog("Click was performed on loan ammount slider at " + (loanFraction * 100).ToString() + "%.");
            }

            //Click on the accept pre-agreement terms button.
            //actionBot.Click(By.XPath("//label[@for='preAgreementTermsRead']"), "(pre-agreement terms button)");

            //Click on the contract terms read check box.
            //actionBot.Click(By.XPath("//label[@for='agreementTermsRead']"), "(contract terms read checkBox)");

            //Click on confirm the solvency representations and warranties.
            actionBot.Click(By.XPath("//label[@for='notInBankruptcy']"), "(solvency representations and warranties checkBox)");

            SharedServiceClass.WaitForBlockUiOff(Driver);

            //Confirn disclosures.
            actionBot.Click(By.CssSelector("button.ok-button.button.btn-green.ev-btn-org"), "(confirn disclosures button)");

            //Signe the agreement.
            actionBot.SendKeys(By.Id("signedName"), fName + " " + lName, "(signature field)");

            //Click next to accept the agreements.
            actionBot.Click(By.CssSelector("form.LoanLegal a.btn-continue.button.btn-green.ev-btn-org.submit"), "(accept agreement button)");

            //Insert account number sort codes.
            actionBot.SendKeys(By.Id("AccountNumber"), accountNum, "(account number field)");

            actionBot.SendKeys(By.Id("SortCode1"), sort1, "(sort code - part 1)");

            actionBot.SendKeys(By.Id("SortCode2"), sort2, "(sort code - part 2)");

            actionBot.SendKeys(By.Id("SortCode3"), sort3, "(sort code - part 3)");

            By     accTypeRadio;
            string accTypeComment;

            switch (char.ToUpper(accType))
            {
            case 'B':
                accTypeRadio   = By.XPath("//label[@for='baBusiness']");
                accTypeComment = "(account type radioButton set to Bussines)";
                break;

            default:
                accTypeRadio   = By.XPath("//label[@for='baPersonal']");
                accTypeComment = "(account type radioButton set to Personal)";
                break;
            }
            actionBot.Click(accTypeRadio, accTypeComment);

            //Click on connect bank continue button.
            actionBot.Click(By.CssSelector("a.button.btn-green.connect-bank.ev-btn-org"), "(connect bank continue button - first click)");

            SharedServiceClass.WaitForBlockUiOff(Driver);

            //Click on connect bank continue button. Second click. - Second click is to activate the backdoor.
            actionBot.Click(By.CssSelector("a.button.btn-green.connect-bank.ev-btn-org"), "(connect bank continue button - second click)");

            //Name of card holder.
            actionBot.SendKeys(By.Id("customer"), cardHolderName, "(card holder name field)");

            //Card type.
            actionBot.SelectByValue(By.CssSelector("select.selectheight.form_field"), cardType, "(card type select)");

            //Card number.
            actionBot.SendKeys(By.Id("card_no"), cardNumber, "(card number field)");

            //Card expire date.
            actionBot.SendKeys(By.Id("expiry"), expDate, "(card expire date field)");

            //Card CV2 code
            actionBot.SendKeys(By.Id("cv2"), securityCode, "(card CV2 code field)");

            //Submit debit card details
            actionBot.Click(By.Id("paypoint-submit"), "(submit debit card details button)");

            //Continue to customer's profile
            actionBot.Click(By.Id("pacnet-status-back-to-profile"), "(continue to customer's profile button)");

            actionBot.WriteToLog("End method: " + logHeader + Environment.NewLine);
        }
Beispiel #6
0
        //This procedure follows C26.
        //origin - BrokerFillLead: when broker fills lead's wizard; ClientSignup: when accessing from main wizard page.
        public void PerformWizardStepTwo(
            string logHeader,
            string origin,
            string personName,
            string personSurename,
            char gender,
            string dobDay,
            string dobMonth,
            string dobYear,
            string marStatus,
            string postCode,
            string addressTime,
            string resStatus,
            string phone,
            string phone2,
            bool agreeTerms
            )
        {
            actionBot.WriteToLog("Begin method: " + logHeader);

            SharedServiceClass.WaitForAjaxReady(Driver);
            SharedServiceClass.WaitForBlockUiOff(Driver);

            //TODO: remove a-sync locks. must be a workaround this problem.
            if (string.Equals("ClientSignup", origin))
            {
                //Step 1 - Insert first name and focus out.
                lock (this.Locker)
                    actionBot.SendKeys(By.Id("FirstName"), personName, "(first name field)");

                lock (this.Locker)
                    actionBot.SendKeys(By.Id("Surname"), personSurename, "(surname field)");
            }

            if (string.Equals("BrokerFillLead", origin))
            {
                actionBot.WriteToLog("Begin assert: Verify first name in wizard is: " + personName);
                Assert.AreEqual(SharedServiceClass.ElementIsVisible(Driver, By.Id("FirstName")).GetAttribute("value"), personName);
                actionBot.WriteToLog("Positively asserted: first names matched.");

                actionBot.WriteToLog("Begin assert: Verify sure name in wizard is: " + personSurename);
                Assert.AreEqual(SharedServiceClass.ElementIsVisible(Driver, By.Id("Surname")).GetAttribute("value"), personSurename);
                actionBot.WriteToLog("Positively asserted: sure names matched.");
            }

            //Step 3 - Select gender and focus out.
            By formRadioCtrl;

            switch (char.ToUpper(gender))
            {
            case 'F':
                formRadioCtrl = By.XPath("//label[@for='FormRadioCtrl_F']");
                break;

            default:
                formRadioCtrl = By.XPath("//label[@for='FormRadioCtrl_M']");
                break;
            }
            actionBot.MoveToElement(formRadioCtrl);
            actionBot.Click(formRadioCtrl, "(gender select button)");

            //Step 4 -  Select date of birth and focus out.
            actionBot.MoveToElement(By.Id("DateOfBirthDay"));
            actionBot.SelectByValue(By.Id("DateOfBirthDay"), dobDay, "(date of birth - day select)");

            actionBot.SelectByText(By.Id("DateOfBirthMonth"), dobMonth, "(date of birth - month select)");

            actionBot.SelectByValue(By.Id("DateOfBirthYear"), dobYear, "(date of birth - year select)");

            //Step 5 - Select Marital status other and focus out.
            actionBot.SelectByValue(By.Id("MaritalStatus"), marStatus, "(marital status select)");

            //Step 6 - Insert post code.
            actionBot.SendKeys(By.CssSelector("input.addAddressInput"), postCode, "(post code field)");

            //Step 7 - Click Postcode lookup.
            actionBot.Click(By.CssSelector("input.addAddress"), "(postcode lookup button)");

            //Step 8 - Click the correct address.
            actionBot.Click(By.CssSelector("ul.matchingAddressList > li"), "(sellect address from list)");

            //Step 9 - Click OK.
            actionBot.Click(By.CssSelector("button.postCodeBtnOk"), "(address OK button)");

            //Step 10 - In the How long at this address field, select relevant property and focus out.
            actionBot.SelectByValue(By.Id("TimeAtAddress"), addressTime, "(how long at this address select)");

            //Step 11 - In the Residential status field, select relevant property and focus out.
            actionBot.SelectByValue(By.Id("PropertyStatus"), resStatus, "(residential status select)");

            //Step 12 - Insert valid format phone number in the Other contact number field and focus out.
            if (String.Equals(origin, "BrokerFillLead"))
            {
                actionBot.SendKeys(By.Id("MobilePhone"), phone, "(valid format mobile phone number)");
            }

            actionBot.SendKeys(By.Id("DayTimePhone"), phone2, "(valid format day time phone number)");

            //Step 13 - Check the TOS checkbox.
            if (agreeTerms)
            {
                actionBot.Click(By.XPath("//label[@for='ConsentToSearch']"), "(terms and conditions checkBox)");
            }

            //Step 14 - Click continue.
            actionBot.Click(By.Id("personInfoContinueBtn"), "(continue button)");

            actionBot.WriteToLog("End method: " + logHeader + Environment.NewLine);
        }
Beispiel #7
0
        //This procedure follows C4530. (PayPal sometimes replaced by other data sources - C4537)
        //origin - BrokerFillLead: when broker fills lead's wizard; ClientSignup: when accessing from main wizard page.
        public void PerformWizardStepFour(
            string logHeader,
            string origin,
            By marketplace,
            By accLogin,
            string loginVal,
            By accPass,
            string passVal,
            By accBtn
            )
        {
            actionBot.WriteToLog("Begin method: " + logHeader);

            SharedServiceClass.WaitForBlockUiOff(Driver);

            actionBot.MoveToBottom();
            actionBot.Click(By.Id("link_account_see_more_less"), "(see full data source button)");
            //actionBot.JQueryClick("#link_account_see_more_less", "(see full data source button)");
            //Step 1 - Click on relevant data source.
            //By marketplacedAssert;
            //switch (marketplace) {
            //    case "a.marketplace-button-account-paypal":
            //        marketplacedAssert = By.Id("paypalContinueBtn");
            //        break;
            //    default:
            //        marketplacedAssert = By.Id(accLogin);
            //        break;
            //}
            //actionBot.ClickAssert(By.CssSelector(marketplace), marketplacedAssert, "(data source button)");

            actionBot.Click(marketplace, "(data source button)");

            //Step 3 - Insert prepared credentials and click sign in.
            actionBot.SendKeys(accLogin, loginVal, "(data source login field)");

            actionBot.SendKeys(accPass, passVal, "(data source password field)");

            actionBot.Click(accBtn, "(data source login button)");

            SharedServiceClass.WaitForAjaxReady(Driver);
            SharedServiceClass.WaitForBlockUiOff(Driver);

            //Step 4 - Click complete.
            //By finishWizardAssert = By.Id("");
            //switch (origin) {
            //    case "BrokerFillLead":
            //        finishWizardAssert = By.Id("AddNewCustomer");
            //        break;
            //    case "ClientSignup":
            //        finishWizardAssert = By.XPath("//button[@ui-event-control-id='profile:request-processing-continue-popup-nodecision']");
            //        break;
            //}
            //actionBot.ClickAssert(By.Id("finish-wizard"), finishWizardAssert, "(complete button)");
            actionBot.Click(By.Id("finish-wizard"), "(complete button)");
            //actionBot.JQueryClick("#finish-wizard", "(complete button)");

            //Step 5 - Accept dialog.
            if (String.Equals("ClientSignup", origin))
            {
                actionBot.Click(By.XPath("//button[@ui-event-control-id='profile:request-processing-continue-popup-nodecision']"), "(accept dialog button)");
            }

            actionBot.WriteToLog("End method: " + logHeader + Environment.NewLine);
        }