diff --git a/erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js b/erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js index 7dea76db80..4f27b74d4b 100644 --- a/erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js +++ b/erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js @@ -9,9 +9,9 @@ QUnit.test("test payment entry", function(assert) { {customer: 'Test Customer 1'}, {items: [ [ + {'item_code': 'Test Product 1'}, {'qty': 1}, {'rate': 101}, - {'item_code': 'Test Product 1'}, ] ]} ]); @@ -19,11 +19,12 @@ QUnit.test("test payment entry", function(assert) { () => cur_frm.save(), () => frappe.tests.click_button('Submit'), () => frappe.tests.click_button('Yes'), - () => frappe.timeout(0.5), + () => frappe.timeout(1), () => frappe.tests.click_button('Close'), - () => frappe.timeout(0.5), + () => frappe.timeout(1), () => frappe.click_button('Make'), - () => frappe.click_link('Payment', 1), + () => frappe.timeout(1), + () => frappe.click_link('Payment'), () => frappe.timeout(2), () => { assert.equal(frappe.get_route()[1], 'Payment Entry', @@ -35,16 +36,19 @@ QUnit.test("test payment entry", function(assert) { assert.equal(cur_frm.doc.references[0].allocated_amount, 101, 'amount allocated against sales invoice'); }, + () => frappe.timeout(1), () => cur_frm.set_value('paid_amount', 100), + () => frappe.timeout(1), () => { - cur_frm.doc.references[0].allocated_amount = 101; + frappe.model.set_value("Payment Entry Reference", cur_frm.doc.references[0].name, + "allocated_amount", 101); }, + () => frappe.timeout(1), () => frappe.click_button('Write Off Difference Amount'), + () => frappe.timeout(1), () => { - assert.equal(cur_frm.doc.difference_amount, 0, - 'difference amount is zero'); - assert.equal(cur_frm.doc.deductions[0].amount, 1, - 'Write off amount = 1'); + assert.equal(cur_frm.doc.difference_amount, 0, 'difference amount is zero'); + assert.equal(cur_frm.doc.deductions[0].amount, 1, 'Write off amount = 1'); }, () => done() ]); diff --git a/erpnext/setup/setup_wizard/test_setup_wizard.py b/erpnext/setup/setup_wizard/test_setup_wizard.py index e37951d6fd..57eeeff5b2 100644 --- a/erpnext/setup/setup_wizard/test_setup_wizard.py +++ b/erpnext/setup/setup_wizard/test_setup_wizard.py @@ -56,6 +56,8 @@ def run_setup_wizard_test(): time.sleep(1) frappe.db.set_default('in_selenium', None) + frappe.db.set_value("Company", "For Testing", "write_off_account", "Write Off - FT") + frappe.db.set_value("Company", "For Testing", "exchange_gain_loss_account", "Exchange Gain/Loss - FT") frappe.db.commit() driver.close()