[UI Test] Multiple UI Test for Stock Entry added (#10354)

This commit is contained in:
Vishal Dhayagude 2017-08-11 12:06:16 +05:30 committed by Makarand Bauskar
parent 9e30969243
commit 4157b64776
3 changed files with 69 additions and 1 deletions

View File

@ -0,0 +1,32 @@
QUnit.module('Stock');
QUnit.test("test material request", 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 1'},
{'qty': 5},
]
]},
]);
},
() => cur_frm.save(),
() => frappe.click_button('Update Rate and Availability'),
() => {
// get_item_details
assert.ok(cur_frm.doc.items[0].item_name=='Test Product 1', "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()
]);
});

View File

@ -0,0 +1,34 @@
QUnit.module('Stock');
QUnit.test("test material request", function(assert) {
assert.expect(3);
let done = assert.async();
frappe.run_serially([
() => {
return frappe.tests.make('Stock Entry', [
{purpose:'Material Transfer'},
{from_warehouse:'Stores - '+frappe.get_abbr(frappe.defaults.get_default('Company'))},
{to_warehouse:'Work In Progress - '+frappe.get_abbr(frappe.defaults.get_default('Company'))},
{items: [
[
{'item_code': 'Test Product 1'},
{'qty': 5},
]
]},
]);
},
() => cur_frm.save(),
() => frappe.click_button('Update Rate and Availability'),
() => {
// get_item_details
assert.ok(cur_frm.doc.items[0].item_name=='Test Product 1', "Item name correct");
assert.ok(cur_frm.doc.total_outgoing_value==500, " Outgoing Value 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()
]);
});

View File

@ -55,6 +55,9 @@ erpnext/stock/doctype/material_request/tests/test_material_request.js
erpnext/stock/doctype/material_request/tests/test_material_request_type_material_issue.js
erpnext/stock/doctype/material_request/tests/test_material_request_type_material_transfer.js
erpnext/stock/doctype/material_request/tests/test_material_request_type_manufacture.js
erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_issue.js
erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_receipt.js
erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_transfer.js
erpnext/schools/doctype/grading_scale/test_grading_scale.js
erpnext/schools/doctype/assessment_criteria_group/test_assessment_criteria_group.js
erpnext/schools/doctype/assessment_criteria/test_assessment_criteria.js
@ -71,7 +74,6 @@ erpnext/schools/doctype/student_group_creation_tool/test_student_group_creation_
erpnext/schools/doctype/student_leave_application/test_student_leave_application.js
erpnext/schools/doctype/student_attendance_tool/test_student_attendance_tool.js
erpnext/schools/doctype/student_attendance/test_student_attendance.js
erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_issue.js
erpnext/schools/doctype/assessment_group/test_assessment_group.js
erpnext/schools/doctype/assessment_plan/test_assessment_plan.js
erpnext/schools/doctype/assessment_result/test_assessment_result.js