[UI Test] Sales Order with Shipping Rule and Pricing Rule Added (#10270)

* [UI Test] Sales Order with Shipping Rule Added

* [UI Test] Sales Order with Pricing Rule Added
This commit is contained in:
Vishal Dhayagude 2017-08-04 10:51:08 +05:30 committed by Rushabh Mehta
parent 4331067e57
commit 592add9f0a
3 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,34 @@
QUnit.module('Sales Order');
QUnit.test("test sales order with shipping rule", function(assert) {
assert.expect(2);
let done = assert.async();
frappe.run_serially([
() => {
return frappe.tests.make('Sales Order', [
{customer: 'Test Customer 3'},
{items: [
[
{'delivery_date': frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)},
{'qty': 5},
{'item_code': 'Test Product 2'},
]
]},
{customer_address: 'Test1-Billing'},
{shipping_address_name: 'Test1-Shipping'},
{contact_person: 'Contact 1-Test Customer 1'},
]);
},
() => cur_frm.save(),
() => {
// get_item_details
assert.ok(cur_frm.doc.items[0].item_name=='Test Product 2', "Item name correct");
// get grand_total details
assert.ok(cur_frm.doc.grand_total== 675, "Grand total correct ");
},
() => frappe.tests.click_button('Submit'),
() => frappe.tests.click_button('Yes'),
() => frappe.timeout(0.3),
() => done()
]);
});

View File

@ -0,0 +1,35 @@
QUnit.module('Sales Order');
QUnit.test("test sales order with shipping rule", function(assert) {
assert.expect(2);
let done = assert.async();
frappe.run_serially([
() => {
return frappe.tests.make('Sales Order', [
{customer: 'Test Customer 1'},
{items: [
[
{'delivery_date': frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)},
{'qty': 5},
{'item_code': 'Test Product 4'},
]
]},
{customer_address: 'Test1-Billing'},
{shipping_address_name: 'Test1-Shipping'},
{contact_person: 'Contact 1-Test Customer 1'},
{shipping_rule:'Next Day Shipping'}
]);
},
() => cur_frm.save(),
() => {
// get_item_details
assert.ok(cur_frm.doc.items[0].item_name=='Test Product 4', "Item name correct");
// get grand_total details
assert.ok(cur_frm.doc.grand_total== 550, "Grand total correct ");
},
() => frappe.tests.click_button('Submit'),
() => frappe.tests.click_button('Yes'),
() => frappe.timeout(0.3),
() => done()
]);
});

View File

@ -16,6 +16,8 @@ erpnext/selling/doctype/sales_order/tests/test_sales_order_with_item_wise_discou
erpnext/selling/doctype/sales_order/tests/test_sales_order_with_multi_uom.js
erpnext/selling/doctype/sales_order/tests/test_sales_order_with_discount_on_grand_total.js
erpnext/selling/doctype/sales_order/tests/test_sales_order_with_taxes_and_charges.js
erpnext/selling/doctype/sales_order/tests/test_sales_order_with_shipping_rule.js
erpnext/selling/doctype/sales_order/tests/test_sales_order_with_pricing_rule.js
erpnext/manufacturing/doctype/workstation/test_workstation.js
erpnext/manufacturing/doctype/operation/test_operation.js
erpnext/manufacturing/doctype/bom/test_bom.js