public void Employment_Selfemployed_NL(int loanamout, string strmobiledevice, string POL)
        {
            strUserType = "NL";
            try
            {
                _driver             = TestSetup(strmobiledevice);
                _homeDetails        = new HomeDetails(_driver, "NL");
                _loanPurposeDetails = new LoanPurposeDetails(_driver, "NL");
                _personalDetails    = new PersonalDetails(_driver, "NL");
                _bankDetails        = new BankDetails(_driver, "NL");
                _loanSetUpDetails   = new LoanSetUpDetails(_driver, "NL");

                // Click on Apply Button
                _homeDetails.ClickApplyBtn();

                // Click on Start Your Application Button
                _homeDetails.ClickStartApplictionBtn();

                bool hideshow = _homeDetails.CheckHideShow();
                if (hideshow == true)
                {
                    if (GetPlatform(_driver))
                    {
                        _loanPurposeDetails.RequestLoanAmountMobile(loanamout, POL);
                    }
                    else
                    {
                        _loanPurposeDetails.RequestLoanAmount(loanamout, POL);
                    }
                }
                else
                {
                    // Select Loan Value from Slide bar
                    _loanPurposeDetails.SelectLoanValue(loanamout);

                    //Click on First POL to select
                    _loanPurposeDetails.ClickSelectFirstPurposeBtn();

                    if (GetPlatform(_driver))
                    {
                        // Select Purpose of loan
                        _loanPurposeDetails.SelectLoanPurposeMobile(POL);
                    }
                    else
                    {
                        // Select Purpose of loan
                        _loanPurposeDetails.SelectLoanPurpose(POL);
                    }

                    // Enter FirstPOLLoan Amount
                    _loanPurposeDetails.EnterFirstPOLAmountTxt(loanamout.ToString());

                    // Click on Continue Button
                    _loanPurposeDetails.ClickLoanPOLContinueBtn();
                }
                PersonalDetailsDataObj _personalDetailsData = new PersonalDetailsDataObj();
                _personalDetailsData.EmploymentStatus = "Self Employed";
                // entering personal details with overwrite values
                _personalDetails.PopulatePersonalDetails(_personalDetailsData);

                //Click on No for personal use
                _personalDetails.ClickNoForPersonalUseBtn();

                // Selenium needs to click Continue button again to proceed, else it fails after popping extra questions
                _personalDetails.ClickPersonaldetailsContinueBtn();

                string strval = _personalDetails.GetDNQTxt();
                // Verify unsuccessful message
                string UnsuccessMsg = "Application unsuccessful";
                Assert.IsTrue(_personalDetails.GetUnsuccessMessage().Contains(UnsuccessMsg));

                //verify DNQ Message
                string ActualDNQMessage = "You currently don't qualify for a Nimble loan";
                Assert.IsTrue(_personalDetails.GetDNQMessage().Contains(ActualDNQMessage));
            }
            catch (Exception ex)
            {
                strMessage += ex.Message; Assert.Fail(ex.Message);
            }
        }
Exemple #2
0
        public void TC001_VerifyPOL_NL(int loanamout)
        {
            // Click on Apply Button
            _homeDetails.ClickApplyBtn();

            // Click on Start Your Application Button
            _homeDetails.ClickStartApplictionBtn();

            // Click on HideShowDebug Button
            _homeDetails.ClickHideShowDebugBtn();

            // Click on PassAllNobs Link
            _homeDetails.ClickPassAllNobslnk();

            // Select Purpose of loan
            _loanpurposedetails.SelectLoanPurpose(TestData.POL.Eventcosts.Birthdayparty);

            // Select Loan Value from Slide bar
            _loanpurposedetails.SelectLoanValue(loanamout);

            // Enter FirstPOLLoan Amount
            _loanpurposedetails.EnterFirstPOLAmountTxt(loanamout.ToString());

            // Click on Continue Button
            _loanpurposedetails.ClickLoanPOLContinueBtn();

            // Enter Email Details
            _personaldetails.EnterEmailTxt(_randomVal.RandomEmail());

            // Enter StreetName Details
            _personaldetails.EnterStreetNameTxt(TestData.OverrideCodes.Approved);

            // select Employement Status
            _personaldetails.SelectEmploymentStatusLst(TestData.YourEmployementStatus.FullTime);

            // select short term loans value as NO
            _personaldetails.ClickNoShortTermLoanStatusBtn();

            // Check Read Privacy and Electronic Authorisation
            _personaldetails.CheckReadPrivacyBtn(TestData.NewLoaner);

            // Check Read Credit Guide
            _personaldetails.CheckReadCreditBtn(TestData.NewLoaner);

            // Click on Personal Details Continue Button
            _personaldetails.ClickPersonaldetailsContinueBtn();

            // Click on checks out Continue Button
            _personaldetails.ClickCheckoutContinueBtn();

            // select Bank Name
            _bankDetails.SelectBankLst(TestData.BankDetails.DAGbank.Dagbank);

            // Click on Continue Button
            _bankDetails.BankSelectContinueBtn();

            // Entering Username and Password
            _bankDetails.EnterBankCredentialsTxt(TestData.BankDetails.DAGbank.UID, TestData.BankDetails.DAGbank.PWD);

            // Click on Continue Button
            _bankDetails.ClickAutoContinueBtn();

            // choose bank account
            _bankDetails.BankAccountSelectBtn();

            // Click on bank select Continue Button
            _bankDetails.ClickBankAccountContBtn();

            // Confirm Bank Details
            _bankDetails.EnterBankDetailsTxt(TestData.BankDetails.DAGbank.BSB, TestData.BankDetails.DAGbank.AccountNumber, TestData.BankDetails.DAGbank.AccountName);

            // Click on Confirm account details Continue Button
            _bankDetails.ClickAcctDetailsBtn();

            // Select Category
            _bankDetails.SelectIncomeCategoryLst(TestData.IncomeCategory.PrimaryIncome);

            // Select Just checking option
            _bankDetails.SelectJustCheckingOptionLst("Yes, it will stay the same (or more)");

            // click on Confirm Income Button
            _bankDetails.ClickConfirmIncomeBtn();

            // select  other debt repayments option No
            _bankDetails.SelectOtherDebtRepaymentsOptionBtn();

            // select dependents
            _bankDetails.SelectDependantsLst(TestData.Dependents.Zero);

            // Click on continue
            _bankDetails.ClickConfirmExpensesBtn();

            // select Governments benefits option No
            _bankDetails.ClickGovtBenefitsOptionLst();

            // click on Agree that information True
            _bankDetails.ClickAgreeAppSubmitBtn();

            // click on confirm Submit button
            _bankDetails.ClickConfirmSummaryBtn();

            // enter sms input as OTP
            _bankDetails.EnterOTPDetailsTxt(TestData.SMSCode);

            // Verify Loan Setup Text displayed
            _LoanSetUpDetails.VerifyDisplayedText();

            // click on Buton Submit
            _LoanSetUpDetails.ClickSubmitBtn();

            //  Scrolling the Loan Contract
            _LoanSetUpDetails.Loancontract();

            // Confirming accepting contract
            _LoanSetUpDetails.ConfirmAcceptingContract();

            // click on I Agree button
            _LoanSetUpDetails.ClickOnAgreeBtn();

            // click on No thanks Button
            _LoanSetUpDetails.ClickNothanksBtn();

            // Click on Loan Dashboard Button
            _LoanSetUpDetails.ClickLoanDashboard();
        }