[UI Test] UI Test added for Stock Reconciliation (#10432)
* [UI Test] UI Test added for Stock Reconciliation
* [fix] Codacy
diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js
new file mode 100644
index 0000000..b0eae73
--- /dev/null
+++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js
@@ -0,0 +1,31 @@
+QUnit.module('Stock');
+
+QUnit.test("test Stock Reconciliation", function(assert) {
+ assert.expect(1);
+ let done = assert.async();
+ frappe.run_serially([
+ () => frappe.set_route('List', 'Stock Reconciliation'),
+ () => frappe.click_button('New'),
+ () => cur_frm.set_value('company','Razer Blade'),
+ () => frappe.click_button('Items'),
+ () => {cur_dialog.set_value('warehouse','Stores - RB'); },
+ () => frappe.timeout(0.5),
+ () => frappe.click_button('Update'),
+ () => {
+ cur_frm.doc.items[0].qty = 150;
+ cur_frm.refresh_fields('items');},
+ () => frappe.timeout(0.5),
+ () => cur_frm.set_value('expense_account','Stock Adjustment - RB'),
+ () => cur_frm.set_value('cost_center','Main - RB'),
+ () => cur_frm.save(),
+ () => {
+ // get_item_details
+ assert.ok(cur_frm.doc.expense_account=='Stock Adjustment - RB', "expense_account 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 6bae3c5..7c5582b 100644
--- a/erpnext/tests/ui/tests.txt
+++ b/erpnext/tests/ui/tests.txt
@@ -101,3 +101,4 @@
erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_taxes_and_charges.js
erpnext/buying/doctype/purchase_order/tests/test_purchase_order_receipt.js
erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.js
+erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js
\ No newline at end of file