Skip to content
Permalink
Browse files
Protractor tests. Loan product/account tests.
  • Loading branch information
ndelvos78 committed Oct 27, 2017
1 parent 3630fce commit a107b54904a42bfaeab94e2c1373f33a3f24a585
Showing 5 changed files with 34 additions and 14 deletions.
@@ -173,7 +173,7 @@ module.exports = {
//Journal entries
enterTextIntoSearchAccountInputField: function(account) {
browser.wait(EC.visibilityOf(accountSearchInputField), 5000);
accountSearchInputField.click().sendKeys(account);
accountSearchInputField.clear().click().sendKeys(account);
},
clickSearchButton: function(){
$$("button").filter(function(elem, index) {
@@ -213,6 +213,7 @@ module.exports = {
browser.sleep(500);
},
verifyThirdJournalEntry: function(transactionType, transactionAmount){
browser.sleep(500);
expect($$("fims-layout-card-over .mat-list-item .mat-list-text p").get(4).getText().then(function(text){
return text === transactionType;
})).toBe(true);
@@ -132,7 +132,6 @@ module.exports = {
browser.executeScript("arguments[0].scrollIntoView();", depositAccountSelect.getWebElement());
browser.wait(EC.elementToBeClickable(depositAccountSelect), 3000);
depositAccountSelect.click();
expect($(".mat-option").isPresent()).toBe(true);
expect(element(by.cssContainingText('.mat-option', accountIdentifier)).isPresent()).toBe(false);
},
enterTextIntoTermInputField: function (text) {
@@ -633,16 +632,16 @@ module.exports = {
expect($("a[title='Edit document']").isPresent()).toBe(false);
},
verifyDocumentCanBeDeleted: function(){
expect($("a[title='Delete document']").isPresent()).toBe(true);
expect($("button[title='Delete document']").isPresent()).toBe(true);
},
verifyDocumentCannotBeDeleted: function(){
expect($("a[title='Delete document']").isPresent()).toBe(false);
expect($("button[title='Delete document']").isPresent()).toBe(false);
},
clickButtonEditDocument: function(){
$("a[title='Edit document']").click();
},
clickButtonDeleteDocument: function(){
$("a[title='Delete document']").click();
$("button[title='Delete document']").click();
},
clickButtonLock: function(){
buttons.filter(function(elem, index) {
@@ -324,6 +324,7 @@ module.exports = {
return text === action;
});
}).click();
browser.sleep(300);
},
goToStepCustomFields: function(){
browser.sleep(100);
@@ -359,5 +359,7 @@ module.exports = {
verifyEditLoanProductButtonIsNotDisplayed: function(){
browser.sleep(500);
expect($("a[title='Edit product']").isPresent()).toBe(false);
}
},
//ranges

};
@@ -639,9 +639,9 @@ describe('Loans 1', function() {
//second loan repayment
Teller.clickOnRepayLoanForCustomer(customerAccount);
Teller.selectLoanAccountToBeAffected(customerAccount + ".clp.00001(" + loanShortName2 + ")");
Teller.enterTextIntoAmountInputField("5");
Teller.enterTextIntoAmountInputField("10");
Teller.clickEnabledCreateTransactionButton();
Teller.verifyTransactionAmount("5");
Teller.verifyTransactionAmount("10");
Teller.verifyTransactionCharge("repay-principal", "9.5");
Teller.verifyTransactionCharge("repay-fees", "0.5");
Teller.clickEnabledConfirmTransactionButton();
@@ -656,10 +656,26 @@ describe('Loans 1', function() {
Teller.verifyTransactionCharge("repay-principal", "490.5");
Teller.clickEnabledConfirmTransactionButton();
Common.verifyMessagePopupIsDisplayed("Transaction successfully confirmed");
//journal entry; 10 towards the fees
//journal entry; 0.5 towards fees and rest towards principal
//journal entry
//ToDO: loan should no longer be offered for selection once repaid
//ToDo: loan should no longer be offered for selection once repaid
Accounting.goToAccountingViaSidePanel();
Accounting.goToJournalEntries();
Accounting.enterTextIntoSearchAccountInputField(customerAccount + ".clf.00002");
Accounting.clickSearchButton();
Accounting.verifySecondJournalEntry("Principal Payment", "Amount: 10.00");
Accounting.clickSecondJournalEntry();
Accounting.verifyAccountHasBeenDebitedWithAmountInRow(tellerAccount, "10.00", 1);
Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".clf.00002", "10.00", 2);
Accounting.verifyThirdJournalEntry("Principal Payment", "Amount: 10.00");
Accounting.clickThirdJournalEntry();
Accounting.verifyAccountHasBeenDebitedWithAmountInRow(tellerAccount, "10.00", 1);
Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".clf.00002", "0.50");
Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".clp.00001", "9.50");
Accounting.enterTextIntoSearchAccountInputField(customerAccount + ".clp.00001");
Accounting.clickSearchButton();
Accounting.verifyThirdJournalEntry("Principal Payment", "Amount: 490.50");
Accounting.clickThirdJournalEntry();
Accounting.verifyAccountHasBeenDebitedWithAmountInRow(tellerAccount, "490.50", 1);
Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".clp.00001", "490.50", 2);
//close loan and verify action "Repay loan" is no longer offered
Customers.goToManageCustomersViaSidePanel();
Common.clickSearchButtonToMakeSearchInputFieldAppear();
@@ -669,8 +685,8 @@ describe('Loans 1', function() {
Customers.clickManageLoanAccountsForMember(customerAccount);
Common.clickLinkShowForFirstRowInTable();
CustomerLoans.goToTasksForCustomerLoan(customerAccount, loanShortName2, loanAccountShortName);
Customers.clickButtonForTask("CLOSE");
Customers.clickButtonForTask("CLOSE");
CustomerLoans.clickButtonForTask("CLOSE");
CustomerLoans.clickButtonForTask("CLOSE");
Common.verifyMessagePopupIsDisplayed("Case is going to be updated");
CustomerLoans.verifyLoanStatusIs("CLOSED");
Common.clickBackButtonInTitleBar();
@@ -680,6 +696,7 @@ describe('Loans 1', function() {
Teller.verifyActionRepayLoanNotOfferedForCustomer(customerAccount);
}),
it('update/deletion of unassigned/assigned product', function () {
browser.pause();
//assigned product cannot be deleted anymore
//what about disabled/edited?
//disable assigned product & check customer loan account: ATEN-475

0 comments on commit a107b54

Please sign in to comment.