diff --git a/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js index 46e8d1f2d69..a4d68aa946d 100644 --- a/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js +++ b/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js @@ -65,7 +65,7 @@ QUnit.test("test: request_for_quotation", function(assert) { assert.ok(cur_frm.doc.docstatus == 1, "Quotation request submitted"); }, () => frappe.click_button('Send Supplier Emails'), - () => frappe.timeout(3), + () => frappe.timeout(4), () => { assert.ok($('div.modal.fade.in > div.modal-dialog > div > div.modal-body.ui-front > div.msgprint').text().includes("Email sent to supplier Test Supplier"), "Send emails working"); }, diff --git a/erpnext/hr/doctype/attendance/test_attendance.js b/erpnext/hr/doctype/attendance/test_attendance.js index 82347ad5672..752bf097b0b 100644 --- a/erpnext/hr/doctype/attendance/test_attendance.js +++ b/erpnext/hr/doctype/attendance/test_attendance.js @@ -14,8 +14,12 @@ QUnit.test("Test: Attendance [HR]", function (assert) { "Form for new Attendance opened successfully."), // set values in form () => cur_frm.set_value("company", "Test Company"), - () => frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name'), - (employee) => cur_frm.set_value("employee", employee.message.name), + () => { + frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name', function(r) { + cur_frm.set_value("employee", r.name) + }); + }, + () => frappe.timeout(1), () => cur_frm.save(), () => frappe.timeout(1), // check docstatus of attendance before submit [Draft] diff --git a/erpnext/hr/doctype/employee_attendance_tool/test_employee_attendance_tool.js b/erpnext/hr/doctype/employee_attendance_tool/test_employee_attendance_tool.js index 3ec8ac0a593..a24cd1e356b 100644 --- a/erpnext/hr/doctype/employee_attendance_tool/test_employee_attendance_tool.js +++ b/erpnext/hr/doctype/employee_attendance_tool/test_employee_attendance_tool.js @@ -38,9 +38,23 @@ QUnit.test("Test: Employee attendance tool [HR]", function (assert) { () => frappe.set_route("List", "Attendance", "List"), () => frappe.timeout(1), () => { - let marked_attendance = cur_list.data.filter(d => d.attendance_date == date_of_attendance); - assert.equal(marked_attendance.length, 3, - 'all the attendance are marked for correct date'); + return frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Employee", + filters: { + "branch": "Test Branch", + "department": "Test Department", + "company": "Test Company", + "status": "Active" + } + }, + callback: function(r) { + let marked_attendance = cur_list.data.filter(d => d.attendance_date == date_of_attendance); + assert.equal(marked_attendance.length, r.message.length, + 'all the attendance are marked for correct date'); + } + }); }, () => done() ]); diff --git a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.js b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.js index 5d189d2cf27..b8f4fafa6d8 100644 --- a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.js +++ b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.js @@ -10,8 +10,12 @@ QUnit.test("Test: Leave allocation [HR]", function (assert) { () => frappe.set_route("List", "Leave Allocation", "List"), () => frappe.new_doc("Leave Allocation"), () => frappe.timeout(1), - () => frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name'), - (employee) => cur_frm.set_value("employee", employee.message.name), + () => { + frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name', function(r) { + cur_frm.set_value("employee", r.name) + }); + }, + () => frappe.timeout(1), () => cur_frm.set_value("leave_type", "Test Leave type"), () => cur_frm.set_value("to_date", frappe.datetime.add_months(today_date, 2)), // for two months () => cur_frm.set_value("description", "This is just for testing"), diff --git a/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.js b/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.js index 5133c0c2829..c92eca306d5 100644 --- a/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.js +++ b/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.js @@ -21,15 +21,29 @@ QUnit.test("Test: Leave control panel [HR]", function (assert) { // allocate leaves () => frappe.click_button('Allocate'), () => frappe.timeout(1), - () => assert.equal("Message", cur_dialog.title, - "leave alloction message shown"), + () => assert.equal("Message", cur_dialog.title, "leave alloction message shown"), () => frappe.click_button('Close'), () => frappe.set_route("List", "Leave Allocation", "List"), () => frappe.timeout(1), () => { - let leave_allocated = cur_list.data.filter(d => d.leave_type == "Test Leave type"); - assert.equal(3, leave_allocated.length, - 'leave allocation successfully done for all the employees'); + return frappe.call({ + method: "frappe.client.get_list", + args: { + doctype: "Employee", + filters: { + "branch": "Test Branch", + "department": "Test Department", + "company": "Test Company", + "designation": "Test Designation", + "status": "Active" + } + }, + callback: function(r) { + let leave_allocated = cur_list.data.filter(d => d.leave_type == "Test Leave type"); + assert.equal(r.message.length, leave_allocated.length, + 'leave allocation successfully done for all the employees'); + } + }); }, () => done() ]); diff --git a/erpnext/selling/doctype/quotation/tests/test_quotation.js b/erpnext/selling/doctype/quotation/tests/test_quotation.js index 31b17970fe9..4e7afe336d4 100644 --- a/erpnext/selling/doctype/quotation/tests/test_quotation.js +++ b/erpnext/selling/doctype/quotation/tests/test_quotation.js @@ -30,7 +30,7 @@ QUnit.test("test: quotation", function (assert) { () => cur_frm.doc.items[0].rate = 200, () => frappe.timeout(0.3), () => cur_frm.set_value("tc_name", "Test Term 1"), - () => frappe.timeout(0.3), + () => frappe.timeout(0.5), () => cur_frm.save(), () => { // Check Address and Contact Info diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order.js index 6568d5cad09..8f1691cf9ee 100644 --- a/erpnext/selling/doctype/sales_order/tests/test_sales_order.js +++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order.js @@ -27,7 +27,12 @@ QUnit.test("test sales order", function(assert) { }, () => { return frappe.tests.set_form_values(cur_frm, [ - {selling_price_list:'Test-Selling-USD'}, + {selling_price_list:'Test-Selling-USD'} + ]); + }, + () => frappe.timeout(.5), + () => { + return frappe.tests.set_form_values(cur_frm, [ {currency: 'USD'}, {apply_discount_on:'Grand Total'}, {additional_discount_percentage:10} diff --git a/erpnext/selling/page/point_of_sale/tests/test_pos_settings.js b/erpnext/selling/page/point_of_sale/tests/test_pos_settings.js deleted file mode 100644 index 9b02e548025..00000000000 --- a/erpnext/selling/page/point_of_sale/tests/test_pos_settings.js +++ /dev/null @@ -1,17 +0,0 @@ -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('use_pos_in_offline_mode', 0), - () => frappe.timeout(0.2), - () => cur_frm.save(), - () => frappe.timeout(1), - () => frappe.ui.toolbar.clear_cache(), - () => frappe.timeout(10), - () => assert.ok(cur_frm.doc.use_pos_in_offline_mode==0, "Enabled online"), - () => frappe.timeout(2), - () => done() - ]); -}); \ No newline at end of file diff --git a/erpnext/setup/setup_wizard/test_setup_wizard.py b/erpnext/setup/setup_wizard/test_setup_wizard.py index 2db63c1b44b..67b6f43d314 100644 --- a/erpnext/setup/setup_wizard/test_setup_wizard.py +++ b/erpnext/setup/setup_wizard/test_setup_wizard.py @@ -17,12 +17,14 @@ def run_setup_wizard_test(): # Language slide driver.set_select("language", "English (United States)") driver.wait_for_ajax(True) + driver.wait_for('.next-btn', timeout=100) driver.wait_till_clickable(".next-btn").click() # Region slide driver.wait_for_ajax(True) driver.set_select("country", "India") driver.wait_for_ajax(True) + driver.wait_for('.next-btn', timeout=100) driver.wait_till_clickable(".next-btn").click() # Profile slide diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt index 4b62dd6b96e..909216b92eb 100644 --- a/erpnext/tests/ui/tests.txt +++ b/erpnext/tests/ui/tests.txt @@ -50,7 +50,6 @@ erpnext/schools/doctype/room/test_room.js erpnext/schools/doctype/instructor/test_instructor.js erpnext/stock/doctype/warehouse/test_warehouse.js erpnext/manufacturing/doctype/production_order/test_production_order.js #long -erpnext/selling/page/point_of_sale/tests/test_pos_settings.js erpnext/selling/page/point_of_sale/tests/test_point_of_sale.js erpnext/accounts/page/pos/test_pos.js erpnext/selling/doctype/product_bundle/test_product_bundle.js