ATEN-384: Protractor tests - Cheque management
diff --git a/Pages/Accounting b/Pages/Accounting
index d9f11f1..204176e 100644
--- a/Pages/Accounting
+++ b/Pages/Accounting
@@ -153,6 +153,7 @@
         }).click();
     },
     verifyFirstJournalEntry: function(transactionType, transactionAmount){
+        browser.sleep(500);
         expect($$("fims-layout-card-over .mat-list-item .mat-list-text p").first().getText().then(function(text){
             return text === transactionType;
         })).toBe(true);
@@ -175,5 +176,14 @@
         expect($$("fims-layout-card-over .mat-list-item .mat-list-text p").get(5).getText().then(function(text){
             return text === transactionAmount;
         })).toBe(true);
+    },
+    verifyFourthJournalEntry: function(transactionType, transactionAmount){
+        browser.sleep(500);
+        expect($$("fims-layout-card-over .mat-list-item .mat-list-text p").get(6).getText().then(function(text){
+            return text === transactionType;
+        })).toBe(true);
+        expect($$("fims-layout-card-over .mat-list-item .mat-list-text p").get(7).getText().then(function(text){
+            return text === transactionAmount;
+        })).toBe(true);
     }
 };
\ No newline at end of file
diff --git a/Pages/Cheques.js b/Pages/Cheques.js
index 283cd58..3dbd536 100644
--- a/Pages/Cheques.js
+++ b/Pages/Cheques.js
@@ -21,6 +21,7 @@
 
 module.exports = {
     enterTextIntoChequeNumberInputField: function(text) {
+        browser.executeScript("arguments[0].scrollIntoView();", chequeNumberInput.getWebElement());
         browser.wait(EC.visibilityOf(chequeNumberInput), 5000);
         chequeNumberInput.click().sendKeys(text);
     },
@@ -70,6 +71,9 @@
     verifyWarningIsDisplayedIfIssuingBankCouldNotBeDetermined: function(){
         browser.wait(EC.visibilityOf(warningIssuingBankIssuerCouldNotBeDetermined), 2000);
     },
+    verifyWarningIsNotDisplayedIfIssuingBankCouldBeDetermined: function(){
+        browser.wait(EC.invisibilityOf(warningIssuingBankIssuerCouldNotBeDetermined), 2000);
+    },
     verifyPayeeHasTextAndCannotBeChanged: function(customerName){
         expect(payeeInput.getAttribute("value")).toEqual(customerName);
         expect(payeeInput.isEnabled()).toBe(false);
@@ -79,6 +83,18 @@
         dateIssuedInput.sendKeys(protractor.Key.ARROW_LEFT);
         dateIssuedInput.sendKeys(date);
     },
+    verifyIssuingBankHasText: function(issuingBank){
+        expect(issuingBankInput.getAttribute("value")).toEqual(issuingBank);
+    },
+    verifyIssuingBankHasError: function(){
+       expect(issuingBankInput.element(by.xpath("..")).element(by.xpath("..")).element(by.xpath("..")).$("md-error").getText()).toEqual("Required");
+    },
+    verifyIssuerHasText: function(issuer){
+        expect(issuerInput.getAttribute("value")).toEqual(issuer);
+    },
+    verifyIssuerHasError: function(){
+        expect(issuerInput.element(by.xpath("..")).element(by.xpath("..")).element(by.xpath("..")).$("md-error").getText()).toEqual("Required");
+    },
     checkCheckboxIsChequeOpen: function(){
        checkboxIsChequeOpen.click();
     },
@@ -227,4 +243,12 @@
             });
         }).click();
     },
+    verifyErrorMessageDisplayedWithTitleAndText: function(title, message){
+        browser.wait(EC.visibilityOf($("td-alert-dialog")), 2000);
+        expect($("td-dialog-title").getText()).toEqual(title);
+        expect($("td-dialog-content").getText()).toEqual(message);
+    },
+    clickButtonOKInErrorMessage: function(){
+        $("td-dialog-actions button").click();
+    }
 };
\ No newline at end of file
diff --git a/Specs/cheque_management.js b/Specs/cheque_management.js
index d4a80d5..7855b0d 100644
--- a/Specs/cheque_management.js
+++ b/Specs/cheque_management.js
@@ -1,3 +1,8 @@
+//Prerequisites:
+//Role "Administrator" and headquarter office already exist
+//No tasks need to be executed in order to activate a customer
+//ToDo: Figure out which roles best to use for which kind of actions instead of using employee with "Administrator" role
+
 var helper = require('../helper.js');
 var Login = require('../Pages/Login.js');
 var Employees = require('../Pages/Employees.js');
@@ -30,21 +35,6 @@
     branchSortCode = helper.getRandomString(11);
     branchSortCode2 = helper.getRandomString(11);
 
-    //what role would be best in order to clear cheques and verify correctness of bookings?
-
-    it('should create a new administrator role', function () {
-        Common.waitForThePageToFinishLoading();
-        Roles.clickCreateNewRoleFromQuickAccess();
-        Roles.enterTextIntoRoleIdentifierInput("Administrator");
-        Roles.verifyCardHasTitleCreateRole();
-        Roles.selectCheckboxToGiveUserAllPermissions();
-        Roles.clickEnabledSaveRoleButton();
-        Common.verifyMessagePopupIsDisplayed("Role is going to be saved");
-        Roles.verifyCardHasTitleManageRoles();
-    });
-    it('should create a new teller role', function () {
-       //TBD
-    });
     it('should create new accounts', function () {
         Accounting.goToAccountingViaSidePanel();
         Common.clickLinkShowForRowWithId("7000");
@@ -81,19 +71,8 @@
         Login.signOut();
         Login.logInForFirstTimeWithTenantUserAndPassword("playground", employeeIdentifier, "abc123!!", "abc123??");
     });
