Fixed test cases

This commit is contained in:
Rohit Waghchaure 2017-09-06 12:37:38 +05:30
parent 4bcaeb312c
commit 7419c4b577

View File

@ -1,3 +1,21 @@
QUnit.test("test:POS Settings", function(assert) {
assert.expect(1);
let done = assert.async();
frappe.run_serially([
() => frappe.set_route('Form', 'POS Settings'),
() => cur_frm.set_value('is_online', 1),
() => frappe.timeout(0.2),
() => cur_frm.save(),
() => frappe.timeout(1),
() => frappe.ui.toolbar.clear_cache(),
() => frappe.timeout(2),
() => assert.ok(cur_frm.doc.is_online==1, "Enabled online"),
() => frappe.timeout(2),
() => done()
]);
});
QUnit.test("test:Point of Sales", function(assert) {
assert.expect(1);
let done = assert.async();
@ -5,13 +23,13 @@ QUnit.test("test:Point of Sales", function(assert) {
frappe.run_serially([
() => frappe.set_route('point-of-sale'),
() => frappe.timeout(2),
() => frappe.set_control('customer', 'Test Customer'),
() => frappe.set_control('customer', 'Test Customer 1'),
() => frappe.timeout(0.2),
() => cur_frm.set_value('customer', 'Test Customer'),
() => cur_frm.set_value('customer', 'Test Customer 1'),
() => frappe.timeout(2),
() => frappe.click_link('Test FG Item 2'),
() => frappe.click_link('Test Product 2'),
() => frappe.timeout(0.2),
() => frappe.click_element(`.cart-items [title="_Test FG Item 2"]`),
() => frappe.click_element(`.cart-items [title="Test Product 2"]`),
() => frappe.timeout(0.2),
() => frappe.click_element(`.number-pad [data-value="Rate"]`),
() => frappe.timeout(0.2),