From 554cf9be44d156e674ebb66208f917bbb1e32a61 Mon Sep 17 00:00:00 2001 From: Vishal Dhayagude Date: Mon, 28 Aug 2017 11:11:36 +0530 Subject: [PATCH] [UI Test] UI Test Added for Bank Reconciliation (#10563) --- .../test_bank_reconciliation.js | 22 +++++++++++++++++++ erpnext/tests/ui/tests.txt | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js diff --git a/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js b/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js new file mode 100644 index 0000000000..f52f6fb431 --- /dev/null +++ b/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js @@ -0,0 +1,22 @@ +QUnit.module('Account'); + +QUnit.test("test Bank Reconciliation", function(assert) { + assert.expect(0); + let done = assert.async(); + frappe.run_serially([ + () => frappe.set_route('Form', 'Bank Reconciliation'), + () => cur_frm.set_value('bank_account','Cash - FT'), + () => frappe.click_button('Get Payment Entries'), + () => { + for(var i=0;i<=cur_frm.doc.payment_entries.length-1;i++){ + cur_frm.doc.payment_entries[i].clearance_date = frappe.datetime.add_days(frappe.datetime.now_date(), 2); + } + }, + () => {cur_frm.refresh_fields('payment_entries');}, + () => frappe.click_button('Update Clearance Date'), + () => frappe.timeout(0.5), + () => frappe.click_button('Close'), + () => done() + ]); +}); + diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt index d1dc96cbe1..48b6fb0534 100644 --- a/erpnext/tests/ui/tests.txt +++ b/erpnext/tests/ui/tests.txt @@ -113,4 +113,5 @@ erpnext/accounts/doctype/journal_entry/test_journal_entry.js erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js erpnext/selling/doctype/quotation/tests/test_quotation_submit_cancel_amend.js -erpnext/stock/doctype/batch/test_batch.js \ No newline at end of file +erpnext/stock/doctype/batch/test_batch.js +erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js \ No newline at end of file