Exemplo n.º 1
0
        public void TC071_VerifyConfirmPage_NL(int loanamout, string strmobiledevice)
        {
            strUserType = "NL";
            try
            {
                _driver             = _testengine.TestSetup(strmobiledevice, "NL");
                _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");

                //Go to the homepage and click the start application button
                _homeDetails.HomeDetailsPage();

                //Select the loan amount and purpose and click on continue button
                _loanPurposeDetails.LoanPurposeFunction(loanamout, TestData.POL.Households);

                //populate the personal details and proceed
                _personalDetails.PersonalDetailsFunction();

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

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

                // Entering Username and Password
                _bankDetails.EnterBankCredentialsTxt(TestData.BankDetails.AUTOTriggerAllNoSACC.Yodlee.UID, TestData.BankDetails.AUTOTriggerAllNoSACC.Yodlee.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();

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

                // Select Category
                _bankDetails.SelectIncomecategory(TestData.IncomeCategory.PrimaryIncome, "0");

                // 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.ClickNoGovtBenefitsbtn();

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

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

                if (loanamout > 2000)
                {
                    // enter sms input as OTP
                    _bankDetails.EnterOTPDetailsTxt(TestData.SMSCode);
                }

                // if (loanamout > 2000 && FinalReviewEnabled == "true")
                if ((loanamout > 2000 && FinalReviewEnabled == "true") && (strUserType == FinalReviewLoanType || FinalReviewLoanType == "ALL"))
                {
                    if (GetPlatform(_driver))
                    {
                        //ClickOn Loan Dashboard...Manual Approval
                        _loanSetUpDetails.ClickLoanDashboardManual();

                        // click on More Button from Bottom Menu
                        _loanSetUpDetails.ClickMoreBtn();

                        // click on Approve button
                        _loanSetUpDetails.ClickApproveBtn();

                        //Click Setup Button
                        _bankDetails.ClickSetup();

                        // Verify ApprovedAmount
                        Assert.IsTrue(_loanSetUpDetails.VerifyApprovedLoan(loanamout),
                                      "Expected Requested Amount : " + loanamout + ". Observed Approved Amount : " +
                                      _loanSetUpDetails.GetApprovedamount());

                        // click on Buton Submit
                        _loanSetUpDetails.ClickSubmitBtn();
                    }
                    else
                    {
                        //ClickOn Loan Dashboard...Manual Approval
                        _loanSetUpDetails.ClickLoanDashboardManual();

                        //click on Final Approve
                        _loanSetUpDetails.FinalApprove();

                        //Click Setup Button
                        _bankDetails.ClickSetup();

                        // Verify ApprovedAmount
                        Assert.IsTrue(_loanSetUpDetails.VerifyApprovedLoan(loanamout),
                                      "Expected Requested Amount : " + loanamout + ". Observed Approved Amount : " +
                                      _loanSetUpDetails.GetApprovedamount());

                        // click on Buton Submit
                        _loanSetUpDetails.ClickSubmitBtn();
                    }
                }
                else
                {
                    // Verify ApprovedAmount
                    Assert.IsTrue(_loanSetUpDetails.VerifyApprovedLoan(loanamout),
                                  "Expected Requested Amount : " + loanamout + ". Observed Approved Amount : " +
                                  _loanSetUpDetails.GetApprovedamount());

                    // click on Buton Submit
                    _loanSetUpDetails.ClickSubmitBtn();
                }

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

                // Confirming accepting contract and purpose
                _loanSetUpDetails.PartialConfirmAcceptingContractwithcontractandpurpose();

                // verify I agree Button not displayed
                Assert.IsTrue(!_loanSetUpDetails.VerifyAgreeBtnDisplay(),
                              "Expected  : " + "I Agree Buttton Not displaying" + ". Observed : " +
                              "I Agree Buttton Not displaying");

                // Confirming accepting contract and repay
                _loanSetUpDetails.PartialConfirmAcceptingContractwithcontractandrepay();

                // verify I agree Button not displayed
                Assert.IsTrue(!_loanSetUpDetails.VerifyAgreeBtnDisplay(),
                              "Expected  : " + "I Agree Buttton Not displaying" + ". Observed : " +
                              "I Agree Buttton Not displaying");

                // Confirming accepting purpose and repay
                _loanSetUpDetails.PartialConfirmAcceptingContractwithpurposeandrepay();

                // verify I agree Button not displayed
                Assert.IsTrue(!_loanSetUpDetails.VerifyAgreeBtnDisplay(),
                              "Expected  : " + "I Agree Buttton Not displaying" + ". Observed : " +
                              "I Agree Buttton Not displaying");

                // Confirming complete acceptance
                _loanSetUpDetails.CompleteConfirmAcceptingContract();

                // verify I agree Button displayed
                Assert.IsTrue(_loanSetUpDetails.VerifyAgreeBtnDisplay(),
                              "Expected  : " + "I Agree Buttton displaying" + ". Observed : " +
                              "I Agree Buttton displaying");

                // Unconfirm one of the acceptance
                _loanSetUpDetails.UnConfirmAcceptingLoanContract();

                // verify I agree Button displayed
                Assert.IsTrue(!_loanSetUpDetails.VerifyAgreeBtnDisplay(),
                              "Expected  : " + "I Agree Buttton Not displaying" + ". Observed : " +
                              "I Agree Buttton Not displaying");

                // Confirming complete acceptance
                _loanSetUpDetails.CompleteConfirmAcceptingContract();

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

                if (GetPlatform(_driver))
                {
                    // Click on To Loan Dashboard Button
                    _loanSetUpDetails.ClickMobileLoanDashboardBtn();

                    // click on More Button from Bottom Menu
                    _loanSetUpDetails.ClickMoreBtn();

                    //Logout
                    _loanSetUpDetails.Logout();

                    strMessage += string.Format("\r\n\t Ends");
                }
                else
                {
                    // Click on Loan Dashboard Button
                    _loanSetUpDetails.ClickLoanDashboard();

                    //Logout
                    _loanSetUpDetails.Logout();
                    strMessage += string.Format("\r\n\t Ends");
                }

                #region "Commented code as there is change in functionality"
                //// verify warning unconfirmed acceptance message
                //string unconfirmcontractmsg = _loanSetUpDetails.getunconfirmedcontractmsg();
                //string actualunconfirmcontractmsg = "You must accept the terms and conditions to proceed.";
                //Assert.AreEqual(unconfirmcontractmsg, actualunconfirmcontractmsg, "unconfirm contract message matched");

                //// Unconfirm one of the acceptance
                //_loanSetUpDetails.UnConfirmAcceptingpurpose();

                //// verify I agree Button displayed
                //Assert.IsTrue(!_loanSetUpDetails.VerifyAgreeBtnDisplay(),
                //    "Expected  : " + "I Agree Buttton Not displaying" + ". Observed : " +
                //    "I Agree Buttton Not displaying");

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

                //// verify warning unconfirmed acceptance message
                //string unconfirmpurposemsg = _loanSetUpDetails.getunconfirmedpurposemsg();
                //string actualunconfirmpurposemsg = "Please confirm this loan amount meets your selected loan purpose(s)";
                //Assert.AreEqual(unconfirmpurposemsg, actualunconfirmpurposemsg, "unconfirm purpose message matched");

                //// Unconfirm one of the acceptance
                //_loanSetUpDetails.UnConfirmAcceptingrepay();

                //// verify I agree Button displayed
                //Assert.IsTrue(_loanSetUpDetails.VerifyAgreeBtnDisplay(),
                //    "Expected  : " + "I Agree Buttton displaying" + ". Observed : " +
                //    "I Agree Buttton displaying");

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

                //// verify warning unconfirmed acceptance message
                //string unconfirmrepaymsg = _loanSetUpDetails.getunconfirmedrepaymsg();
                //string actualunconfirmrepaymsg = "You must confirm that you are able to repay this loan.";
                //Assert.AreEqual(unconfirmrepaymsg, actualunconfirmrepaymsg, "unconfirm repay message matched");
                #endregion
            }
            catch (Exception ex)
            {
                strMessage += ex.Message; Assert.Fail(ex.Message);
            }
        }