示例#1
0
 public static Func <IWebDriver, bool> ClickAssert(By locator, By assertLocator)
 {
     return((Func <IWebDriver, bool>)(driver => {
         try {
             IWebElement element = driver.FindElement(locator);
             if (element.Enabled && element.Displayed && (!element.Size.IsEmpty || !element.Location.IsEmpty))
             {
                 log.Debug("Element: '" + locator.ToString() + "' is clickable.");
                 element.Click();
                 IWebElement assertElement = SharedServiceClass.ElementIsVisible(driver, assertLocator, 30);
                 if (assertElement.Displayed && (!assertElement.Size.IsEmpty || !assertElement.Location.IsEmpty))
                 {
                     log.Debug("Element: '" + locator.ToString() + "' has been clicked and asserted: '" + assertLocator.ToString() + "'.");
                     return true;
                 }
                 log.Debug("Assert failed for: '" + assertLocator.ToString() + "'.");
                 return false;
             }
             log.Debug("Element: '" + locator.ToString() + "' is not found/clickable.");
             return false;
         } catch (Exception ex) {
             log.Debug("Assert failed for: '" + assertLocator.ToString() + "'.");
             return false;
         }
     }));
 }
示例#2
0
        }//[email protected]

        public void FindCustomer(string logHeader, string identifier)
        {
            actionBot.WriteToLog("Begin method: " + logHeader);
            SharedServiceClass.WaitForBlockUiOff(Driver);
            Actions sendKeyAction = new Actions(Driver);

            sendKeyAction.KeyDown(Keys.Control).SendKeys("g").Build().Perform();

            //IWebElement asd = Driver.FindElement(By.Id("go-to-template"));
            //IWebElement asdasd = asd.FindElement(By.CssSelector("input.goto-customerId.form-control.ui-autocomplete-input"));
            //asdasd.SendKeys(identifier);

            IWebElement idField = SharedServiceClass.ElementIsVisible(Driver, By.XPath("//div[@id='go-to-template']/input[@class='goto-customerId form-control ui-autocomplete-input']"));

            sendKeyAction.Click(idField).Build().Perform();
            sendKeyAction.SendKeys(idField, identifier).Build().Perform();
            sendKeyAction.SendKeys(idField, Keys.Down).Build().Perform();

            idField.Clear();
            idField.SendKeys(identifier);
            idField.SendKeys(Keys.Down);
            idField.SendKeys(Keys.Enter);

            IWebElement okButton = Driver.FindElement(By.CssSelector("div.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix > div.ui-dialog-buttonset > button.ok-button.btn.btn-primary"));

            okButton.Click();
            actionBot.WriteToLog("End method: " + logHeader + Environment.NewLine);
        }
示例#3
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);
        }
示例#4
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);
        }
示例#5
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);
        }
示例#6
0
        public void CustomerLogOff(string logHeader)
        {
            actionBot.WriteToLog("Begin method: " + logHeader);

            SharedServiceClass.WaitForBlockUiOff(Driver);

            //Click log-off
            actionBot.Click(By.CssSelector("li.login > a"), "(customer log-off button)");

            actionBot.WriteToLog("End method: " + logHeader + Environment.NewLine);
        }
示例#7
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);
        }
示例#8
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);
        }
