Protractor tests.
diff --git a/Pages/Accounting b/Pages/Accounting
index b5e9a72..a9212ec 100644
--- a/Pages/Accounting
+++ b/Pages/Accounting
@@ -240,6 +240,16 @@
expect($$("table tbody tr").get(row - 1).$$(".td-data-table-cell").get(1).getText()).toEqual(account);
expect($$("table tbody tr").get(row - 1).$$(".td-data-table-cell").get(2).getText()).toEqual(amount);
},
+ verifyAccountHasBeenCreditedWithAmount: function(account, amount) {
+ browser.wait(EC.visibilityOf($("table tbody")), 3000);
+ expect($$("table tbody tr .td-data-table-cell").filter(function(elem, index) {
+ return elem.getText().then(function(text) {
+ return text === account;
+ });
+ }).first().element(by.xpath("..")).$$(".td-data-table-cell").last().getText().then(function(text){
+ return text == amount;
+ })).toBe(true);
+ },
verifyClerkForJournalEntryIs: function (clerk){
expect($$("md-card .mat-list-text h3").filter(function(elem, index) {
return elem.getText().then(function(text) {
@@ -300,7 +310,7 @@
}).click();
},
enterTextIntoDebitAccountNameInputField: function(text) {
- browser.wait(EC.visibilityOf(debitAccountInput), 5000);
+ browser.wait(EC.elementToBeClickable(debitAccountInput), 5000);
debitAccountInput.click().sendKeys(text);
},
enterTextIntoDebitAmountInputField: function(text) {
@@ -316,6 +326,7 @@
creditAmountInput.click().sendKeys(text);
},
clickButtonCreateJournalEntry: function(){
+ browser.wait(EC.elementToBeClickable(primaryButton.get(0)), 5000);
primaryButton.filter(function(elem, index) {
return elem.$("span").getText().then(function(text) {
return text === "CREATE JOURNAL ENTRY";
diff --git a/Pages/Customers.js b/Pages/Customers.js
index 37ce250..fa9a628 100644
--- a/Pages/Customers.js
+++ b/Pages/Customers.js
@@ -2,6 +2,7 @@
//Actions specific to the Customers section
+var Common = require('./Common.js');
var EC = protractor.ExpectedConditions;
//create customer
@@ -55,6 +56,22 @@
var continueButton = $$(".mat-raised-button.mat-accent");
module.exports = {
+ createNewMember: function (customerAccount, firstName, lastName, dayOfBirth, street, city, country ) {
+ this.clickButtonOrLinkCreateNewMember();
+ Common.verifyCardHasTitle("Create new member");
+ this.enterTextIntoAccountInputField(customerAccount);
+ this.enterTextIntoFirstNameInputField(firstName);
+ this.enterTextIntoLastNameInputField(lastName);
+ this.enterTextIntoDayOfBirthInputField(dayOfBirth);
+ this.clickEnabledContinueButtonForMemberDetails();
+ this.enterTextIntoStreetInputField(street);
+ this.enterTextIntoCityInputField(city);
+ this.selectCountryByName(country);
+ this.clickEnabledContinueButtonForMemberAddress();
+ this.clickEnabledCreateMemberButton();
+ Common.verifyMessagePopupIsDisplayed("Member is going to be saved");
+ Common.verifyCardHasTitle("Manage members");
+ },
enterTextIntoAccountInputField: function (text) {
browser.wait(EC.visibilityOf(accountInput), 3000);
accountInput.click().sendKeys(text);
@@ -90,29 +107,29 @@
enterTextIntoMobileInputField: function (text) {
mobileInput.click().sendKeys(text);
},
- clickEnabledContinueButtonForCustomerDetails: function () {
+ clickEnabledContinueButtonForMemberDetails: function () {
browser.wait(EC.elementToBeClickable(continueButton.get(0)), 5000);
expect(continueButton.get(0).isEnabled()).toBeTruthy();
continueButton.get(0).click();
},
- clickEnabledContinueButtonForCustomerAddress: function () {
+ clickEnabledContinueButtonForMemberAddress: function () {
browser.wait(EC.elementToBeClickable(continueButton.get(1)), 5000);
expect(continueButton.get(1).isEnabled()).toBeTruthy();
continueButton.get(1).click();
},
- clickEnabledContinueButtonForCustomerContact: function () {
+ clickEnabledContinueButtonForMemberContact: function () {
browser.wait(EC.elementToBeClickable(continueButton.get(2)), 5000);
expect(continueButton.get(2).isEnabled()).toBeTruthy();
continueButton.get(2).click();
},
- clickEnabledCreateCustomerButton: function () {
+ clickEnabledCreateMemberButton: function () {
browser.executeScript("arguments[0].scrollIntoView();", primaryButton.first().getWebElement());
browser.wait(EC.elementToBeClickable(primaryButton.first()), 5000);
expect(primaryButton.first().isEnabled()).toBeTruthy();
browser.wait(EC.elementToBeClickable(primaryButton.first()), 5000);
primaryButton.first().click();
},
- clickButtonOrLinkCreateNewCustomer: function () {
+ clickButtonOrLinkCreateNewMember: function () {
browser.wait(EC.visibilityOf($("a[href='/customers/create']")), 5000);
$("a[href='/customers/create']").click();
},
diff --git a/Pages/Offices.js b/Pages/Offices.js
index 32231d7..ac6f9f5 100644
--- a/Pages/Offices.js
+++ b/Pages/Offices.js
@@ -1,5 +1,5 @@
//Offices.js
-var Common = require('../Pages/Common.js');
+var Common = require('./Common.js');
//office creation
var officeIdentifierInput = $(".mat-input-infix input[placeholder='Identifier']");
diff --git a/Pages/Payroll.js b/Pages/Payroll.js
index 0253dbb..bf4090a 100644
--- a/Pages/Payroll.js
+++ b/Pages/Payroll.js
@@ -30,6 +30,7 @@
amountInput.get(allocationNumber-1).click().clear().sendKeys(text);
},
clickButtonAddAllocations: function(){
+ browser.sleep(200);
buttons.filter(function(elem, index) {
return elem.$("span").getText().then(function(text) {
return text === "Add allocation";
@@ -76,7 +77,18 @@
browser.wait(EC.visibilityOf($(".mat-option")), 5000);
element(by.cssContainingText('.mat-option', accountIdentifier)).click();
},
+ selectAllocationAccountFromOpenList: function(accountIdentifier){
+ browser.wait(EC.visibilityOf($(".mat-option")), 5000);
+ element(by.cssContainingText('.mat-option', accountIdentifier)).click();
+ },
+ verifyAccountNotOfferedForSelection: function(accountIdentifier, allocationNumber){
+ browser.wait(EC.elementToBeClickable(allocationAccountSelect.get(allocationNumber-1)), 3000);
+ allocationAccountSelect.get(allocationNumber-1).click();
+ browser.wait(EC.visibilityOf($(".mat-option")), 5000);
+ expect(element(by.cssContainingText('.mat-option', accountIdentifier)).isPresent()).toBe(false);
+ },
selectMainAccount: function(accountIdentifier){
+ browser.sleep(500);
browser.executeScript("arguments[0].scrollIntoView();", mainAccountSelect.getWebElement());
browser.wait(EC.elementToBeClickable(mainAccountSelect), 3000);
mainAccountSelect.click();
@@ -179,4 +191,8 @@
}).toBe(true);
}));
},
+ verifyErrorIsDisplayedIfSameAccountSelectedTwice: function() {
+ browser.wait(EC.textToBePresentInElement($(".tc-red-600"),"Allocation accounts can't use main account or overlap with other allocation accounts."), 2000);
+ expect($(".tc-red-600").getText()).toMatch("Allocation accounts can't use main account or overlap with other allocation accounts.");
+ },
};
\ No newline at end of file
diff --git a/Specs/cheque_management.js b/Specs/cheque_management.js
index 64f037e..aee5663 100644
--- a/Specs/cheque_management.js
+++ b/Specs/cheque_management.js
@@ -109,19 +109,19 @@
it('should create customer and activate customer', function () {
Customers.goToManageCustomersViaSidePanel();
Common.verifyCardHasTitle("Manage members");
- Customers.clickButtonOrLinkCreateNewCustomer();
+ Customers.clickButtonOrLinkCreateNewMember();
Common.verifyCardHasTitle("Create new member");
Customers.enterTextIntoAccountInputField(customerAccount);
Customers.enterTextIntoFirstNameInputField("Thomas");
Customers.enterTextIntoLastNameInputField("Pynchon");
Customers.enterTextIntoDayOfBirthInputField("9211978");
Customers.verifyIsMemberCheckboxSelected();
- Customers.clickEnabledContinueButtonForCustomerDetails();
+ Customers.clickEnabledContinueButtonForMemberDetails();
Customers.enterTextIntoStreetInputField("800 Chatham Road #326");
Customers.enterTextIntoCityInputField("Winston-Salem");
Customers.selectCountryByName("Germany");
- Customers.clickEnabledContinueButtonForCustomerAddress();
- Customers.clickEnabledCreateCustomerButton();
+ Customers.clickEnabledContinueButtonForMemberAddress();
+ Customers.clickEnabledCreateMemberButton();
Common.verifyMessagePopupIsDisplayed("Member is going to be saved")
Common.verifyCardHasTitle("Manage members");
Common.clickSearchButtonToMakeSearchInputFieldAppear();
@@ -331,19 +331,19 @@
it('should create another customer', function () {
Customers.goToManageCustomersViaSidePanel();
Common.verifyCardHasTitle("Manage members");
- Customers.clickButtonOrLinkCreateNewCustomer();
+ Customers.clickButtonOrLinkCreateNewMember();
Common.verifyCardHasTitle("Create new member");
Customers.enterTextIntoAccountInputField(customerAccount2);
Customers.enterTextIntoFirstNameInputField("Cormac");
Customers.enterTextIntoLastNameInputField("McCarthy");
Customers.enterTextIntoDayOfBirthInputField("7281958");
Customers.verifyIsMemberCheckboxSelected();
- Customers.clickEnabledContinueButtonForCustomerDetails();
+ Customers.clickEnabledContinueButtonForMemberDetails();
Customers.enterTextIntoStreetInputField("800 Chatham Road #326");
Customers.enterTextIntoCityInputField("Winston-Salem");
Customers.selectCountryByName("Germany");
- Customers.clickEnabledContinueButtonForCustomerAddress();
- Customers.clickEnabledCreateCustomerButton();
+ Customers.clickEnabledContinueButtonForMemberAddress();
+ Customers.clickEnabledCreateMemberButton();
Common.verifyMessagePopupIsDisplayed("Member is going to be saved")
Common.verifyCardHasTitle("Manage members");
Common.clickSearchButtonToMakeSearchInputFieldAppear();
diff --git a/Specs/cheque_management_from_scratch.js b/Specs/cheque_management_from_scratch.js
index 0b86e6c..8e0425e 100644
--- a/Specs/cheque_management_from_scratch.js
+++ b/Specs/cheque_management_from_scratch.js
@@ -134,19 +134,19 @@
it('should create customer and activate customer', function () {
Customers.goToManageCustomersViaSidePanel();
Common.verifyCardHasTitle("Manage members");
- Customers.clickButtonOrLinkCreateNewCustomer();
+ Customers.clickButtonOrLinkCreateNewMember();
Common.verifyCardHasTitle("Create new member");
Customers.enterTextIntoAccountInputField(customerAccount);
Customers.enterTextIntoFirstNameInputField("Thomas");
Customers.enterTextIntoLastNameInputField("Pynchon");
Customers.enterTextIntoDayOfBirthInputField("9211978");
Customers.verifyIsMemberCheckboxSelected();
- Customers.clickEnabledContinueButtonForCustomerDetails();
+ Customers.clickEnabledContinueButtonForMemberDetails();
Customers.enterTextIntoStreetInputField("800 Chatham Road #326");
Customers.enterTextIntoCityInputField("Winston-Salem");
Customers.selectCountryByName("Germany");
- Customers.clickEnabledContinueButtonForCustomerAddress();
- Customers.clickEnabledCreateCustomerButton();
+ Customers.clickEnabledContinueButtonForMemberAddress();
+ Customers.clickEnabledCreateMemberButton();
Common.verifyMessagePopupIsDisplayed("Member is going to be saved")
Common.verifyCardHasTitle("Manage members");
Common.clickSearchButtonToMakeSearchInputFieldAppear();
@@ -356,19 +356,19 @@
it('should create another customer', function () {
Customers.goToManageCustomersViaSidePanel();
Common.verifyCardHasTitle("Manage members");
- Customers.clickButtonOrLinkCreateNewCustomer();
+ Customers.clickButtonOrLinkCreateNewMember();
Common.verifyCardHasTitle("Create new member");
Customers.enterTextIntoAccountInputField(customerAccount2);
Customers.enterTextIntoFirstNameInputField("Cormac");
Customers.enterTextIntoLastNameInputField("McCarthy");
Customers.enterTextIntoDayOfBirthInputField("7281958");
Customers.verifyIsMemberCheckboxSelected();
- Customers.clickEnabledContinueButtonForCustomerDetails();
+ Customers.clickEnabledContinueButtonForMemberDetails();
Customers.enterTextIntoStreetInputField("800 Chatham Road #326");
Customers.enterTextIntoCityInputField("Winston-Salem");
Customers.selectCountryByName("Germany");
- Customers.clickEnabledContinueButtonForCustomerAddress();
- Customers.clickEnabledCreateCustomerButton();
+ Customers.clickEnabledContinueButtonForMemberAddress();
+ Customers.clickEnabledCreateMemberButton();
Common.verifyMessagePopupIsDisplayed("Member is going to be saved")
Common.verifyCardHasTitle("Manage members");
Common.clickSearchButtonToMakeSearchInputFieldAppear();
diff --git a/Specs/custom_fields_members.js b/Specs/custom_fields_members.js
index 4b1b702..76885fd 100644
--- a/Specs/custom_fields_members.js
+++ b/Specs/custom_fields_members.js
@@ -172,20 +172,20 @@
Common.clickBackButtonInTitleBar();
});
it('should create member', function () {
- Customers.clickButtonOrLinkCreateNewCustomer();
+ Customers.clickButtonOrLinkCreateNewMember();
Common.verifyCardHasTitle("Create new member");
Customers.enterTextIntoAccountInputField(customerAccount);
Customers.enterTextIntoFirstNameInputField("Thomas");
Customers.enterTextIntoLastNameInputField("Pynchon");
Customers.enterTextIntoDayOfBirthInputField("9211978");
Customers.verifyIsMemberCheckboxSelected();
- Customers.clickEnabledContinueButtonForCustomerDetails();
+ Customers.clickEnabledContinueButtonForMemberDetails();
Customers.enterTextIntoStreetInputField("800 Chatham Road #326");
Customers.enterTextIntoCityInputField("Winston-Salem");
Customers.selectCountryByName("Germany");
- Customers.clickEnabledContinueButtonForCustomerAddress();
+ Customers.clickEnabledContinueButtonForMemberAddress();
Customers.enterTextIntoEmailInputField("nds@yahoo.de");
- Customers.clickEnabledContinueButtonForCustomerContact();
+ Customers.clickEnabledContinueButtonForMemberContact();
Customers.goToStepCustomFields();
CustomFields.verifyCustomFieldsTitle("My custom fields #2");
//CREATE MEMBER disabled if no radio button selected (mandatory field); bug
@@ -210,7 +210,7 @@
Customers.verifyButtonCreateMemberDisabled();
CustomFields.enterTextIntoCustomFieldOfTypeNumber("1", identifier2);
Customers.verifyButtonCreateMemberEnabled();
- Customers.clickEnabledCreateCustomerButton();
+ Customers.clickEnabledCreateMemberButton();
Common.verifyMessagePopupIsDisplayed("Member is going to be saved")
});
//should it be able to update/delete fields once in use???
diff --git a/Specs/gate1.js b/Specs/gate1.js
index 91d0796..3aaa9f6 100644
--- a/Specs/gate1.js
+++ b/Specs/gate1.js
@@ -153,19 +153,19 @@
it('should be able to create customer', function () {
Customers.goToManageCustomersViaSidePanel();
Common.verifyCardHasTitle("Manage members");
- Customers.clickButtonOrLinkCreateNewCustomer();
+ Customers.clickButtonOrLinkCreateNewMember();
Common.verifyCardHasTitle("Create new member");
Customers.enterTextIntoAccountInputField(customerAccount);
Customers.enterTextIntoFirstNameInputField("Thomas");
Customers.enterTextIntoLastNameInputField("Pynchon");
Customers.enterTextIntoDayOfBirthInputField("9211978");
Customers.verifyIsMemberCheckboxSelected();
- Customers.clickEnabledContinueButtonForCustomerDetails();
+ Customers.clickEnabledContinueButtonForMemberDetails();
Customers.enterTextIntoStreetInputField("800 Chatham Road #326");
Customers.enterTextIntoCityInputField("Winston-Salem");
Customers.selectCountryByName("Germany");
- Customers.clickEnabledContinueButtonForCustomerAddress();
- Customers.clickEnabledCreateCustomerButton();
+ Customers.clickEnabledContinueButtonForMemberAddress();
+ Customers.clickEnabledCreateMemberButton();
Common.verifyMessagePopupIsDisplayed("Member is going to be saved");
Common.verifyCardHasTitle("Manage members");
Common.clickSearchButtonToMakeSearchInputFieldAppear();
diff --git a/Specs/payrolls.js b/Specs/payrolls.js
index dbfccde..3e613e6 100644
--- a/Specs/payrolls.js
+++ b/Specs/payrolls.js
@@ -17,6 +17,7 @@
describe('payrolls', function() {
var EC = protractor.ExpectedConditions;
employeeIdentifier = helper.getRandomString(6);
+ entryIdentifier = helper.getRandomString(6);
customerAccount = helper.getRandomString(5);
customerAccount2 = helper.getRandomString(5);
depositIdentifier = helper.getRandomString(5);
@@ -69,7 +70,7 @@
Accounting.goToAccountingViaSidePanel();
Accounting.goToJournalEntries();
Accounting.clickButtonAddJournalEntry();
- Accounting.enterTextIntoTransactionIdentifierInputField("Money for payroll");
+ Accounting.enterTextIntoTransactionIdentifierInputField(entryIdentifier);
Accounting.enterTextIntoTransactionTypeInputFieldAndSelectMatchingEntry("ACCT");
Accounting.clickButtonContinue();
Accounting.enterTextIntoDebitAccountNameInputField(payrollAccount);
@@ -77,30 +78,30 @@
Accounting.enterTextIntoCreditAccountNameInputField("1290");
Accounting.enterTextIntoCreditAmountInputField("100000");
Accounting.clickButtonCreateJournalEntry();
+ Common.verifyMessagePopupIsDisplayed("Journal entry is going to be processed");
});
- it('should be able to create customer', function () {
+ it('should be able to create customers', function () {
Customers.goToManageCustomersViaSidePanel();
Common.verifyCardHasTitle("Manage members");
- Customers.clickButtonOrLinkCreateNewCustomer();
+ Customers.clickButtonOrLinkCreateNewMember();
Common.verifyCardHasTitle("Create new member");
Customers.enterTextIntoAccountInputField(customerAccount);
Customers.enterTextIntoFirstNameInputField("Samuel");
Customers.enterTextIntoLastNameInputField("Beckett");
Customers.enterTextIntoDayOfBirthInputField("9211978");
- Customers.clickEnabledContinueButtonForCustomerDetails();
+ Customers.clickEnabledContinueButtonForMemberDetails();
Customers.enterTextIntoStreetInputField("800 Chatham Road #326");
Customers.enterTextIntoCityInputField("Winston-Salem");
Customers.selectCountryByName("Germany");
- Customers.clickEnabledContinueButtonForCustomerAddress();
- Customers.clickEnabledCreateCustomerButton();
- Common.verifyMessagePopupIsDisplayed("Member is going to be saved")
+ Customers.clickEnabledContinueButtonForMemberAddress();
+ Customers.clickEnabledCreateMemberButton();
+ Common.verifyMessagePopupIsDisplayed("Member is going to be saved");
Common.verifyCardHasTitle("Manage members");
+ Customers.createNewMember(customerAccount2, "Nina", "Delvos", "7112002", "Mulholland Road 1234", "City of Angels", "United States of America");
+ //ToDo: verify you cannot set up payroll distribution for member that is not active yet; add here once ATEN-478 has been fixed
Common.clickSearchButtonToMakeSearchInputFieldAppear();
Common.enterTextInSearchInputFieldAndApplySearch(customerAccount);
- Common.verifyFirstRowOfSearchResultHasTextAsId(customerAccount);
Common.clickLinkShowForFirstRowInTable();
- Customers.verifyMemberHasStatusInactive();
- //ToDo: verify you cannot set up payroll distribution for member that is not active yet; add here
Customers.clickButtonGoToTasks();
Customers.clickButtonActivate();
Common.verifyMessagePopupIsDisplayed("Command is going to be executed");
@@ -292,9 +293,10 @@
Customers.clickPayrollForMember(customerAccount);
Payroll.clickButtonEditPayrollDistribution(customerAccount);
Payroll.clickButtonAddAllocations();
+ //allocation account is the same as main account
Payroll.selectAllocationAccountForAllocation(customerAccount + ".9100.00001", 1);
Payroll.enterTextIntoAmountInputFieldForAllocation("1200", 1);
- //not possible, error
+ Payroll.verifyErrorIsDisplayedIfSameAccountSelectedTwice();
Payroll.verifyButtonUpdateAllocationsDisabled();
Payroll.selectAllocationAccountForAllocation(customerAccount + ".9100.00002", 1);
Payroll.verifyButtonUpdateAllocationsEnabled();
@@ -331,9 +333,8 @@
Accounting.verifyClerkForJournalEntryIs(employeeIdentifier);
Accounting.verifyNoteForJournalEntryIs("Payroll Distribution");
Accounting.verifyAccountHasBeenDebitedWithAmountInRow(payrollAccount, "2,000.00", 1);
- //order might change here
- Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".9100.00001", "800.00", 2);
- Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".9100.00002", "1,200.00", 3);
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00001", "800.00");
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00002", "1,200.00");
});
it('should update payroll allocation for member to proportional', function () {
Customers.goToManageCustomersViaSidePanel();
@@ -344,7 +345,7 @@
Customers.clickPayrollForMember(customerAccount);
Payroll.clickButtonEditPayrollDistribution(customerAccount);
Payroll.checkCheckboxProportionalForAllocation(1);
- Payroll.enterTextIntoAmountInputFieldForAllocation("40.9", 1);
+ Payroll.enterTextIntoAmountInputFieldForAllocation("40.8", 1);
Payroll.verifyButtonUpdateAllocationsEnabled();
Payroll.clickButtonUpdateAllocations("Payroll is going to be saved");
});
@@ -375,7 +376,7 @@
Payroll.verifyEmployerForPaymentInRow("Ballast Point", 2);
Payroll.verifySalaryForPaymentInRow("450", 2);
});
- it('verify transaction has been booked as expected', function () {
+ it('verify transaction has been booked as expected - main account & one allocation, proportional', function () {
//journal entry
Accounting.goToAccountingViaSidePanel();
Accounting.goToJournalEntries();
@@ -386,7 +387,7 @@
Accounting.verifyClerkForJournalEntryIs(employeeIdentifier);
Accounting.verifyNoteForJournalEntryIs("Payroll Distribution");
Accounting.verifyAccountHasBeenDebitedWithAmountInRow(payrollAccount, "1,000.00", 1);
- //ToDo: Why still not changed?
+ //ToDo: ATEN-477
// Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".9100.00001", "591.00", 2);
// Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".9100.00001", "409.00", 3);
// Accounting.clickJournalEntry(4);
@@ -414,7 +415,13 @@
Customers.clickPayrollForMember(customerAccount);
Payroll.clickButtonEditPayrollDistribution(customerAccount);
Payroll.clickButtonAddAllocations();
- //ToDo: check pending deposit account should not be offered for selection
+ Payroll.verifyButtonUpdateAllocationsDisabled();
+ Payroll.verifyAccountNotOfferedForSelection(customerAccount + ".9100.00003", 2);
+ //same allocation account selected
+ Payroll.selectAllocationAccountFromOpenList(customerAccount + ".9100.00002");
+ Payroll.verifyErrorIsDisplayedIfSameAccountSelectedTwice();
+ Payroll.clickButtonRemoveAllocation(2);
+ Payroll.verifyButtonUpdateAllocationsEnabled();
//open account
Teller.goToTellerManagementViaSidePanel();
Teller.enterTextIntoSearchInputField(customerAccount);
@@ -476,12 +483,11 @@
Accounting.verifyClerkForJournalEntryIs(employeeIdentifier);
Accounting.verifyNoteForJournalEntryIs("Payroll Distribution");
Accounting.verifyAccountHasBeenDebitedWithAmountInRow(payrollAccount, "888.88", 1);
- //order might change here
- Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".9100.00003", "400.00", 2);
- Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".9100.00002", "270.00", 3);
- Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".9100.00001", "218.88", 4);
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00001", "218.88");
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00002", "270.00");
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00003", "400.00");
});
- it('should update payroll allocation for member - three accounts', function () {
+ it('should update payroll allocation for member - main account & two allocations (not proportional)', function () {
Customers.goToManageCustomersViaSidePanel();
Common.clickSearchButtonToMakeSearchInputFieldAppear();
Common.enterTextInSearchInputFieldAndApplySearch(customerAccount);
@@ -527,19 +533,115 @@
Accounting.verifyClerkForJournalEntryIs(employeeIdentifier);
Accounting.verifyNoteForJournalEntryIs("Payroll Distribution");
Accounting.verifyAccountHasBeenDebitedWithAmountInRow(payrollAccount, "3,000.00", 1);
- //order might change here
- Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".9100.00003", "25.50", 2);
- Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".9100.00002", "2,600.00", 3);
- Accounting.verifyAccountHasBeenCreditedWithAmountInRow(customerAccount + ".9100.00001", "374.50", 4);
- browser.pause();
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00001", "374.50");
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00002", "2,600.00");
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00003", "25.50");
});
- //allocations - three accounts, mixed
- //same deposit account selected twice, not possible
- //pending/closed dep account
- //payment smaller than amounts for allocations
- //allocations exceeding 100% (proportional)
- //payment just enough for allocations
+ it('should update payroll allocation for member - main account & two allocations (mixed)', function () {
+ Customers.goToManageCustomersViaSidePanel();
+ Common.clickSearchButtonToMakeSearchInputFieldAppear();
+ Common.enterTextInSearchInputFieldAndApplySearch(customerAccount);
+ Common.verifyFirstRowOfSearchResultHasTextAsId(customerAccount);
+ Common.clickLinkShowForRowWithId(customerAccount);
+ Customers.clickPayrollForMember(customerAccount);
+ Payroll.clickButtonEditPayrollDistribution(customerAccount);
+ Payroll.checkCheckboxProportionalForAllocation(2);
+ Payroll.enterTextIntoAmountInputFieldForAllocation("50", 2);
+ Payroll.verifyButtonUpdateAllocationsEnabled();
+ Payroll.clickButtonUpdateAllocations("Payroll is going to be saved");
+ });
+ it('should pay salary - main account & 2 allocation (mixed) - sufficient payment', function () {
+ Accounting.goToAccountingViaSidePanel();
+ Accounting.goToPayrolls();
+ Payroll.clickButtonCreatePayroll();
+ Payroll.enterTextIntoFromAccountInputFieldForPayment(payrollAccount);
+ Payroll.enterTextIntoMemberInputFieldForPayment(customerAccount, 1);
+ Payroll.enterTextIntoEmployerInputFieldForPayment("Deschutes", 1);
+ Payroll.enterTextIntoSalaryInputFieldForPayment("6000", 1);
+ Payroll.clickCreatePaymentsButton();
+ Common.verifyMessagePopupIsDisplayed("Payroll is going to be created");
+ Common.clickLinkShowForFirstRowInTable();
+ //verify details
+ Payroll.verifyMemberIDForPaymentInRow(customerAccount, 1);
+ Payroll.verifyEmployerForPaymentInRow("Deschutes", 1);
+ Payroll.verifySalaryForPaymentInRow("6000", 1);
+ });
+ it('should pay salary - main account & 2 allocation (mixed) - exactly enough for allocations', function () {
+ Accounting.goToAccountingViaSidePanel();
+ Accounting.goToPayrolls();
+ Payroll.clickButtonCreatePayroll();
+ Payroll.enterTextIntoFromAccountInputFieldForPayment(payrollAccount);
+ Payroll.enterTextIntoMemberInputFieldForPayment(customerAccount, 1);
+ Payroll.enterTextIntoEmployerInputFieldForPayment("Deschutes 2", 1);
+ Payroll.enterTextIntoSalaryInputFieldForPayment("5200", 1);
+ Payroll.clickCreatePaymentsButton();
+ Common.verifyMessagePopupIsDisplayed("Payroll is going to be created");
+ Common.clickLinkShowForFirstRowInTable();
+ //verify details
+ Payroll.verifyMemberIDForPaymentInRow(customerAccount, 1);
+ Payroll.verifyEmployerForPaymentInRow("Deschutes 2", 1);
+ Payroll.verifySalaryForPaymentInRow("5200", 1);
+ });
+ it('should pay salary - main account & 2 allocation (mixed) - insufficient payment', function () {
+ Accounting.goToAccountingViaSidePanel();
+ Accounting.goToPayrolls();
+ Payroll.clickButtonCreatePayroll();
+ Payroll.enterTextIntoFromAccountInputFieldForPayment(payrollAccount);
+ Payroll.enterTextIntoMemberInputFieldForPayment(customerAccount, 1);
+ Payroll.enterTextIntoEmployerInputFieldForPayment("Deschutes 3", 1);
+ Payroll.enterTextIntoSalaryInputFieldForPayment("5000", 1);
+ Payroll.clickCreatePaymentsButton();
+ Common.verifyMessagePopupIsDisplayed("Payroll is going to be created");
+ Common.clickLinkShowForFirstRowInTable();
+ //verify details
+ Payroll.verifyMemberIDForPaymentInRow(customerAccount, 1);
+ Payroll.verifyEmployerForPaymentInRow("Deschutes 3", 1);
+ Payroll.verifySalaryForPaymentInRow("5000", 1);
+ });
+ it('verify transaction has been booked as expected - sufficient payment', function () {
+ //journal entry
+ Accounting.goToAccountingViaSidePanel();
+ Accounting.goToJournalEntries();
+ Accounting.enterTextIntoSearchAccountInputField(customerAccount + ".9100.00003");
+ Accounting.clickSearchButton();
+ Accounting.verifyFourthJournalEntry("Payroll/Salary Payment", "Amount: 6,000.00");
+ Accounting.clickJournalEntry(4);
+ Accounting.verifyClerkForJournalEntryIs(employeeIdentifier);
+ Accounting.verifyNoteForJournalEntryIs("Payroll Distribution");
+ Accounting.verifyAccountHasBeenDebitedWithAmountInRow(payrollAccount, "6,000.00", 1);
+ //order might change here
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00003", "3,000.00");
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00002", "2,600.00");
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00001", "400.00");
+ });
+ it('verify transaction has been booked as expected - payment exactly covering allocations', function () {
+ //journal entry
+ Accounting.goToAccountingViaSidePanel();
+ Accounting.goToJournalEntries();
+ Accounting.enterTextIntoSearchAccountInputField(customerAccount + ".9100.00003");
+ Accounting.clickSearchButton();
+ Accounting.verifyFifthJournalEntry("Payroll/Salary Payment", "Amount: 5,200.00");
+ Accounting.clickJournalEntry(5);
+ Accounting.verifyClerkForJournalEntryIs(employeeIdentifier);
+ Accounting.verifyNoteForJournalEntryIs("Payroll Distribution");
+ Accounting.verifyAccountHasBeenDebitedWithAmountInRow(payrollAccount, "5,200.00", 1);
+ //order might change here
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00002", "2,600.00");
+ Accounting.verifyAccountHasBeenCreditedWithAmount(customerAccount + ".9100.00003", "2,600.00");
+ });
+ // it('verify transaction has been booked as expected - payment insufficient to cover allocations', function () {
+ // //journal entry
+ // //ToDo: no journal entry exists, payment has not been made though created: ATEN-457
+ // Accounting.goToAccountingViaSidePanel();
+ // Accounting.goToJournalEntries();
+ // Accounting.enterTextIntoSearchAccountInputField(customerAccount + ".9100.00003");
+ // Accounting.clickSearchButton();
+ // Accounting.clickJournalEntry(6);
+ // Accounting.verifyClerkForJournalEntryIs(employeeIdentifier);
+ // Accounting.verifyNoteForJournalEntryIs("Payroll Distribution");
+ // Accounting.verifyAccountHasBeenDebitedWithAmountInRow(payrollAccount, "5,000.00", 1);
+ // });
+ //closed dep account already selected for payroll; ATEN-461
+ //allocations exceeding 100% (proportional); same behavior as above (ATEN-457)
//several payments at once (same member/different members)
- //loan account apparently too now
-
});
\ No newline at end of file
diff --git a/Specs/teller_management.js b/Specs/teller_management.js
index 210e4a2..3fedd2e 100644
--- a/Specs/teller_management.js
+++ b/Specs/teller_management.js
@@ -70,18 +70,18 @@
it('should be able to create customer', function () {
Customers.goToManageCustomersViaSidePanel();
Common.verifyCardHasTitle("Manage members");
- Customers.clickButtonOrLinkCreateNewCustomer();
+ Customers.clickButtonOrLinkCreateNewMember();
Common.verifyCardHasTitle("Create new member");
Customers.enterTextIntoAccountInputField(customerAccount);
Customers.enterTextIntoFirstNameInputField("Samuel");
Customers.enterTextIntoLastNameInputField("Beckett");
Customers.enterTextIntoDayOfBirthInputField("9211978");
- Customers.clickEnabledContinueButtonForCustomerDetails();
+ Customers.clickEnabledContinueButtonForMemberDetails();
Customers.enterTextIntoStreetInputField("800 Chatham Road #326");
Customers.enterTextIntoCityInputField("Winston-Salem");
Customers.selectCountryByName("Germany");
- Customers.clickEnabledContinueButtonForCustomerAddress();
- Customers.clickEnabledCreateCustomerButton();
+ Customers.clickEnabledContinueButtonForMemberAddress();
+ Customers.clickEnabledCreateMemberButton();
Common.verifyMessagePopupIsDisplayed("Member is going to be saved")
Common.verifyCardHasTitle("Manage members");
});