From 17b2720f5b4105c52398689d096322a826f604a7 Mon Sep 17 00:00:00 2001 From: Vishal Dhayagude Date: Thu, 24 Aug 2017 17:50:28 +0530 Subject: [PATCH] [UI Test] UI Test for Payment Entry (#10521) --- .../payment_entry/tests/test_payment_entry.js | 29 +++++++++++++++++++ erpnext/tests/ui/tests.txt | 3 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js diff --git a/erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js b/erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js new file mode 100644 index 00000000000..a4ef0ca4eb3 --- /dev/null +++ b/erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js @@ -0,0 +1,29 @@ +QUnit.module('Accounts'); + +QUnit.test("test payment entry", function(assert) { + assert.expect(1); + let done = assert.async(); + frappe.run_serially([ + () => { + return frappe.tests.make('Payment Entry', [ + {payment_type:'Receive'}, + {mode_of_payment:'Cash'}, + {party_type:'Customer'}, + {party:'Test Customer 3'}, + {paid_amount:675}, + {reference_no:123}, + {reference_date: frappe.datetime.add_days(frappe.datetime.nowdate(), 0)}, + ]); + }, + () => cur_frm.save(), + () => { + // get_item_details + assert.ok(cur_frm.doc.total_allocated_amount==675, "Allocated AmountCorrect"); + }, + () => frappe.tests.click_button('Submit'), + () => frappe.tests.click_button('Yes'), + () => frappe.timeout(0.3), + () => done() + ]); +}); + diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt index 970b00d8c7b..9d949efbab0 100644 --- a/erpnext/tests/ui/tests.txt +++ b/erpnext/tests/ui/tests.txt @@ -105,4 +105,5 @@ erpnext/schools/doctype/assessment_plan/test_assessment_plan.js erpnext/schools/doctype/assessment_result/test_assessment_result.js erpnext/schools/doctype/assessment_result_tool/test_assessment_result_tool.js erpnext/accounts/doctype/journal_entry/test_journal_entry.js -erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js \ No newline at end of file +erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js +erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js \ No newline at end of file