-
-    it('should create a headquarter office', function () {
+    it('should create a new branch office and a teller for the branch office', function () {
         Offices.goToManageOfficesViaSidePanel();
-        Offices.verifyNoHeadquarterExistingYet();
-        Offices.clickButtonCreateHeadquarter();
-        Offices.verifyCardHasTitleCreateOffice();
-        Offices.enterTextIntoOfficeIdentifierInputField("hqo1");
-        Offices.enterTextIntoOfficeNameInputField("Headquarter Office Playground");
-        Offices.clickEnabledContinueButtonForOfficeDetails();
-        Offices.clickEnabledCreateOfficeButton();
-        Common.verifyMessagePopupIsDisplayed("Office is going to be saved");
-    });
-    it('should create a new branch office', function () {
         Offices.clickButtonCreateNewOffice();
         Offices.verifyCardHasTitleCreateOffice();
         Offices.enterTextIntoOfficeIdentifierInputField(officeIdentifier);
@@ -104,8 +83,6 @@
         Common.clickSearchButtonToMakeSearchInputFieldAppear();
         Common.enterTextInSearchInputFieldAndApplySearch(officeIdentifier);
         Common.verifyFirstRowOfSearchResultHasTextAsId(officeIdentifier);
-    });
-    it('should create a new teller for the branch office', function () {
         Common.clickLinkShowForFirstRowInTable();
         Offices.goToManageTellersForOfficeByIdentifier(officeIdentifier);
         Offices.clickCreateTellerForOfficeByIdentifier(officeIdentifier);
@@ -131,7 +108,7 @@
         Common.verifyMessagePopupIsDisplayed("Teller is going to be updated");
         Offices.verifyTellerStatusIs("OPEN");
     });
-    it('should be able to create customer', function () {
+    it('should create customer and activate customer', function () {
         Customers.goToManageCustomersViaSidePanel();
         Customers.verifyCardHasTitleManageMembers();
         Customers.clickButtonOrLinkCreateNewCustomer();
@@ -152,8 +129,6 @@
         Common.clickSearchButtonToMakeSearchInputFieldAppear();
         Common.enterTextInSearchInputFieldAndApplySearch(customerAccount);
         Common.verifyFirstRowOfSearchResultHasTextAsId(customerAccount);
-    });
-    it('should activate the customer', function () {
         Common.clickLinkShowForFirstRowInTable();
         Customers.verifyMemberHasStatusInactive();
         Customers.clickButtonGoToTasks();
@@ -161,7 +136,7 @@
         Common.verifyMessagePopupIsDisplayed("Command is going to be executed");
         Customers.verifyMemberHasStatusActive();
     });
-    it('should create a deposit account - Checking with opening charge', function () {
+    it('should create a deposit product and enable the product', function () {
         Deposits.goToDepositsViaSidePanel();
         Deposits.verifyCardHasTitle("Manage deposit products");
         Deposits.clickButtonCreateDepositAccount();
@@ -190,15 +165,13 @@
         Deposits.clickEnabledCreateProductButton();
         Common.verifyMessagePopupIsDisplayed("Product is going to be saved");
         Deposits.verifyCardHasTitle("Manage deposit products");
-    });
-    it('should enable deposit product', function () {
         Common.clickLinkShowForRowWithId(depositIdentifier);
         Deposits.verifyProductHasStatusDisabled();
         Deposits.clickButtonEnableProduct();
         Common.verifyMessagePopupIsDisplayed("Product is going to be updated");
         Deposits.verifyProductHasStatusEnabled();
     });
-    it('should assign deposit product to customer', function () {
+    it('should assign deposit product to the customer and open the account', function () {
         Customers.goToManageCustomersViaSidePanel();
         Common.clickSearchButtonToMakeSearchInputFieldAppear();
         Common.enterTextInSearchInputFieldAndApplySearch(customerAccount);
@@ -215,15 +188,12 @@
         Common.clickLinkShowForRowWithId(depositIdentifier);
         Customers.verifyDepositAccountHasStatus("PENDING");
         Customers.verifyDepositAccountBalanceIs("0.00");
-    });
-    it('should be able to open account', function () {
         Teller.goToTellerManagementViaSidePanel();
         Teller.enterTextIntoTellerNumberInputField(tellerIdentifier);
         Teller.enterTextIntoPasswordInputField("qazwsx123!!");
         Teller.clickEnabledUnlockTellerButton();
         Common.verifyMessagePopupIsDisplayed("Teller drawer unlocked");
         Teller.enterTextIntoSearchInputField(customerAccount);
-        //will be successful even if the customer does not exist, clicks one of the buttons too quickly: need to fix
         Teller.clickButtonShowAtIndex(0);
         Teller.verifyCardTitleHasNameOfCustomer("Thomas Pynchon");
         Teller.clickOnOpenAccountForCustomer(customerAccount);
@@ -243,6 +213,8 @@
         Cheques.clickButtonDetermineFromMICR();
         Cheques.verifyWarningIsDisplayedIfIssuingBankCouldNotBeDetermined();
         //Issuing Bank/Issuer show error
+        Cheques.verifyIssuingBankHasError();
+        Cheques.verifyIssuerHasError();
         Cheques.enterTextIntoIssuingBankInputField("BoA");
         Cheques.enterTextIntoIssuerInputField("Paul Auster");
         Cheques.verifyPayeeHasTextAndCannotBeChanged("Thomas Pynchon");
@@ -282,8 +254,8 @@
         Accounting.enterTextIntoSearchAccountInputField(customerAccount + ".9100.00001");
         Accounting.clickSearchButton();
         Accounting.verifyFirstJournalEntry("Account Opening", "Amount: 500.00");
-        Accounting.verifySecondJournalEntry("Order Cheque", "Amount: 5000.00");
-        //Accounting.verifyThirdJournalEntry("Order Cheque", "Amount: 300.00");
+        Accounting.verifySecondJournalEntry("Order Cheque", "Amount: 5,000.00");
+        Accounting.verifyThirdJournalEntry("Open Cheque", "Amount: 300.00");
         Common.clickBackButtonInTitleBar();
         Common.clickLinkShowForRowWithId("7000");
         Common.clickLinkShowForRowWithId("7200");
@@ -293,10 +265,10 @@
         Accounting.verifyTransactionMessageForRow("ORCQ", 1);
         Accounting.verifyTransactionAmountForRow("5000", 1);
         Accounting.verifyTransactionBalanceForRow("5000", 1);
-        //Accounting.verifyTransactionTypeForRow("DEBIT", 2);
-        //Accounting.verifyTransactionMessageForRow("ORCQ", 2);
-        //Accounting.verifyTransactionAmountForRow("300", 1);
-        //Accounting.verifyTransactionBalanceForRow("5300", 1);
+        Accounting.verifyTransactionTypeForRow("DEBIT", 2);
+        Accounting.verifyTransactionMessageForRow("OPCQ", 2);
+        Accounting.verifyTransactionAmountForRow("300", 2);
+        Accounting.verifyTransactionBalanceForRow("5300", 2);
         Common.clickBackButtonInTitleBar();
         Common.clickBackButtonInTitleBar();
         Common.clickBackButtonInTitleBar();
@@ -309,27 +281,53 @@
         Accounting.verifyTransactionMessageForRow("ORCQ", 2);
         Accounting.verifyTransactionAmountForRow("5000", 2);
         Accounting.verifyTransactionBalanceForRow("5500", 2);
-        //Accounting.verifyTransactionTypeForRow("CREDIT", 3);
-        //Accounting.verifyTransactionMessageForRow("ORCQ", 3);
-        //Accounting.verifyTransactionAmountForRow("300", 3);
-        //Accounting.verifyTransactionBalanceForRow("5800", 3);
+        Accounting.verifyTransactionTypeForRow("CREDIT", 3);
+        Accounting.verifyTransactionMessageForRow("OPCQ", 3);
+        Accounting.verifyTransactionAmountForRow("300", 3);
+        Accounting.verifyTransactionBalanceForRow("5800", 3);
     });
-    //verify transactions
     it('cheques should be pending clearance - approve first cheque/cancel second cheque', function () {
         Accounting.goToAccountingViaSidePanel();
         Accounting.goToChequeClearing();
         Cheques.verifyStateForChequeInRow("PENDING", 1);
         //open cheque still not appearing
-        //Cheques.verifyStateForChequeInRow("PENDING", 2);
+        Cheques.verifyStateForChequeInRow("PENDING", 2);
         Cheques.clickButtonApproveForChequeWithIdentifier("123456~" + branchSortCode + "~789789");
         Cheques.cancelAction();
         Cheques.clickButtonApproveForChequeWithIdentifier("123456~" + branchSortCode + "~789789");
         Cheques.confirmAction();
-        Cheques.verifyStateForChequeInRow("PROCESSED");
+        //Cheques.verifyStateForChequeInRow("PROCESSED", 1);
         Cheques.clickButtonCancelForChequeWithIdentifier("123456~" + branchSortCode2 + "~789789");
         Cheques.confirmAction();
-        Cheques.verifyStateForChequeInRow("CANCELED");
-        browser.pause();
+        //Cheques.verifyStateForChequeInRow("CANCELED", 2);
+    });
+    it('cheque should have been reverted as expected', function () {
+        Accounting.goToAccountingViaSidePanel();
+        Accounting.goToJournalEntries();
+        Accounting.enterTextIntoSearchAccountInputField(customerAccount + ".9100.00001");
+        Accounting.clickSearchButton();
+        Accounting.verifyFourthJournalEntry("Cheque Reversal", "Amount: 300.00");
+        Common.clickBackButtonInTitleBar();
+        Common.clickLinkShowForRowWithId("7000");
+        Common.clickLinkShowForRowWithId("7200");
+        Common.clickLinkShowForRowWithId(chequesReceivableAccount);
+        Accounting.viewAccountEntriesForAccount(chequesReceivableAccount);
+        Accounting.verifyTransactionTypeForRow("CREDIT", 3);
+        Accounting.verifyTransactionMessageForRow("CQRV", 3);
+        Accounting.verifyTransactionAmountForRow("300", 3);
+        Accounting.verifyTransactionBalanceForRow("5000", 3);
+        Common.clickBackButtonInTitleBar();
+        Common.clickBackButtonInTitleBar();
+        Common.clickBackButtonInTitleBar();
+        Common.clickBackButtonInTitleBar();
+        Common.clickLinkShowForRowWithId("9000");
+        Common.clickLinkShowForRowWithId("9100");
+        Common.clickLinkShowForRowWithId(customerAccount + ".9100.00001");
+        Accounting.viewAccountEntriesForAccount(customerAccount + ".9100.00001");
+        Accounting.verifyTransactionTypeForRow("DEBIT", 4);
+        Accounting.verifyTransactionMessageForRow("CQRV", 4);
+        Accounting.verifyTransactionAmountForRow("300", 4);
+        Accounting.verifyTransactionBalanceForRow("5500", 4);
     });
     it('should create another customer', function () {
         Customers.goToManageCustomersViaSidePanel();
@@ -378,5 +376,90 @@
         Cheques.clickIssueChequesButton();
         Common.verifyMessagePopupIsDisplayed("Cheques are going to be issued");
     });
+    it('customer should be able to cash cheque - cheque is not open/on us', function () {
+        Teller.goToTellerManagementViaSidePanel();
+        Teller.enterTextIntoSearchInputField(customerAccount);
+        Teller.clickButtonShowAtIndex(0);
+        Teller.verifyCardTitleHasNameOfCustomer("Thomas Pynchon");
+        Teller.clickOnCashChequeForCustomer(customerAccount);
+        Cheques.enterTextIntoChequeNumberInputField("200");
+        Cheques.enterTextIntoBranchSortCodeInputField(officeIdentifier);
+        Cheques.enterTextIntoAccountNumberInputField(customerAccount2 + ".9100.00001");
+        Cheques.clickButtonDetermineFromMICR();
+        Cheques.verifyWarningIsNotDisplayedIfIssuingBankCouldBeDetermined();
+        Cheques.verifyPayeeHasTextAndCannotBeChanged("Thomas Pynchon");
+        Cheques.enterTextIntoDateIssuedInputField("992017");
+        Cheques.verifyWarningIsDisplayedIfChequeIsNotOpen();
+        Cheques.verifyIssuingBankHasText("Branch " + officeIdentifier);
+        Cheques.verifyIssuerHasText("Cormac McCarthy");
+        Cheques.enterTextIntoAmountInputField("250.54");
+        Cheques.selectAccountToTransferTo(customerAccount + ".9100.00001(" + depositIdentifier +")");
+        Cheques.clickCreateTransactionButton();
+        Cheques.verifyTransactionAmount("250.54");
+        Cheques.clickConfirmTransactionButton();
+        Common.verifyMessagePopupIsDisplayed("Transaction successfully confirmed");
+    });
+    it('customer should not be able to cash same cheque', function () {
+        //try and cash the same cheque again: determining from MICR should not be successful
+        Teller.clickOnCashChequeForCustomer(customerAccount);
+        Cheques.enterTextIntoChequeNumberInputField("200");
+        Cheques.enterTextIntoBranchSortCodeInputField(officeIdentifier);
+        Cheques.enterTextIntoAccountNumberInputField(customerAccount2 + ".9100.00001");
+        Cheques.clickButtonDetermineFromMICR();
+        Cheques.verifyWarningIsDisplayedIfIssuingBankCouldNotBeDetermined();
+        Cheques.verifyPayeeHasTextAndCannotBeChanged("Thomas Pynchon");
+        Cheques.enterTextIntoDateIssuedInputField("992017");
+        Cheques.verifyWarningIsDisplayedIfChequeIsNotOpen();
+        //Issuing Bank/Issuer have error
+        Cheques.verifyIssuingBankHasError();
+        Cheques.verifyIssuerHasError();
+        //Manually enter information and try to cash check anyways
+        Cheques.enterTextIntoIssuingBankInputField("Branch " + officeIdentifier);
+        Cheques.enterTextIntoIssuerInputField("Cormac McCarthy");
+        Cheques.enterTextIntoAmountInputField("33");
+        Cheques.selectAccountToTransferTo(customerAccount + ".9100.00001(" + depositIdentifier +")");
+        Cheques.clickCreateTransactionButton();
+        Cheques.verifyErrorMessageDisplayedWithTitleAndText("Invalid transaction", "Cheque 200~" + officeIdentifier + "~" + customerAccount2 + ".9100.00001 already used.");
+        Cheques.clickButtonOKInErrorMessage();
+        //open issue: transaction is created anyways, should not be created
+        //change cheque number to a number that has not yet been issued for the customer
+        // Cheques.enterTextIntoChequeNumberInputField("201");
+        // Cheques.clickButtonDetermineFromMICR();
+        // Cheques.verifyWarningIsDisplayedIfIssuingBankCouldNotBeDetermined();
+        // Cheques.verifyIssuingBankHasError();
+        // Cheques.verifyIssuerHasError();
+        //change back to cheque number that has been issued for the customer and that has not yet been used
+        // Cheques.enterTextIntoChequeNumberInputField("199");
+        // Cheques.clickButtonDetermineFromMICR();
+        // Cheques.verifyWarningIsNotDisplayedIfIssuingBankCouldBeDetermined();
+        // Cheques.verifyIssuingBankHasText("Branch " + officeIdentifier);
+        // Cheques.verifyIssuerHasText("Cormac McCarthy");
+    });
+    it('journal entries for the transaction should be listed as expected', function () {
+        Accounting.goToAccountingViaSidePanel();
+        Accounting.goToJournalEntries();
+        Accounting.enterTextIntoSearchAccountInputField(customerAccount2 + ".9100.00001");
+        Accounting.clickSearchButton();
+        Accounting.verifyFirstJournalEntry("Order Cheque", "Amount: 250.54");
+        Common.clickBackButtonInTitleBar();
+        Common.clickLinkShowForRowWithId("9000");
+        Common.clickLinkShowForRowWithId("9100");
+        Common.clickLinkShowForRowWithId(customerAccount2 + ".9100.00001");
+        Accounting.viewAccountEntriesForAccount(customerAccount2 + ".9100.00001");
+        Accounting.verifyTransactionTypeForRow("DEBIT", 1);
+        Accounting.verifyTransactionMessageForRow("ORCQ", 1);
+        Accounting.verifyTransactionAmountForRow("250.54", 1);
+        Accounting.verifyTransactionBalanceForRow("-250.54", 1);
+        Common.clickBackButtonInTitleBar();
+        Common.clickBackButtonInTitleBar();
+        Common.clickLinkShowForRowWithId(customerAccount + ".9100.00001");
+        Accounting.verifyTransactionTypeForRow("CREDIT", 5);
+        Accounting.verifyTransactionMessageForRow("ORCQ", 5);
+        Accounting.verifyTransactionAmountForRow("250.54", 5);
+        Accounting.verifyTransactionBalanceForRow("5750.54", 5);
+    });
+    //invalid input: amount 0 or less, cheque number not a number, office identifier too long
+    //special char input in issuing bank/issuer field
+
 
 });
\ No newline at end of file
diff --git a/Specs/cheque_management_from_scratch.js b/Specs/cheque_management_from_scratch.js
new file mode 100644
index 0000000..470e34b
--- /dev/null
+++ b/Specs/cheque_management_from_scratch.js
@@ -0,0 +1,481 @@
+//From scratch: Will create a role "Administrator" and a headquarter office
+
+var helper = require('../helper.js');
+var Login = require('../Pages/Login.js');
+var Employees = require('../Pages/Employees.js');
+var Common = require('../Pages/Common.js');
+var Offices = require('../Pages/Offices');
+var Roles = require('../Pages/Roles');
+var Teller = require('../Pages/Teller');
+var Customers = require('../Pages/Customers');
+var Deposits = require('../Pages/Deposits');
+var Accounting = require('../Pages/Accounting');
+var Loans = require('../Pages/Loans');
+var Cheques = require('../Pages/Cheques');
+
+
+describe('cheque_management', function() {
+    var EC = protractor.ExpectedConditions;
+    employeeIdentifier = helper.getRandomString(6);
+    officeIdentifier = helper.getRandomString(6);
+    tellerIdentifier = helper.getRandomString(4);
+    customerAccount = helper.getRandomString(5);
+    customerAccount2 = helper.getRandomString(5);
+    depositIdentifier = helper.getRandomString(5);
+    depositName = helper.getRandomString(8);
+    tellerAccount = helper.getRandomString(4);
+    chequesReceivableAccount = helper.getRandomString(4);
+    revenueAccount = helper.getRandomString(4);
+    loanShortName = helper.getRandomString(6);
+    taskIdentifier = helper.getRandomString(3);
+    loanAccountShortName =  helper.getRandomString(4);
+    branchSortCode = helper.getRandomString(11);
+    branchSortCode2 = helper.getRandomString(11);
+
+    //what role would be best in order to clear cheques and verify correctness of bookings?
+
+    it('should create a new administrator role', function () {
+        Common.waitForThePageToFinishLoading();
+        Roles.clickCreateNewRoleFromQuickAccess();
+        Roles.enterTextIntoRoleIdentifierInput("Administrator");
+        Roles.verifyCardHasTitleCreateRole();
+        Roles.selectCheckboxToGiveUserAllPermissions();
+        Roles.clickEnabledSaveRoleButton();
+        Common.verifyMessagePopupIsDisplayed("Role is going to be saved");
+        Roles.verifyCardHasTitleManageRoles();
+    });
+    it('should create a new teller role', function () {
+       //TBD: teller transaction should be executed by employee with role teller
+    });
+    it('should create new accounts', function () {
+        Accounting.goToAccountingViaSidePanel();
+        Common.clickLinkShowForRowWithId("7000");
+        Common.clickLinkShowForRowWithId("7300");
+        Accounting.clickCreateNewAccountInLedger("7300");
+        Accounting.enterTextIntoAccountIdentifierInputField(tellerAccount);
+        Accounting.verifyRadioAssetToBeSelected();
+        Accounting.verifyRadioAssetToBeDisabled();
+        Accounting.enterTextIntoAccountNameInputField("My teller");
+        Accounting.clickButtonCreateAccount();
+        Common.verifyMessagePopupIsDisplayed("Account is going to be saved");
+        Common.clickBackButtonInTitleBar();
+        Common.clickLinkShowForRowWithId("7200");
+        Accounting.clickCreateNewAccountInLedger("7200");
+        Accounting.enterTextIntoAccountIdentifierInputField(chequesReceivableAccount);
+        Accounting.verifyRadioAssetToBeSelected();
+        Accounting.verifyRadioAssetToBeDisabled();
+        Accounting.enterTextIntoAccountNameInputField("Cheques Receivable");
+        Accounting.clickButtonCreateAccount();
+        Common.verifyMessagePopupIsDisplayed("Account is going to be saved");
+        Accounting.goToAccountingViaSidePanel();
+        Common.clickLinkShowForRowWithId("1000");
+        Common.clickLinkShowForRowWithId("1300");
+        Accounting.clickCreateNewAccountInLedger("1300");
+        Accounting.enterTextIntoAccountIdentifierInputField(revenueAccount);
+        Accounting.verifyRadioRevenueToBeSelected();
+        Accounting.enterTextIntoAccountNameInputField("Revenue from deposit charges");
+        Accounting.clickButtonCreateAccount();
+        Common.verifyMessagePopupIsDisplayed("Account is going to be saved");
+    });
+    it('should create a new employee with administrator permissions', function () {
+        Employees.goToManageEmployeesViaSidePanel();
+        Employees.createEmployee(employeeIdentifier, "Kate", "Atkinson", "Administrator", "abc123!!");
+        Login.signOut();
+        Login.logInForFirstTimeWithTenantUserAndPassword("playground", employeeIdentifier, "abc123!!", "abc123??");
+    });
+
+    it('should create a headquarter office', function () {
+        Offices.goToManageOfficesViaSidePanel();
+        Offices.verifyNoHeadquarterExistingYet();
+        Offices.clickButtonCreateHeadquarter();
+        Offices.verifyCardHasTitleCreateOffice();
+        Offices.enterTextIntoOfficeIdentifierInputField("hqo1");
+        Offices.enterTextIntoOfficeNameInputField("Headquarter Office Playground");
+        Offices.clickEnabledContinueButtonForOfficeDetails();
+        Offices.clickEnabledCreateOfficeButton();
+        Common.verifyMessagePopupIsDisplayed("Office is going to be saved");
+    });
+    it('should create a new branch office and a teller for the branch office', function () {
+        Offices.clickButtonCreateNewOffice();
+        Offices.verifyCardHasTitleCreateOffice();
+        Offices.enterTextIntoOfficeIdentifierInputField(officeIdentifier);
+        Offices.enterTextIntoOfficeNameInputField("Branch " + officeIdentifier);
+        Offices.clickEnabledContinueButtonForOfficeDetails();
+        Offices.clickEnabledCreateOfficeButton();
+        Common.verifyMessagePopupIsDisplayed("Office is going to be saved");
+        Common.clickSearchButtonToMakeSearchInputFieldAppear();
+        Common.enterTextInSearchInputFieldAndApplySearch(officeIdentifier);
+        Common.verifyFirstRowOfSearchResultHasTextAsId(officeIdentifier);
+        Common.clickLinkShowForFirstRowInTable();
+        Offices.goToManageTellersForOfficeByIdentifier(officeIdentifier);
+        Offices.clickCreateTellerForOfficeByIdentifier(officeIdentifier);
+        Offices.enterTextIntoTellerNumberInputField(tellerIdentifier);
+        Offices.enterTextIntoPasswordInputField("qazwsx123!!");
+        Offices.enterTextIntoCashWithdrawalLimitInputField("1000");
+        Offices.enterTextIntoTellerAccountInputFieldAndSelectMatchingEntry(tellerAccount);
+        Offices.enterTextIntoVaultAccountInputFieldAndSelectMatchingEntry("7351");
+        Offices.enterTextIntoChequesReceivableAccountInputFieldAndSelectMatchingEntry(chequesReceivableAccount);
+        Offices.clickEnabledCreateTellerButton();
+        Common.verifyMessagePopupIsDisplayed("Teller is going to be saved");
+        //workaround for current bug that teller is not always listed immediately
+        Common.clickBackButtonInTitleBar();
+        Offices.goToManageTellersForOfficeByIdentifier(officeIdentifier);
+        //Offices.verifyTellerStatusIs("CLOSED");
+        Common.clickLinkShowForFirstRowInTable();
+    });
+    it('should open the teller and assign it to an employee', function () {
+        Offices.clickActionOpenForTellerOfOffice(tellerIdentifier, officeIdentifier);
+        Offices.enterTextIntoAssignedEmployeeInputField(employeeIdentifier);
+        Offices.selectOptionInListByName("Atkinson, Kate");
+        Offices.clickEnabledOpenTellerButton();
+        Common.verifyMessagePopupIsDisplayed("Teller is going to be updated");
+        Offices.verifyTellerStatusIs("OPEN");
+    });
+    it('should create customer and activate customer', function () {
+        Customers.goToManageCustomersViaSidePanel();
+        Customers.verifyCardHasTitleManageMembers();
+        Customers.clickButtonOrLinkCreateNewCustomer();
+        Customers.verifyCardHasTitleCreateMember();
+        Customers.enterTextIntoAccountInputField(customerAccount);
+        Customers.enterTextIntoFirstNameInputField("Thomas");
+        Customers.enterTextIntoLastNameInputField("Pynchon");
+        Customers.enterTextIntoDayOfBirthInputField("9211978");
+        Customers.verifyIsMemberCheckboxSelected();
+        Customers.clickEnabledContinueButtonForCustomerDetails();
+        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.verifyCardHasTitleManageMembers();
+        Common.clickSearchButtonToMakeSearchInputFieldAppear();
+        Common.enterTextInSearchInputFieldAndApplySearch(customerAccount);
+        Common.verifyFirstRowOfSearchResultHasTextAsId(customerAccount);
+        Common.clickLinkShowForFirstRowInTable();
+        Customers.verifyMemberHasStatusInactive();
+        Customers.clickButtonGoToTasks();
+        Customers.clickButtonActivate();
+        Common.verifyMessagePopupIsDisplayed("Command is going to be executed");
+        Customers.verifyMemberHasStatusActive();
+    });
+    it('should create a deposit product and enable the product', function () {
+        Deposits.goToDepositsViaSidePanel();
+        Deposits.verifyCardHasTitle("Manage deposit products");
+        Deposits.clickButtonCreateDepositAccount();
+        Deposits.verifyCardHasTitle("Create new deposit product");
+        Deposits.enterTextIntoShortNameInputField(depositIdentifier);
+        Deposits.verifyRadioCheckingIsSelected();
+        Deposits.enterTextIntoNameInputField(depositName);
+        Deposits.enterTextIntoMinimumBalanceInputField("100");
+        Deposits.verifyRadioAnnuallyIsSelected();
+        Deposits.verifyCheckboxFlexibleInterestNotChecked();
+        Deposits.enterTextIntoInterestInputField("3");
+        Deposits.verifyFixedTermToggleSetToOff();
+        Deposits.verifyTermPeriodInputFieldIsDisabled();
+        Deposits.verifyRadioButtonsMonthAndYearDisabled();
+        Deposits.toggleFixedTermToOn();
+        Deposits.verifyTermPeriodInputFieldIsEnabled();
+        Deposits.verifyRadioButtonsMonthAndYearEnabled();
+        Deposits.selectRadioButtonYear();
+        Deposits.enterTextIntoCashAccountInputField("7352");
+        Deposits.enterTextIntoExpenseAccountInputField("2820");
+        Deposits.enterTextIntoAccrueAccountInputField("8202");
+        Deposits.enterTextIntoEquityLedgerInputField("9100");
+        Deposits.enterTextIntoTermPeriodInputField("5");
+        Deposits.selectRadioButtonYear();
+        Deposits.clickEnabledContinueButtonForProductDetails();
+        Deposits.clickEnabledCreateProductButton();
+        Common.verifyMessagePopupIsDisplayed("Product is going to be saved");
+        Deposits.verifyCardHasTitle("Manage deposit products");
+        Common.clickLinkShowForRowWithId(depositIdentifier);
+        Deposits.verifyProductHasStatusDisabled();
+        Deposits.clickButtonEnableProduct();
+        Common.verifyMessagePopupIsDisplayed("Product is going to be updated");
+        Deposits.verifyProductHasStatusEnabled();
+    });
+    it('should assign deposit product to the customer and open the account', function () {
+        Customers.goToManageCustomersViaSidePanel();
+        Common.clickSearchButtonToMakeSearchInputFieldAppear();
+        Common.enterTextInSearchInputFieldAndApplySearch(customerAccount);
+        Common.verifyFirstRowOfSearchResultHasTextAsId(customerAccount);
+        Common.clickLinkShowForRowWithId(customerAccount);
+        Customers.clickManageDepositAccountsForMember(customerAccount);
+        Customers.clickCreateDepositAccountForMember(customerAccount);
+        Customers.selectProduct(depositName);
+        Customers.clickEnabledButtonCreateDepositAccount();
+        Common.verifyMessagePopupIsDisplayed("Deposit account is going to be saved");
+        //might not be in list immediately always
+        Common.clickBackButtonInTitleBar();
+        Customers.clickManageDepositAccountsForMember(customerAccount);
+        Common.clickLinkShowForRowWithId(depositIdentifier);
+        Customers.verifyDepositAccountHasStatus("PENDING");
+        Customers.verifyDepositAccountBalanceIs("0.00");
+        Teller.goToTellerManagementViaSidePanel();
+        Teller.enterTextIntoTellerNumberInputField(tellerIdentifier);
+        Teller.enterTextIntoPasswordInputField("qazwsx123!!");
+        Teller.clickEnabledUnlockTellerButton();
+        Common.verifyMessagePopupIsDisplayed("Teller drawer unlocked");
+        Teller.enterTextIntoSearchInputField(customerAccount);
+        Teller.clickButtonShowAtIndex(0);
+        Teller.verifyCardTitleHasNameOfCustomer("Thomas Pynchon");
+        Teller.clickOnOpenAccountForCustomer(customerAccount);
+        Teller.verifyCardTitleIs("Teller transaction");
+        Teller.selectAccountToBeAffected(customerAccount + ".9100.00001(" + depositIdentifier +")");
+        Teller.enterTextIntoAmountInputField("500");
+        Teller.clickEnabledCreateTransactionButton();
+        Teller.verifyTransactionAmount("500");
+        Teller.clickEnabledConfirmTransactionButton();
+        Common.verifyMessagePopupIsDisplayed("Transaction successfully confirmed");
+    });
+    it('customer should be able to cash cheque - cheque is not open/not on us', function () {
+        Teller.clickOnCashChequeForCustomer(customerAccount);
+        Cheques.enterTextIntoChequeNumberInputField("123456");
+        Cheques.enterTextIntoBranchSortCodeInputField(branchSortCode);
+        Cheques.enterTextIntoAccountNumberInputField("789789");
+        Cheques.clickButtonDetermineFromMICR();
+        Cheques.verifyWarningIsDisplayedIfIssuingBankCouldNotBeDetermined();
+        //Issuing Bank/Issuer show error
+        Cheques.enterTextIntoIssuingBankInputField("BoA");
+        Cheques.enterTextIntoIssuerInputField("Paul Auster");
+        Cheques.verifyPayeeHasTextAndCannotBeChanged("Thomas Pynchon");
+        Cheques.enterTextIntoDateIssuedInputField("992017");
+        Cheques.verifyWarningIsDisplayedIfChequeIsNotOpen();
+        Cheques.enterTextIntoAmountInputField("5000");
+        Cheques.selectAccountToTransferTo(customerAccount + ".9100.00001(" + depositIdentifier +")");
+        Cheques.clickCreateTransactionButton();
+        Cheques.verifyTransactionAmount("5000");
+        Cheques.clickConfirmTransactionButton();
+        Common.verifyMessagePopupIsDisplayed("Transaction successfully confirmed");
+    });
+    it('customer should be able to cash cheque - cheque is open/not on us', function () {
+        Teller.clickOnCashChequeForCustomer(customerAccount);
+        Cheques.enterTextIntoChequeNumberInputField("123456");
+        Cheques.enterTextIntoBranchSortCodeInputField(branchSortCode2);
+        Cheques.enterTextIntoAccountNumberInputField("789789");
+        Cheques.clickButtonDetermineFromMICR();
+        Cheques.verifyWarningIsDisplayedIfIssuingBankCouldNotBeDetermined();
+        //Issuing Bank/Issuer show error
+        Cheques.enterTextIntoIssuingBankInputField("BoA");
+        Cheques.enterTextIntoIssuerInputField("Paul Auster");
+        Cheques.verifyPayeeHasTextAndCannotBeChanged("Thomas Pynchon");
+        Cheques.enterTextIntoDateIssuedInputField("992017");
+        Cheques.checkCheckboxIsChequeOpen();
+        Cheques.verifyWarningIsNotDisplayedIfChequeIsOpen();
+        Cheques.enterTextIntoAmountInputField("300");
+        Cheques.selectAccountToTransferTo(customerAccount + ".9100.00001(" + depositIdentifier +")");
+        Cheques.clickCreateTransactionButton();
+        Cheques.verifyTransactionAmount("300");
+        Cheques.clickConfirmTransactionButton();
+        Common.verifyMessagePopupIsDisplayed("Transaction successfully confirmed");
+    });
+    it('journal entries for transactions should be listed as expected', function () {
+        Accounting.goToAccountingViaSidePanel();
+        Accounting.goToJournalEntries();
+        Accounting.enterTextIntoSearchAccountInputField(customerAccount + ".9100.00001");
+        Accounting.clickSearchButton();
+        Accounting.verifyFirstJournalEntry("Account Opening", "Amount: 500.00");
+        Accounting.verifySecondJournalEntry("Order Cheque", "Amount: 5,000.00");
+        Accounting.verifyThirdJournalEntry("Open Cheque", "Amount: 300.00");
+        Common.clickBackButtonInTitleBar();
+        Common.clickLinkShowForRowWithId("7000");
+        Common.clickLinkShowForRowWithId("7200");
+        Common.clickLinkShowForRowWithId(chequesReceivableAccount);
+        Accounting.viewAccountEntriesForAccount(chequesReceivableAccount);
+        Accounting.verifyTransactionTypeForRow("DEBIT", 1);
+        Accounting.verifyTransactionMessageForRow("ORCQ", 1);
+        Accounting.verifyTransactionAmountForRow("5000", 1);
+        Accounting.verifyTransactionBalanceForRow("5000", 1);
+        Accounting.verifyTransactionTypeForRow("DEBIT", 2);
+        Accounting.verifyTransactionMessageForRow("OPCQ", 2);
+        Accounting.verifyTransactionAmountForRow("300", 2);
+        Accounting.verifyTransactionBalanceForRow("5300", 2);
+        Common.clickBackButtonInTitleBar();
+        Common.clickBackButtonInTitleBar();
+        Common.clickBackButtonInTitleBar();
+        Common.clickBackButtonInTitleBar();
+        Common.clickLinkShowForRowWithId("9000");
+        Common.clickLinkShowForRowWithId("9100");
+        Common.clickLinkShowForRowWithId(customerAccount + ".9100.00001");
+        Accounting.viewAccountEntriesForAccount(customerAccount + ".9100.00001");
+        Accounting.verifyTransactionTypeForRow("CREDIT", 2);
+        Accounting.verifyTransactionMessageForRow("ORCQ", 2);
+        Accounting.verifyTransactionAmountForRow("5000", 2);
+        Accounting.verifyTransactionBalanceForRow("5500", 2);
+        Accounting.verifyTransactionTypeForRow("CREDIT", 3);
+        Accounting.verifyTransactionMessageForRow("OPCQ", 3);
+        Accounting.verifyTransactionAmountForRow("300", 3);
+        Accounting.verifyTransactionBalanceForRow("5800", 3);
+    });
+    it('cheques should be pending clearance - approve first cheque/cancel second cheque', function () {
+        Accounting.goToAccountingViaSidePanel();
+        Accounting.goToChequeClearing();
+        Cheques.verifyStateForChequeInRow("PENDING", 1);
+        //open cheque still not appearing
+        Cheques.verifyStateForChequeInRow("PENDING", 2);
+        Cheques.clickButtonApproveForChequeWithIdentifier("123456~" + branchSortCode + "~789789");
+        Cheques.cancelAction();
+        Cheques.clickButtonApproveForChequeWithIdentifier("123456~" + branchSortCode + "~789789");
+        Cheques.confirmAction();
+        //Cheques.verifyStateForChequeInRow("PROCESSED", 1);
+        Cheques.clickButtonCancelForChequeWithIdentifier("123456~" + branchSortCode2 + "~789789");
+        Cheques.confirmAction();
+        //Cheques.verifyStateForChequeInRow("CANCELED", 2);
+    });
+    it('cheque should have been reverted as expected', function () {
+        Accounting.goToAccountingViaSidePanel();
+        Accounting.goToJournalEntries();
+        Accounting.enterTextIntoSearchAccountInputField(customerAccount + ".9100.00001");
+        Accounting.clickSearchButton();
+        Accounting.verifyFourthJournalEntry("Cheque Reversal", "Amount: 300.00");
+        Common.clickBackButtonInTitleBar();
+        Common.clickLinkShowForRowWithId("7000");
+        Common.clickLinkShowForRowWithId("7200");
+        Common.clickLinkShowForRowWithId(chequesReceivableAccount);
+        Accounting.viewAccountEntriesForAccount(chequesReceivableAccount);
+        Accounting.verifyTransactionTypeForRow("CREDIT", 3);
+        Accounting.verifyTransactionMessageForRow("CQRV", 3);
+        Accounting.verifyTransactionAmountForRow("300", 3);
+        Accounting.verifyTransactionBalanceForRow("5000", 3);
+        Common.clickBackButtonInTitleBar();
+        Common.clickBackButtonInTitleBar();
+        Common.clickBackButtonInTitleBar();
+        Common.clickBackButtonInTitleBar();
+        Common.clickLinkShowForRowWithId("9000");
+        Common.clickLinkShowForRowWithId("9100");
+        Common.clickLinkShowForRowWithId(customerAccount + ".9100.00001");
+        Accounting.viewAccountEntriesForAccount(customerAccount + ".9100.00001");
+        Accounting.verifyTransactionTypeForRow("DEBIT", 4);
+        Accounting.verifyTransactionMessageForRow("CQRV", 4);
+        Accounting.verifyTransactionAmountForRow("300", 4);
+        Accounting.verifyTransactionBalanceForRow("5500", 4);
+    });
+    it('should create another customer', function () {
+        Customers.goToManageCustomersViaSidePanel();
+        Customers.verifyCardHasTitleManageMembers();
+        Customers.clickButtonOrLinkCreateNewCustomer();
+        Customers.verifyCardHasTitleCreateMember();
+        Customers.enterTextIntoAccountInputField(customerAccount2);
+        Customers.enterTextIntoFirstNameInputField("Cormac");
+        Customers.enterTextIntoLastNameInputField("McCarthy");
+        Customers.enterTextIntoDayOfBirthInputField("7281958");
+        Customers.verifyIsMemberCheckboxSelected();
+        Customers.clickEnabledContinueButtonForCustomerDetails();
+        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.verifyCardHasTitleManageMembers();
+        Common.clickSearchButtonToMakeSearchInputFieldAppear();
+        Common.enterTextInSearchInputFieldAndApplySearch(customerAccount2);
+        Common.verifyFirstRowOfSearchResultHasTextAsId(customerAccount2);
+    });
+    it('should activate the customer', function () {
+        Common.clickLinkShowForFirstRowInTable();
+        Customers.verifyMemberHasStatusInactive();
+        Customers.clickButtonGoToTasks();
+        Customers.clickButtonActivate();
+        Common.verifyMessagePopupIsDisplayed("Command is going to be executed");
+        Customers.verifyMemberHasStatusActive();
+    });
+    it('should assign deposit product to customer and issue cheques to customer', function () {
+        Customers.clickManageDepositAccountsForMember(customerAccount2);
+        Customers.clickCreateDepositAccountForMember(customerAccount2);
+        Customers.selectProduct(depositName);
+        Customers.clickEnabledButtonCreateDepositAccount();
+        Common.verifyMessagePopupIsDisplayed("Deposit account is going to be saved");
+        //might not be in list immediately always
+        Common.clickBackButtonInTitleBar();
+        Customers.clickManageDepositAccountsForMember(customerAccount2);
+        Common.clickLinkShowForRowWithId(depositIdentifier);
+        Customers.verifyDepositAccountHasStatus("PENDING");
+        Customers.verifyDepositAccountBalanceIs("0.00");
+        Cheques.clickButtonIssueCheques();
+        Cheques.enterTextIntoAmountInputField("200");
+        Cheques.clickIssueChequesButton();
+        Common.verifyMessagePopupIsDisplayed("Cheques are going to be issued");
+    });
+    it('customer should be able to cash cheque - cheque is not open/on us', function () {
+        Teller.goToTellerManagementViaSidePanel();
+        Teller.enterTextIntoSearchInputField(customerAccount);
+        Teller.clickButtonShowAtIndex(0);
+        Teller.verifyCardTitleHasNameOfCustomer("Thomas Pynchon");
+        Teller.clickOnCashChequeForCustomer(customerAccount);
+        Cheques.enterTextIntoChequeNumberInputField("200");
+        Cheques.enterTextIntoBranchSortCodeInputField(officeIdentifier);
+        Cheques.enterTextIntoAccountNumberInputField(customerAccount2 + ".9100.00001");
+        Cheques.clickButtonDetermineFromMICR();
+        Cheques.verifyWarningIsNotDisplayedIfIssuingBankCouldBeDetermined();
+        Cheques.verifyPayeeHasTextAndCannotBeChanged("Thomas Pynchon");
+        Cheques.enterTextIntoDateIssuedInputField("992017");
+        Cheques.verifyWarningIsDisplayedIfChequeIsNotOpen();
+        Cheques.verifyIssuingBankHasText("Branch " + officeIdentifier);
+        Cheques.verifyIssuerHasText("Cormac McCarthy");
+        Cheques.enterTextIntoAmountInputField("250.54");
+        Cheques.selectAccountToTransferTo(customerAccount + ".9100.00001(" + depositIdentifier +")");
+        Cheques.clickCreateTransactionButton();
+        Cheques.verifyTransactionAmount("250.54");
+        Cheques.clickConfirmTransactionButton();
+        Common.verifyMessagePopupIsDisplayed("Transaction successfully confirmed");
+    });
+    it('customer should not be able to cash same cheque', function () {
+        //try and cash the same cheque again: determining from MICR should not be successful
+        Teller.clickOnCashChequeForCustomer(customerAccount);
+        Cheques.enterTextIntoChequeNumberInputField("200");
+        Cheques.enterTextIntoBranchSortCodeInputField(officeIdentifier);
+        Cheques.enterTextIntoAccountNumberInputField(customerAccount2 + ".9100.00001");
+        Cheques.clickButtonDetermineFromMICR();
+        Cheques.verifyWarningIsDisplayedIfIssuingBankCouldNotBeDetermined();
+        Cheques.verifyPayeeHasTextAndCannotBeChanged("Thomas Pynchon");
+        Cheques.enterTextIntoDateIssuedInputField("992017");
+        Cheques.verifyWarningIsDisplayedIfChequeIsNotOpen();
+        //Issuing Bank/Issuer have error
+        Cheques.verifyIssuingBankHasError();
+        Cheques.verifyIssuerHasError();
+        //Manually enter information and try to cash check anyways
+        Cheques.enterTextIntoIssuingBankInputField("Branch " + officeIdentifier);
+        Cheques.enterTextIntoIssuerInputField("Cormac McCarthy");
+        Cheques.enterTextIntoAmountInputField("33");
+        Cheques.selectAccountToTransferTo(customerAccount + ".9100.00001(" + depositIdentifier +")");
+        Cheques.clickCreateTransactionButton();
+        //waiting for error message to show up in the UI, "Cheque 200~FMwxYg~AcHlZ.9100.00001 already used."
+        //change cheque number to a number that has not yet been issued for the customer
+        Cheques.enterTextIntoChequeNumberInputField("201");
+        Cheques.clickButtonDetermineFromMICR();
+        Cheques.verifyWarningIsDisplayedIfIssuingBankCouldNotBeDetermined();
+        Cheques.verifyIssuingBankHasError();
+        Cheques.verifyIssuerHasError();
+        //change back to cheque number that has been issued for the customer and that has not yet been used
+        Cheques.enterTextIntoChequeNumberInputField("199");
+        Cheques.clickButtonDetermineFromMICR();
+        Cheques.verifyWarningIsNotDisplayedIfIssuingBankCouldBeDetermined();
+        Cheques.verifyIssuingBankHasText("Branch " + officeIdentifier);
+        Cheques.verifyIssuerHasText("Cormac McCarthy");
+    });
+    it('journal entries for the transaction should be listed as expected', function () {
+        Accounting.goToAccountingViaSidePanel();
+        Accounting.goToJournalEntries();
+        Accounting.enterTextIntoSearchAccountInputField(customerAccount2 + ".9100.00001");
+        Accounting.clickSearchButton();
+        Accounting.verifyFirstJournalEntry("Open Cheque", "Amount: 250.54");
+        Common.clickBackButtonInTitleBar();
+        Common.clickLinkShowForRowWithId("9000");
+        Common.clickLinkShowForRowWithId("9100");
+        Common.clickLinkShowForRowWithId(customerAccount2 + ".9100.00001");
+        Accounting.viewAccountEntriesForAccount(customerAccount2 + ".9100.00001");
+        Accounting.verifyTransactionTypeForRow("DEBIT", 1);
+        Accounting.verifyTransactionMessageForRow("ORCQ", 1);
+        Accounting.verifyTransactionAmountForRow("250.54", 1);
+        Accounting.verifyTransactionBalanceForRow("-250.54", 1);
+        Common.clickBackButtonInTitleBar();
+        Common.clickBackButtonInTitleBar();
+        Common.clickLinkShowForRowWithId(customerAccount + ".9100.00001");
+        Accounting.verifyTransactionTypeForRow("CREDIT", 5);
+        Accounting.verifyTransactionMessageForRow("ORCQ", 5);
+        Accounting.verifyTransactionAmountForRow("250.54", 5);
+        Accounting.verifyTransactionBalanceForRow("5750.54", 5);
+        browser.pause();
+    })
+});
\ No newline at end of file