Test cases

This commit is contained in:
Rohit Waghchaure 2017-08-31 11:16:14 +05:30
parent 7e752c4ebf
commit 3e43927767
3 changed files with 41 additions and 0 deletions

View File

@ -507,8 +507,10 @@ class POSCart {
df: { df: {
fieldtype: 'Link', fieldtype: 'Link',
label: 'Customer', label: 'Customer',
fieldname: 'customer',
options: 'Customer', options: 'Customer',
reqd: 1, reqd: 1,
default: this.frm.doc.customer,
onchange: () => { onchange: () => {
this.events.on_customer_change(this.customer_field.get_value()); this.events.on_customer_change(this.customer_field.get_value());
} }

View File

@ -0,0 +1,38 @@
QUnit.test("test:Point of Sales", function(assert) {
assert.expect(1);
let done = assert.async();
frappe.run_serially([
() => frappe.set_route('point-of-sale'),
() => frappe.timeout(2),
() => frappe.set_control('customer', 'Test Customer'),
() => frappe.timeout(0.2),
() => cur_frm.set_value('customer', 'Test Customer'),
() => frappe.timeout(2),
() => frappe.click_link('Test FG Item 2'),
() => frappe.timeout(0.2),
() => frappe.click_element(`.cart-items [title="_Test FG Item 2"]`),
() => frappe.timeout(0.2),
() => frappe.click_element(`.number-pad [data-value="Rate"]`),
() => frappe.timeout(0.2),
() => frappe.click_element(`.number-pad [data-value="2"]`),
() => frappe.timeout(0.2),
() => frappe.click_element(`.number-pad [data-value="5"]`),
() => frappe.timeout(0.2),
() => frappe.click_element(`.number-pad [data-value="0"]`),
() => frappe.timeout(0.2),
() => frappe.click_element(`.number-pad [data-value="Pay"]`),
() => frappe.timeout(0.2),
() => frappe.click_element(`.frappe-control [data-value="4"]`),
() => frappe.timeout(0.2),
() => frappe.click_element(`.frappe-control [data-value="5"]`),
() => frappe.timeout(0.2),
() => frappe.click_element(`.frappe-control [data-value="0"]`),
() => frappe.timeout(0.2),
() => frappe.click_button('Submit'),
() => frappe.click_button('Yes'),
() => frappe.timeout(5),
() => assert.ok(cur_frm.doc.docstatus==1, "Sales invoice created successfully"),
() => done()
]);
});

View File

@ -50,6 +50,7 @@ erpnext/schools/doctype/room/test_room.js
erpnext/schools/doctype/instructor/test_instructor.js erpnext/schools/doctype/instructor/test_instructor.js
erpnext/stock/doctype/warehouse/test_warehouse.js erpnext/stock/doctype/warehouse/test_warehouse.js
erpnext/manufacturing/doctype/production_order/test_production_order.js #long erpnext/manufacturing/doctype/production_order/test_production_order.js #long
erpnext/selling/page/point_of_sale/test_point_of_sale.js
erpnext/accounts/page/pos/test_pos.js erpnext/accounts/page/pos/test_pos.js
erpnext/selling/doctype/product_bundle/test_product_bundle.js erpnext/selling/doctype/product_bundle/test_product_bundle.js
erpnext/stock/doctype/delivery_note/test_delivery_note.js erpnext/stock/doctype/delivery_note/test_delivery_note.js