Skip to content
Permalink
Browse files
Protractor tests. Loan product tests.
  • Loading branch information
ndelvos78 committed Oct 20, 2017
1 parent 2f6b481 commit 094546fb6f2b667f402bdc664514fd4975a325f4
Showing 2 changed files with 40 additions and 8 deletions.
@@ -57,6 +57,11 @@ module.exports = {
browser.wait(EC.visibilityOf($('a[href="' + link + '"]')));
$('a[href="' + link + '"]').click();
},
clickUpdateLoanAccountForMember: function (customer,loanProduct, loanAccount) {
link = "/customers/detail/" + customer + "/loans/products/" + loanProduct + "/detail/" + loanAccount + "/edit";
browser.wait(EC.visibilityOf($('a[href="' + link + '"]')));
$('a[href="' + link + '"]').click();
},
selectProduct: function (productName) {
browser.sleep(2000);
browser.wait(EC.elementToBeClickable(productSelect), 3000);
@@ -358,9 +363,28 @@ module.exports = {
browser.wait(EC.elementToBeClickable($('a[href="' + link + '"]')), 6000);
$('a[href="' + link + '"]').click();
},
viewDebtIncomeReportForCustomerLoan: function(customer, loanProduct, loanAccount){
link = "/customers/detail/" + customer + "/loans/products/" + loanProduct + "/detail/" + loanAccount + "/debtIncome";
browser.wait(EC.elementToBeClickable($('a[href="' + link + '"]')), 6000);
viewDebtIncomeReportForCustomerLoan: function(customer, productIdentifier, accountIdentifier){
link = "/customers/detail/" + customer + "/loans/products/" + productIdentifier + "/detail/" + accountIdentifier + "/tasks";
browser.wait(EC.elementToBeClickable($('a[href="' + link + '"]')), 5000);
$('a[href="' + link + '"]').click();
browser.wait(EC.visibilityOf($("fims-layout-card-over")), 2000);
},
verifyPrincipalForLoanAccountInRow: function(principalAmount, row){
browser.wait(EC.visibilityOf($("table tbody")), 3000);
expect($$("table tbody tr").get(row - 1).$$(".td-data-table-cell").get(1).getText()).toEqual(principalAmount);
},
verifyInterestForLoanAccountInRow: function(interest, row){
browser.wait(EC.visibilityOf($("table tbody")), 3000);
expect($$("table tbody tr").get(row - 1).$$(".td-data-table-cell").get(2).getText()).toEqual(interest);
},
verifyCurrentStatusForLoanAccountInRow: function(status, row){
browser.wait(EC.visibilityOf($("table tbody")), 3000);
expect($$("table tbody tr").get(row - 1).$$(".td-data-table-cell").get(3).getText()).toEqual(status);
},
verifyMemberRatioIs:function (text){
expect($$("mat-tab-header div[role='tab']").get(0).getText()).toMatch("Member(Ratio: " + text + ")");
},
verifyCoSignerRatioIs:function (text){
expect($$("mat-tab-header div[role='tab']").get(1).getText()).toEqual("Co-signer(Ratio: " + text + ")");
}
};
@@ -418,9 +418,9 @@ describe('Loans 1', function() {
CustomerLoans.verifyDebtIncomeRatioIs("01.50");
//browser.pause();
CustomerLoans.goToStepCoSigner();
//co-signer
//co-signer, need another member
//CustomerLoans.enterTextIntoMemberInputField();
//documents
//documents, cannot do much since I cannot upload documents via test
CustomerLoans.goToStepDocuments();
//still error for payment period
CustomerLoans.verifyButtonCreateMemberLoanDisabled();
@@ -431,18 +431,26 @@ describe('Loans 1', function() {
Common.verifyMessagePopupIsDisplayed("Case is going to be saved");
Customers.verifyStateOfLoanAccountWithIdIs(loanAccountShortName, "CREATED");
//details
CustomerLoans.verifyPrincipalForLoanAccountInRow("1500", 1);
CustomerLoans.verifyInterestForLoanAccountInRow("15", 1);
CustomerLoans.verifyCurrentStatusForLoanAccountInRow("CREATED", 1);
Common.clickLinkShowForRowWithId(loanAccountShortName);
//details

});
it('planned payment', function () {
CustomerLoans.viewPlannedPaymentForCustomerLoan(customerAccount, loanShortName, loanAccountShortName);
//CustomerLoans.viewPlannedPaymentForCustomerLoan(customerAccount, loanShortName, loanAccountShortName);
//error, ATEN-474
});
it('debt/income ratio', function () {
CustomerLoans.viewDebtIncomeReportForCustomerLoan(customerAccount, loanShortName, loanAccountShortName);
CustomerLoans.viewDebtIncomeReportForCustomerLoan(customerAccount, loanShortName2, loanAccountShortName);
CustomerLoans.verifyMemberRatioIs("01.50");
CustomerLoans.verifyCoSignerRatioIs(" -");
Common.clickBackButtonInTitleBar();
});
it('editing loan account possible until approved', function () {
it('should be able to edit loan account until it has been approved', function () {
CustomerLoans.clickUpdateLoanAccountForMember(customerAccount, loanShortName2, loanAccountShortName);
//browser.pause();
//edit loan account to different one (different product, different settings)
//planned payment
//...

0 comments on commit 094546f

Please sign in to comment.