Protractor tests.
diff --git a/Pages/Accounting b/Pages/Accounting
index f176446..22d8275 100644
--- a/Pages/Accounting
+++ b/Pages/Accounting
@@ -30,7 +30,7 @@
browser.sleep(1000);
},
clickLinkShowForAccountWithName: function(identifier) {
- browser.sleep(1000);
+ browser.sleep(2000);
browser.wait(EC.invisibilityOf($("div[class='md-padding'] h3")), 5000);
browser.wait(EC.textToBePresentInElement($$("tbody tr .td-data-table-cell").last(), "SHOW"), 5000);
$$('tbody tr').filter(function(elem, index) {
diff --git a/Pages/Customers.js b/Pages/Customers.js
index ba6b7d2..be912c5 100644
--- a/Pages/Customers.js
+++ b/Pages/Customers.js
@@ -3,6 +3,8 @@
//Actions specific to the Customers section
var EC = protractor.ExpectedConditions;
+
+//customer creation
var accountInput = $(".mat-input-infix input[placeholder='Account']");
var firstNameInput = $(".mat-input-infix input[formcontrolname='firstName']");
var middleNameInput = $(".mat-input-infix input[formcontrolname='middleName']");
@@ -17,16 +19,30 @@
var mobileInput = $(".mat-input-infix input[formcontrolname='mobile']");
var linkCustomers = $$("a[href='/customers']");
var titleRow = $("fims-layout-card-over .mat-toolbar-row div");
+
+//deposit account assignment
var productSelect = $("md-select[formcontrolname='productIdentifier']");
var beneficiaryInput = $("td-chips[formcontrolname='beneficiaries'] input");
-var primaryButton = $(".mat-raised-button.mat-primary");
+var primaryButton = $$(".mat-raised-button.mat-primary");
var continueButton = $$(".mat-raised-button.mat-accent");
+
+//loan account assignment
var shortNameInput = $("fims-id-input[controlname='identifier'] input");
var principalAmountInput = $("fims-number-input[controlname='principalAmount'] input");
+var interestRateInput = $("fims-number-input[controlname='interest'] input");
var termInput = $("input[formcontrolname='term']");
var paymentPeriod = $("input[formcontrolname='paymentPeriod']");
+//day 1.-30.
+var dayForMonthlyPaymentSelect = $("md-select[formcontrolname='monthSettingDay']");
+//first, second, third, last
+var dayForMonthlyPaymentSelect2 = $$("md-select[formcontrolname='monthSettingDay']").get(1);
+// Monday, Tuesday, ...
+var weekdaySelect = $("md-select[formcontrolname='monthSettingDayInWeek']");
var depositAccountSelect = $("md-select[formcontrolname='depositAccountIdentifier'] .mat-select-trigger");
+//tasks
+var checkboxExecuteTask = $("md-checkbox[title='Execute task']");
+
module.exports = {
verifyCardHasTitleManageCustomers: function () {
@@ -86,11 +102,13 @@
continueButton.get(2).click();
},
clickEnabledCreateCustomerButton: function () {
- browser.executeScript("arguments[0].scrollIntoView();", primaryButton.getWebElement());
- browser.wait(EC.elementToBeClickable(primaryButton), 5000);
- expect(primaryButton.isEnabled()).toBeTruthy();
- browser.wait(EC.elementToBeClickable(primaryButton), 5000);
- primaryButton.click();
+ browser.executeScript("arguments[0].scrollIntoView();", primaryButton.first().getWebElement());
+ browser.wait(EC.elementToBeClickable(primaryButton.first()), 3000);
+ primaryButton.filter(function(elem, index) {
+ return elem.$("span").getText().then(function(text) {
+ return text === "CREATE CUSTOMER";
+ });
+ }).click();
},
clickButtonOrLinkCreateNewCustomer: function () {
browser.wait(EC.visibilityOf($("a[href='/customers/create']")), 5000);
@@ -132,6 +150,11 @@
status = $("fims-state-display .mat-list-text .mat-line").getText();
expect(status).toEqual("ACTIVE");
},
+ verifyLoanAccountHasStatus: function (expectedStatus) {
+ browser.wait(EC.visibilityOf($("fims-state-display")), 2000);
+ status = $("fims-state-display .mat-list-text .mat-line").getText();
+ expect(status).toEqual(expectedStatus);
+ },
clickManageDepositAccountsForCustomer: function (customer) {
link = "/customers/detail/" + customer + "/deposits";
browser.wait(EC.elementToBeClickable($('a[href="' + link + '"]')), 6000);
@@ -160,6 +183,7 @@
browser.executeScript("arguments[0].scrollIntoView();", opt.getWebElement());
browser.wait(EC.elementToBeClickable(opt), 2000);
opt.click();
+ browser.wait(EC.invisibilityOf($("md-tooltip-component")), 3000);
},
clickEnabledButtonCreateDepositAccount: function () {
browser.wait(EC.elementToBeClickable($(".mat-raised-button.mat-primary")), 5000);
@@ -186,7 +210,17 @@
return text === expectedBalance;
});
},
- verifyStateOfDepositAccountWithIdIs: function (identifier, expectedState) {
+ verifyStateOfDepositAccountWithId: function (identifier, expectedState) {
+ browser.wait(EC.visibilityOf($("tbody tr")), 5000);
+ //if > page of entries, need to implement way to page in order to find correct row
+ actualState = $$('tbody tr').filter(function (elem, index) {
+ return elem.$(".td-data-table-cell").getText().then(function (text) {
+ return text === identifier;
+ });
+ }).$$(".td-data-table-cell").get(3).getText();
+ expect(actualState).toEqual(expectedState);
+ },
+ verifyStateOfLoanAccountWithId: function (identifier, expectedState) {
browser.wait(EC.visibilityOf($("tbody tr")), 5000);
//if > page of entries, need to implement way to page in order to find correct row
actualState = $$('tbody tr').filter(function (elem, index) {
@@ -204,10 +238,10 @@
shortNameInput.click().sendKeys(text);
},
enterTextIntoPrincipalAmountInputField: function (text) {
- principalAmountInput.click().sendKeys(protractor.Key.ARROW_LEFT);
- principalAmountInput.sendKeys(protractor.Key.ARROW_LEFT);
- principalAmountInput.sendKeys(protractor.Key.ARROW_LEFT);
- principalAmountInput.sendKeys(protractor.Key.ARROW_LEFT);
+ principalAmountInput.click().sendKeys(protractor.Key.BACK_SPACE);
+ principalAmountInput.sendKeys(protractor.Key.BACK_SPACE);
+ principalAmountInput.sendKeys(protractor.Key.BACK_SPACE);
+ principalAmountInput.sendKeys(protractor.Key.BACK_SPACE);
principalAmountInput.sendKeys(text);
},
enterTextIntoTermInputField: function (text) {
@@ -216,7 +250,7 @@
selectDepositAccount: function (depositAccount) {
browser.executeScript("arguments[0].scrollIntoView();", depositAccountSelect.getWebElement());
browser.wait(EC.visibilityOf(depositAccountSelect), 2000);
- productSelect.click();
+ depositAccountSelect.click();
browser.wait(EC.visibilityOf($(".mat-option")), 5000);
opt = element(by.cssContainingText('.mat-option', depositAccount));
browser.executeScript("arguments[0].scrollIntoView();", opt.getWebElement());
@@ -232,4 +266,63 @@
});
}).click();
},
+ verifyInterestRateSetTo: function(interestRate){
+ expect(interestRateInput.getAttribute("value")).toEqual(interestRate);
+ },
+ verifyInterestRateCannotBeChanged: function(){
+ expect(interestRateInput.isEnabled).toBe(false);
+ },
+ selectDayForMonthlyRepayment: function(day){
+ dayForMonthlyPaymentSelect.click();
+ browser.wait(EC.visibilityOf($(".mat-option")), 5000);
+ opt = element(by.cssContainingText('.mat-option', day));
+ browser.executeScript("arguments[0].scrollIntoView();", opt.getWebElement());
+ browser.wait(EC.elementToBeClickable(opt), 2000);
+ opt.click();
+ },
+ clickLinkTasks: function(){
+ browser.wait(EC.elementToBeClickable($("a[ng-reflect-router-link='./tasks']")), 2000);
+ $("a[ng-reflect-router-link='./tasks']").click();
+ },
+ selectCheckboxToExecuteMandatoryTask: function(){
+ browser.wait(EC.elementToBeClickable(checkboxExecuteTask), 2000);
+ checkboxExecuteTask.click();
+ expect(checkboxExecuteTask.getAttribute("class")).toMatch("mat-checkbox-checked");
+ },
+ verifyCheckboxExecuteTaskIsChecked: function(){
+ browser.wait(EC.visibilityOf(checkboxExecuteTask), 2000);
+ expect(checkboxExecuteTask.getAttribute("class")).toMatch("mat-checkbox-checked");
+ },
+ deselectCheckboxToExecuteMandatoryTask: function(){
+ expect(checkboxExecuteTask.getAttribute("class")).toMatch("mat-checkbox-checked");
+ browser.wait(EC.elementToBeClickable(checkboxExecuteTask), 2000);
+ checkboxExecuteTask.click();
+ },
+ clickButtonForAction: function(action){
+ browser.wait(EC.elementToBeClickable(continueButton.first()), 5000);
+ continueButton.filter(function(elem, index) {
+ return elem.$("span").getText().then(function(text) {
+ return text === action;
+ });
+ }).click();
+ },
+ clickButtonForTransaction: function(action){
+ browser.wait(EC.elementToBeClickable(primaryButton.first()), 3000);
+ primaryButton.filter(function(elem, index) {
+ return elem.$("span").getText().then(function(text) {
+ return text === action;
+ });
+ }).click();
+ },
+ verifyTransactionCharge: function(chargeName, chargeAmount){
+ browser.wait(EC.visibilityOf($("fims-case-command-confirmation-form table tbody")), 2000);
+ browser.sleep(2000);
+ expect($$("fims-case-command-confirmation-form table tbody .td-data-table-row").filter(function(elem, index){
+ return elem.$(".td-data-table-cell").getText().then(function(text){
+ return text === chargeName;
+ });
+ }).$$(".td-data-table-cell").last().getText().then(function(text){
+ return text === chargeAmount;
+ })).toBe(true);
+ }
};
diff --git a/Pages/Loans.js b/Pages/Loans.js
index 57e9d01..8b08bdd 100644
--- a/Pages/Loans.js
+++ b/Pages/Loans.js
@@ -159,6 +159,7 @@
},
enterTextIntoArrearsAllowanceAccountInputField: function(text) {
browser.executeScript("arguments[0].scrollIntoView();", arrearsAllowanceAccountInput.getWebElement());
+ browser.wait(EC.elementToBeClickable(arrearsAllowanceAccountInput), 3000);
arrearsAllowanceAccountInput.click().sendKeys(text);
},
clickEnabledCreateProductButton: function(){
diff --git a/Specs/gate1.js b/Specs/gate1.js
index e05d723..bd34a5e 100644
--- a/Specs/gate1.js
+++ b/Specs/gate1.js
@@ -264,7 +264,7 @@
Common.clickLinkShowForRowWithId(customerAccount);
Customers.clickManageDepositAccountsForCustomer(customerAccount);
//test might be too fast, account still PENDING here and balance 0.00 (but on leaving and coming back, everything as expected)
- Customers.verifyStateOfDepositAccountWithIdIs(depositIdentifier, "ACTIVE");
+ Customers.verifyStateOfDepositAccountWithId(depositIdentifier, "ACTIVE");
Common.clickLinkShowForRowWithId(depositIdentifier);
Customers.verifyDepositAccountHasStatus("ACTIVE");
Customers.verifyDepositAccountBalanceIs("100.00");
@@ -344,116 +344,190 @@
Common.verifyMessagePopupIsDisplayed("Transaction successfully confirmed");
});
it('transaction CWDL should have been booked as expected', function () {
- Accounting.goToAccountingViaSidePanel();
- //verify balance on customer's account is as expected
- Common.clickLinkShowForRowWithId("9000");
- Common.clickLinkShowForRowWithId("9100");
- Accounting.clickLinkShowForAccountWithName(depositName);
- Accounting.verifyAccountInfo("Balance", "48.5");
- Accounting.viewAccountEntriesForAccount(customerAccount + ".9100.00001");
- Accounting.verifyTransactionTypeForRow("DEBIT", 2);
- Accounting.verifyTransactionMessageForRow("CWDL", 2);
- Accounting.verifyTransactionAmountForRow("1.5", 2);
- Accounting.verifyTransactionBalanceForRow("98.5", 2);
- Accounting.verifyTransactionTypeForRow("DEBIT", 3);
- Accounting.verifyTransactionMessageForRow("CWDL", 3);
- Accounting.verifyTransactionAmountForRow("50", 3);
- Accounting.verifyTransactionBalanceForRow("48.5", 3);
- Accounting.goToAccountingViaSidePanel();
- Common.clickLinkShowForRowWithId("7000");
- Common.clickLinkShowForRowWithId("7300");
- Common.clickLinkShowForRowWithId(tellerAccount);
- Accounting.verifyAccountInfo("Balance", "55");
- Accounting.viewAccountEntriesForAccount(tellerAccount);
- Accounting.verifyTransactionTypeForRow("CREDIT", 2);
- Accounting.verifyTransactionMessageForRow("CWDL", 2);
- Accounting.verifyTransactionAmountForRow("50", 2);
- Accounting.verifyTransactionBalanceForRow("55", 2);
- //revenue account - check charges have been booked as expected
- Accounting.goToAccountingViaSidePanel();
- Common.clickLinkShowForRowWithId("1000");
- Common.clickLinkShowForRowWithId("1300");
- Common.clickLinkShowForRowWithId(revenueAccount);
- Accounting.verifyAccountInfo("Balance", "6.5");
- Accounting.viewAccountEntriesForAccount(revenueAccount);
- Accounting.verifyTransactionTypeForRow("CREDIT", 2);
- Accounting.verifyTransactionMessageForRow("CWDL", 2);
- Accounting.verifyTransactionAmountForRow("1.5", 2);
- Accounting.verifyTransactionBalanceForRow("6.5", 2);
+ Accounting.goToAccountingViaSidePanel();
+ //verify balance on customer's account is as expected
+ Common.clickLinkShowForRowWithId("9000");
+ Common.clickLinkShowForRowWithId("9100");
+ Accounting.clickLinkShowForAccountWithName(depositName);
+ Accounting.verifyAccountInfo("Balance", "48.5");
+ Accounting.viewAccountEntriesForAccount(customerAccount + ".9100.00001");
+ Accounting.verifyTransactionTypeForRow("DEBIT", 2);
+ Accounting.verifyTransactionMessageForRow("CWDL", 2);
+ Accounting.verifyTransactionAmountForRow("1.5", 2);
+ Accounting.verifyTransactionBalanceForRow("98.5", 2);
+ Accounting.verifyTransactionTypeForRow("DEBIT", 3);
+ Accounting.verifyTransactionMessageForRow("CWDL", 3);
+ Accounting.verifyTransactionAmountForRow("50", 3);
+ Accounting.verifyTransactionBalanceForRow("48.5", 3);
+ Accounting.goToAccountingViaSidePanel();
+ Common.clickLinkShowForRowWithId("7000");
+ Common.clickLinkShowForRowWithId("7300");
+ Common.clickLinkShowForRowWithId(tellerAccount);
+ Accounting.verifyAccountInfo("Balance", "55");
+ Accounting.viewAccountEntriesForAccount(tellerAccount);
+ Accounting.verifyTransactionTypeForRow("CREDIT", 2);
+ Accounting.verifyTransactionMessageForRow("CWDL", 2);
+ Accounting.verifyTransactionAmountForRow("50", 2);
+ Accounting.verifyTransactionBalanceForRow("55", 2);
+ //revenue account - check charges have been booked as expected
+ Accounting.goToAccountingViaSidePanel();
+ Common.clickLinkShowForRowWithId("1000");
+ Common.clickLinkShowForRowWithId("1300");
+ Common.clickLinkShowForRowWithId(revenueAccount);
+ Accounting.verifyAccountInfo("Balance", "6.5");
+ Accounting.viewAccountEntriesForAccount(revenueAccount);
+ Accounting.verifyTransactionTypeForRow("CREDIT", 2);
+ Accounting.verifyTransactionMessageForRow("CWDL", 2);
+ Accounting.verifyTransactionAmountForRow("1.5", 2);
+ Accounting.verifyTransactionBalanceForRow("6.5", 2);
});
it('create a loan product', function () {
- Loans.goToLoanProductsViaSidePanel();
- Loans.clickButtonCreateLoanProduct();
- Loans.enterTextIntoShortNameInputField(loanShortName);
- Loans.enterTextIntoNameInputField("My loan " + loanShortName);
- Loans.enterTextIntoDescriptionInputField("My loan " + loanShortName);
- Loans.enterTextIntoMinimumPrincipalInputField("200");
- Loans.enterTextIntoMaximumPrincipalInputField("1000");
- Loans.enterTextIntoTermInputField("12");
- Loans.clickEnabledContinueButtonForProductDetails();
- Loans.enterTextIntoCashAccountInputField(tellerAccount);
- Loans.enterTextIntoLoanInProcessLedgerInputField("8100");
- Loans.enterTextIntoCustomerLoanLedgerInputField("7900");
- Loans.enterTextIntoPendingDisbursalAccountInputField("7013");
- Loans.clickEnabledContinueButtonForLedgerAndAccountSettings("7810");
- Loans.enterTextIntoInterestMinimumInputField("3.50");
- Loans.enterTextIntoIncomeAccountAccountInputField(revenueAccount);
- Loans.enterTextIntoAccrualAccountInputField("7015");
- Loans.clickEnabledContinueButtonForInterestSettings();
- Loans.enterTextIntoProcessingFeeIncomeAccountInputField("1312");
- Loans.enterTextIntoOriginatingFeeIncomeAccountInputField("1310");
- Loans.enterTextIntoDisbursementFeeIncomeAccountInputField("1390");
- Loans.enterTextIntoLateFeeIncomeAccountInputField("1311");
- Loans.enterTextIntoLateFeeAccrualAccountInputField("7840");
- Loans.clickEnabledContinueButtonForFeeIncomeAccounts("");
- Loans.enterTextIntoArrearsAllowanceAccountInputField("3040");
- Loans.clickEnabledCreateProductButton();
- Common.verifyMessagePopupIsDisplayed("Product is going to be saved");
+ Loans.goToLoanProductsViaSidePanel();
+ Loans.clickButtonCreateLoanProduct();
+ Loans.enterTextIntoShortNameInputField(loanShortName);
+ Loans.enterTextIntoNameInputField("My loan " + loanShortName);
+ Loans.enterTextIntoDescriptionInputField("My loan " + loanShortName);
+ Loans.enterTextIntoMinimumPrincipalInputField("200");
+ Loans.enterTextIntoMaximumPrincipalInputField("1000");
+ Loans.enterTextIntoTermInputField("12");
+ Loans.clickEnabledContinueButtonForProductDetails();
+ Loans.enterTextIntoCashAccountInputField(tellerAccount);
+ Loans.enterTextIntoLoanInProcessLedgerInputField("8100");
+ Loans.enterTextIntoCustomerLoanLedgerInputField("7900");
+ Loans.enterTextIntoPendingDisbursalAccountInputField("7013");
+ Loans.clickEnabledContinueButtonForLedgerAndAccountSettings("7810");
+ Loans.enterTextIntoInterestMinimumInputField("3.50");
+ Loans.enterTextIntoIncomeAccountAccountInputField(revenueAccount);
+ Loans.enterTextIntoAccrualAccountInputField("7015");
+ Loans.clickEnabledContinueButtonForInterestSettings();
+ Loans.enterTextIntoProcessingFeeIncomeAccountInputField("1312");
+ Loans.enterTextIntoOriginatingFeeIncomeAccountInputField("1310");
+ Loans.enterTextIntoDisbursementFeeIncomeAccountInputField("1390");
+ Loans.enterTextIntoLateFeeIncomeAccountInputField("1311");
+ Loans.enterTextIntoLateFeeAccrualAccountInputField("7840");
+ Loans.clickEnabledContinueButtonForFeeIncomeAccounts("");
+ Loans.enterTextIntoArrearsAllowanceAccountInputField("3040");
+ Loans.clickEnabledCreateProductButton();
+ Common.verifyMessagePopupIsDisplayed("Product is going to be saved");
});
it('should edit charges', function (){
- Common.clickLinkShowForRowWithId(loanShortName);
- Loans.clickLinkManageFeesForLoanProduct(loanShortName);
- Common.clickLinkShowForRowWithId("processing-fee");
- Loans.clickButtonEditProcessingFeeForLoanProduct(loanShortName);
- Loans.enterTextIntoFeeAmountInputField("3");
- Loans.clickEnabledUpdateChargeButton();
- Common.verifyMessagePopupIsDisplayed("Charge is going to be saved");
- Common.clickBackButtonInTitleBar();
- Common.clickBackButtonInTitleBar();
+ Common.clickLinkShowForRowWithId(loanShortName);
+ Loans.clickLinkManageFeesForLoanProduct(loanShortName);
+ Common.clickLinkShowForRowWithId("processing-fee");
+ Loans.clickButtonEditProcessingFeeForLoanProduct(loanShortName);
+ Loans.enterTextIntoFeeAmountInputField("3");
+ Loans.clickEnabledUpdateChargeButton();
+ Common.verifyMessagePopupIsDisplayed("Charge is going to be saved");
+ Common.clickBackButtonInTitleBar();
+ Common.clickBackButtonInTitleBar();
});
it('should add task', function () {
- Loans.clickLinkManageTasksForLoanProduct(loanShortName);
- Loans.clickButtonCreateTaskForLoanProduct(loanShortName);
- Loans.enterTextIntoTaskIdentifierInputField(taskIdentifier);
- Loans.enterTextIntoTaskNameInputField("Loan opening task");
- Loans.enterTextIntoTaskDescriptionInputField("Loan opening task - mandatory");
- Loans.checkMandatoryCheckbox();
- Loans.clickButtonAddAction();
- Loans.selectSecondAction("can be approved");
- Loans.clickEnabledCreateTaskButton();
- Common.verifyMessagePopupIsDisplayed("Task is going to be created");
- Common.clickBackButtonInTitleBar();
+ Loans.clickLinkManageTasksForLoanProduct(loanShortName);
+ Loans.clickButtonCreateTaskForLoanProduct(loanShortName);
+ Loans.enterTextIntoTaskIdentifierInputField(taskIdentifier);
+ Loans.enterTextIntoTaskNameInputField("Loan opening task");
+ Loans.enterTextIntoTaskDescriptionInputField("Loan opening task - mandatory");
+ Loans.checkMandatoryCheckbox();
+ Loans.clickButtonAddAction();
+ Loans.selectSecondAction("can be approved");
+ Loans.clickEnabledCreateTaskButton();
+ Common.verifyMessagePopupIsDisplayed("Task is going to be created");
+ Common.clickBackButtonInTitleBar();
});
it('should enable the loan product', function () {
- Loans.clickButtonEnableProduct();
- Common.verifyMessagePopupIsDisplayed("Product is going to be enabled");
+ Loans.clickButtonEnableProduct();
+ Common.verifyMessagePopupIsDisplayed("Product is going to be enabled");
});
it('should assign loan product to customer', function () {
- Customers.goToManageCustomersViaSidePanel();
- Common.clickSearchButtonToMakeSearchInputFieldAppear();
- Common.enterTextInSearchInputFieldAndApplySearch(customerAccount);
- Common.verifyFirstRowOfSearchResultHasTextAsId(customerAccount);
- Common.clickLinkShowForRowWithId(customerAccount);
- Customers.clickManageLoanAccountsForCustomer(customerAccount);
- Customers.clickCreateLoanAccountForCustomer(customerAccount);
- Customers.selectProduct("My loan " + loanShortName);
- Customers.enterTextIntoShortNameInputField(loanAccountShortName);
- Customers.enterTextIntoPrincipalAmountInputField("5000");
- //verify interest rate as expected and cannot be changed; currently always 0.00 (bug)
- Customers.enterTextIntoTermInputField("12");
- //verify correct radio button selected
- Customers.selectDepositAccount(customerAccount + ".9100.00001(" + depositIdentifier + ")");
- Customers.clickEnabledCreateCustomerButton();
- Common.verifyMessagePopupIsDisplayed("Case is going to be saved");
+ Customers.goToManageCustomersViaSidePanel();
+ Common.clickSearchButtonToMakeSearchInputFieldAppear();
+ Common.enterTextInSearchInputFieldAndApplySearch(customerAccount);
+ Common.verifyFirstRowOfSearchResultHasTextAsId(customerAccount);
+ Common.clickLinkShowForRowWithId(customerAccount);
+ Customers.clickManageLoanAccountsForCustomer(customerAccount);
+ Customers.clickCreateLoanAccountForCustomer(customerAccount);
+ Customers.selectProduct("My loan " + loanShortName);
+ Customers.enterTextIntoShortNameInputField(loanAccountShortName);
+ Customers.enterTextIntoPrincipalAmountInputField("5000");
+ //verify interest rate as expected and cannot be changed
+ Customers.verifyInterestRateSetTo("3.50");
+ //Customers.verifyInterestRateCannotBeChanged();
+ Customers.enterTextIntoTermInputField("12");
+ //verify correct radio button for repay period selected, BUG
+ Customers.selectDayForMonthlyRepayment("3.");
+ Customers.selectDepositAccount(customerAccount + ".9100.00001(" + depositIdentifier + ")");
+ Customers.clickEnabledCreateCustomerLoanButton();
+ Common.verifyMessagePopupIsDisplayed("Case is going to be saved");
+ Customers.verifyStateOfLoanAccountWithId(loanAccountShortName, "CREATED");
+ });
+ it('should open the loan account - mandatory task', function () {
+ Common.clickLinkShowForRowWithId(loanAccountShortName);
+ Customers.clickLinkTasks();
+ Customers.selectCheckboxToExecuteMandatoryTask();
+ Customers.clickButtonForAction("OPEN");
+ Customers.verifyTransactionCharge("processing-fee", "150.00");
+ Customers.clickButtonForTransaction("OPEN");
+ Common.verifyMessagePopupIsDisplayed("Case is going to be updated");
+ Customers.verifyLoanAccountHasStatus("PENDING");
+ });
+ it('should approve the loan account', function () {
+ Customers.clickLinkTasks();
+ Customers.clickButtonForAction("APPROVE");
+ Customers.verifyTransactionCharge("loan-origination-fee", "50.00");
+ Customers.clickButtonForTransaction("APPROVE");
+ Common.verifyMessagePopupIsDisplayed("Case is going to be updated");
+ Customers.verifyLoanAccountHasStatus("APPROVED");
+ });
+ it('should disburse the loan', function () {
+ Customers.clickLinkTasks();
+ Customers.clickButtonForAction("DISBURSE");
+ Customers.verifyTransactionCharge("disbursement-fee", "05.00");
+ Customers.clickButtonForTransaction("DISBURSE");
+ Common.verifyMessagePopupIsDisplayed("Case is going to be updated");
+ Customers.verifyLoanAccountHasStatus("ACTIVE");
+ });
+ it('transaction should have been booked as expected', function () {
+ Accounting.goToAccountingViaSidePanel();
+ Accounting.clickLinkShowForAccountWithName("1000");
+ Accounting.clickLinkShowForAccountWithName("1300");
+ Accounting.clickLinkShowForAccountWithName("1312");
+ Accounting.viewAccountEntriesForAccount("1312");
+ Accounting.verifyTransactionTypeForRow("CREDIT", 1);
+ Accounting.verifyTransactionAmountForRow("150", 1);
+ Accounting.verifyTransactionBalanceForRow("150", 1);
+ Common.clickBackButtonInTitleBar();
+ Common.clickBackButtonInTitleBar();
+ Accounting.clickLinkShowForAccountWithName("1310");
+ Accounting.viewAccountEntriesForAccount("1310");
+ Accounting.verifyTransactionTypeForRow("CREDIT", 1);
+ Accounting.verifyTransactionAmountForRow("50", 1);
+ Accounting.verifyTransactionBalanceForRow("50", 1);
+ Common.clickBackButtonInTitleBar();
+ Common.clickBackButtonInTitleBar();
+ Accounting.clickLinkShowForAccountWithName("1313");
+ Accounting.viewAccountEntriesForAccount("1313");
+ Accounting.verifyTransactionTypeForRow("CREDIT", 1);
+ Accounting.verifyTransactionAmountForRow("5", 1);
+ Accounting.verifyTransactionBalanceForRow("5", 1);
+ Common.clickBackButtonInTitleBar();
+ Common.clickBackButtonInTitleBar();
+ Common.clickBackButtonInTitleBar();
+ Common.clickBackButtonInTitleBar();
+ Accounting.clickLinkShowForAccountWithName("9000");
+ Accounting.clickLinkShowForAccountWithName("9100");
+ Accounting.clickLinkShowForAccountWithName(depositName);
+ Accounting.viewAccountEntriesForAccount(depositName);
+ Accounting.verifyTransactionTypeForRow("DEBIT", 4);
+ Accounting.verifyTransactionAmountForRow("150", 4);
+ Accounting.verifyTransactionBalanceForRow("101.5", 4);
+ Accounting.verifyTransactionTypeForRow("DEBIT", 5);
+ Accounting.verifyTransactionAmountForRow("50", 5);
+ Accounting.verifyTransactionBalanceForRow("-151.5", 5);
+ Accounting.verifyTransactionTypeForRow("DEBIT", 6);
+ Accounting.verifyTransactionAmountForRow("5", 6);
+ Accounting.verifyTransactionBalanceForRow("-156.5", 6);
+ Accounting.verifyTransactionTypeForRow("CREDIT", 7);
+ Accounting.verifyTransactionAmountForRow("5000", 7);
+ Accounting.verifyTransactionBalanceForRow("4843.5", 7);
});
});
\ No newline at end of file