示例#9
0
        /// <summary>
        /// This procedure follows C1202.
        /// </summary>
        /// <returns></returns>
        public void CreateNewBrokerAccount(
            string logHeader,
            string iFirmName,
            string iContactName,
            string iContactEmail,
            string iContactMobile,
            string iMobileCode,
            string iEstimatedMonthlyAppCount,
            string iEstimatedMonthlyClientAmount,
            string iPassword
            )
        {
            actionBot.WriteToLog("Begin method: " + logHeader);

            //Step 4 - Click create an account.
            string url = String.Concat(EnvironmentConfig.GetString("ENV_address"), BrandConfig.GetString("Brand_url"), IsRunLocal, BrandConfig.GetString("BrokerSignupHost"));

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

            //Step 5 - Insert company name to the company name field and focus out.
            actionBot.SendKeys(By.Id("FirmName"), iFirmName, "(company name field)");

            //Step 6 - Insert contact person full name and focus out.
            actionBot.SendKeys(By.Id("ContactName"), iContactName, "(contact person full name)");

            //Step 7 - Insert a valid email address and focus out.
            actionBot.SendKeys(By.Id("ContactEmail"), iContactEmail, "(valid email addressma)");

            //Step 8 - Insert a valid number to the contact person mobile phone field and focus out. Mobile phone via work around is: 01111111111
            actionBot.SendKeys(By.Id("ContactMobile"), iContactMobile, "(contact person mobile phone)");

            //Work around is to replace Step 13 - Insert valid CAPTCHA and focus out
            //Work around - configuration change in Table: [ezbob].[ConfigurationVariables] Parameter: Name='BrokerForceCaptcha' Value='0'
            actionBot.Click(By.Id("generateMobileCode"), "(generate mobile code button)");

            //Mobile code via work around is: 222222
            actionBot.SendKeys(By.Id("MobileCode"), iMobileCode, "(valid mobile code)");

            //Step 9 - Insert any amount to the number of applications per month field and focus out.
            //actionBot.SendKeys(By.Id("EstimatedMonthlyAppCount"), iEstimatedMonthlyAppCount, "(number of applications per month)");

            //Step 10 - Insert any amount to the value of credit per month field and focus out.
            //actionBot.SendKeys(By.Id("EstimatedMonthlyClientAmount"), iEstimatedMonthlyClientAmount, "(value of credit per month)");

            //Check the FCA Registered check box.
            //actionBot.Click(By.XPath("//label[@for='FCARegistered']"), "(Click on the FCS Registered checkbox)");

            //Step 11 - Insert a valid password to the password field and focus out.
            actionBot.SendKeys(By.Id("Password"), iPassword, "(password field)");

            //Step 12 - Insert the same password to the confirm password field and focus out.
            actionBot.SendKeys(By.Id("Password2"), iPassword, "(confirm password)");

            By terms;
            By privacy;

            switch (BrandConfig.BaseName)
            {
            case "UIAutomationTests.configs.Brand.Ezbob":
                terms   = By.Id("AgreeToTerms");
                privacy = By.Id("AgreeToPrivacyPolicy");
                break;

            case "UIAutomationTests.configs.Brand.Everline":
                terms   = By.XPath("//label[@for='AgreeToTerms']");
                privacy = By.XPath("//label[@for='AgreeToPrivacyPolicy']");
                break;

            default:
                terms   = By.Id("");
                privacy = By.Id("");
                break;
            }

            //Step 14 - Check all required checkboxe's.
            actionBot.Click(terms, "(agree to terms checkBox)");

            actionBot.Click(privacy, "(agree to privacy policy checkBox)");

            //Step 15 - Click sign up.
            actionBot.Click(By.Id("SignupBrokerButton"), "(sign up button)");

            actionBot.WriteToLog("Begin assert: Verify broker dashboard is displayed.");
            SharedServiceClass.ElementIsVisible(Driver, By.Id("AddNewCustomer"));
            actionBot.WriteToLog("Positively asserted: Dashboard is displayed.");

            actionBot.WriteToLog("End method: " + logHeader + Environment.NewLine);
        }
示例#10
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);
        }
示例#11
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);
        }
示例#12
0
        //This procedure follows C3.
        //origin - BrokerFillLead: when broker fills lead's wizard; ClientSignup: when accessing from main wizard page.
        public void PerformWizardStepOne(
            string logHeader,
            string origin,
            string emailAdress,
            string password,
            int secretQuestion,
            string secAnswer,
            string reqAmmount
            )
        {
            actionBot.WriteToLog("Begin method: " + logHeader);

            if (string.Equals("ClientSignup", origin))
            {
                string url = String.Concat(EnvironmentConfig.GetString("ENV_address"), BrandConfig.GetString("Brand_url"), IsRunLocal, BrandConfig.GetString("WizardHost"));

                //Step 2 - Browse to OM app.
                Driver.Navigate().GoToUrl(url);
                actionBot.WriteToLog("Nevigate to url: " + url);

                //Step 3 - Insert a valid email address to the Email address field and focus out.
                actionBot.SendKeys(By.Id("Email"), emailAdress, "(valid email address)");
            }

            if (string.Equals("BrokerFillLead", origin))
            {
                actionBot.WriteToLog("Begin assert: Verify e-mail address in wizard is: " + emailAdress);
                Assert.AreEqual(SharedServiceClass.ElementIsVisible(Driver, By.Id("Email")).GetAttribute("value"), emailAdress);
                actionBot.WriteToLog("Positively asserted: e-mail addresses matched.");
            }

            //Step 4 - Insert a valid password to the password field and focus out.
            actionBot.SendKeys(By.Id("signupPass1"), password, "(password field)");

            //Step 5 - Insert the same password to the confirm password field and focus out.
            actionBot.SendKeys(By.Id("signupPass2"), password, "(confirm password)");

            //Step 6 - Select secret question from the list.
            actionBot.SelectByIndex(By.Id("securityQuestion"), secretQuestion, "(secret question select)");

            //Step 7 - Insert answer in the Secret answer field and focus out.
            actionBot.SendKeys(By.Id("SecurityAnswer"), secAnswer, "(secret answer field)");

            //IWebElement amount = Driver.FindElement(By.Id("amount"));
            //amount.SendKeys(reqAmmount);

            if (String.Equals(origin, "ClientSignup"))  //This code is ilrelevant in case accessed from Broker-lead-fill

            //Step 8 - Insert number in the Mobile phone field and focus out.
            {
                actionBot.SendKeys(By.Id("mobilePhone"), "1111111111", "(contact person mobile phone)");

                //Step 9 - Click send activation code.
                actionBot.Click(By.Id("generateMobileCode"), "(generate mobile code button)");

                //Step 10 - Insert the authentication code. Workaround is: 222222
                actionBot.SendKeys(By.Id("mobileCode"), "222222", "(valid mobile code)");
            }

            //Step 11 - Click continue.
            actionBot.Click(By.Id("signupSubmitButton"), "(continue button)");

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