From 7ed4bfe7ee5ff8bfe1caf5e842a720340266faa3 Mon Sep 17 00:00:00 2001 From: Vishal Dhayagude Date: Mon, 28 Aug 2017 16:53:25 +0530 Subject: [PATCH] [UI Test] UI Test for Material Receipt with Serialize Item Added (#10565) * [UI Test] UI Test for Material Receipt with Serialize Item Added * [fix]Codacy fixed --- ...for_material_receipt_for_serialize_item.js | 35 +++++++++++++++++++ erpnext/tests/ui/tests.txt | 3 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_receipt_for_serialize_item.js diff --git a/erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_receipt_for_serialize_item.js b/erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_receipt_for_serialize_item.js new file mode 100644 index 00000000000..ffd06642bf0 --- /dev/null +++ b/erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_receipt_for_serialize_item.js @@ -0,0 +1,35 @@ +QUnit.module('Stock'); + +QUnit.test("test material receipt", function(assert) { + assert.expect(2); + let done = assert.async(); + frappe.run_serially([ + () => { + return frappe.tests.make('Stock Entry', [ + {purpose:'Material Receipt'}, + {to_warehouse:'Stores - '+frappe.get_abbr(frappe.defaults.get_default('Company'))}, + {items: [ + [ + {'item_code': 'Test Product 4'}, + {'qty': 5}, + {'batch_no':'TEST-BATCH-001'}, + {'serial_no':'Test-Product-001\nTest-Product-002\nTest-Product-003\nTest-Product-004\nTest-Product-005'}, + {'basic_rate':100}, + ] + ]}, + ]); + }, + () => cur_frm.save(), + () => frappe.click_button('Update Rate and Availability'), + () => { + // get_item_details + assert.ok(cur_frm.doc.items[0].item_name=='Test Product 4', "Item name correct"); + assert.ok(cur_frm.doc.total_incoming_value==500, " Incoming Value correct"); + }, + () => 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 826b956f384..653aeecc665 100644 --- a/erpnext/tests/ui/tests.txt +++ b/erpnext/tests/ui/tests.txt @@ -119,5 +119,6 @@ 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 erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js +erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_receipt_for_serialize_item.js erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_transfer_for_manufacture.js -erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_subcontract.js \ No newline at end of file +erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_subcontract.js