Timeout increased for setting __newname (#11252)

* Timeout increased for setting __newname

* UI test fixes

* fixed ui test for PO

* ui tests

* ui tests

* ui tests

* ui tests

* ui tests
diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.js b/erpnext/buying/doctype/purchase_order/test_purchase_order.js
deleted file mode 100644
index e9db270..0000000
--- a/erpnext/buying/doctype/purchase_order/test_purchase_order.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* eslint-disable */
-// rename this file from _test_[name] to test_[name] to activate
-// and remove above this line
-
-QUnit.test("test: Purchase Order", function (assert) {
-	let done = assert.async();
-
-	// number of asserts
-	assert.expect(1);
-
-	frappe.run_serially('Purchase Order', [
-		// insert a new Purchase Order
-		() => frappe.tests.make([
-			// values to be set
-			{key: 'value'}
-		]),
-		() => {
-			assert.equal(cur_frm.doc.key, 'value');
-		},
-		() => done()
-	]);
-
-});
diff --git a/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js b/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js
index 6605a65..d65fe99 100644
--- a/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js
@@ -1,7 +1,7 @@
 QUnit.module('Buying');
 
 QUnit.test("test: purchase order", function(assert) {
-	assert.expect(11);
+	assert.expect(17);
 	let done = assert.async();
 
 	frappe.run_serially([
@@ -53,7 +53,7 @@
 			assert.ok(cur_frm.doc.items[1].qty == 2, "Quantity correct");
 			assert.ok(cur_frm.doc.items[1].schedule_date == cur_frm.doc.schedule_date, "Schedule Date correct");
 			// Calculate total
-			assert.ok(cur_frm.doc.total == 500, "Total correct");
+			assert.ok(cur_frm.doc.total == 700, "Total correct");
 			// Get terms
 			assert.ok(cur_frm.doc.terms == 'This is a term.', "Terms correct");
 		},
@@ -70,7 +70,7 @@
 
 		() => frappe.tests.click_button('Submit'),
 		() => frappe.tests.click_button('Yes'),
-		() => frappe.timeout(0.3),
+		() => frappe.timeout(1),
 
 		() => {
 			assert.ok(cur_frm.doc.status == 'To Receive and Bill', "Submitted successfully");
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 a4d68aa..1fcfe75 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
@@ -27,6 +27,7 @@
 				{tc_name: 'Test Term 1'}
 			]);
 		},
+		() => frappe.timeout(3),
 		() => {
 			assert.ok(cur_frm.doc.transaction_date == date, "Date correct");
 			assert.ok(cur_frm.doc.company == cur_frm.doc.company, "Company correct");
@@ -38,7 +39,7 @@
 			assert.ok(cur_frm.doc.message_for_supplier == 'Please supply the specified items at the best possible rates', "Reply correct");
 			assert.ok(cur_frm.doc.tc_name == 'Test Term 1', "Term name correct");
 		},
-		() => frappe.timeout(0.3),
+		() => frappe.timeout(3),
 		() => cur_frm.print_doc(),
 		() => frappe.timeout(1),
 		() => {
@@ -65,7 +66,7 @@
 			assert.ok(cur_frm.doc.docstatus == 1, "Quotation request submitted");
 		},
 		() => frappe.click_button('Send Supplier Emails'),
-		() => frappe.timeout(4),
+		() => frappe.timeout(6),
 		() => {
 			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/buying/doctype/supplier/test_supplier.js b/erpnext/buying/doctype/supplier/test_supplier.js
index 99a5bc6..05ea044 100644
--- a/erpnext/buying/doctype/supplier/test_supplier.js
+++ b/erpnext/buying/doctype/supplier/test_supplier.js
@@ -56,7 +56,8 @@
 		() => frappe.click_button('New Contact'),
 		() => {
 			return frappe.tests.set_form_values(cur_frm, [
-				{first_name: "Contact 3"}
+				{first_name: "Contact 3"},
+				{email_id: "test@supplier.com"}
 			]);
 		},
 		() => cur_frm.save(),
diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js
deleted file mode 100644
index 7097a6d..0000000
--- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* eslint-disable */
-// rename this file from _test_[name] to test_[name] to activate
-// and remove above this line
-
-QUnit.test("test: Supplier Quotation", function (assert) {
-	let done = assert.async();
-
-	// number of asserts
-	assert.expect(1);
-
-	frappe.run_serially('Supplier Quotation', [
-		// insert a new Supplier Quotation
-		() => frappe.tests.make([
-			// values to be set
-			{key: 'value'}
-		]),
-		() => {
-			assert.equal(cur_frm.doc.key, 'value');
-		},
-		() => done()
-	]);
-
-});
diff --git a/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js
index 76be06c..54117fe 100644
--- a/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js
+++ b/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js
@@ -27,6 +27,7 @@
 				{terms: 'This is a term'}
 			]);
 		},
+		() => frappe.timeout(3),
 		() => {
 			// Get Supplier details
 			assert.ok(cur_frm.doc.supplier == 'Test Supplier', "Supplier correct");
diff --git a/erpnext/hr/doctype/offer_letter/test_offer_letter.js b/erpnext/hr/doctype/offer_letter/test_offer_letter.js
index 2069532..5b61d64 100644
--- a/erpnext/hr/doctype/offer_letter/test_offer_letter.js
+++ b/erpnext/hr/doctype/offer_letter/test_offer_letter.js
@@ -27,7 +27,7 @@
 				]},
 			]);
 		},
-		() => frappe.timeout(8),
+		() => frappe.timeout(12),
 		() => frappe.click_button('Submit'),
 		() => frappe.timeout(2),
 		() => frappe.click_button('Yes'),
diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.js b/erpnext/hr/doctype/salary_slip/test_salary_slip.js
index a49c973..619e530 100644
--- a/erpnext/hr/doctype/salary_slip/test_salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.js
@@ -15,7 +15,7 @@
 					{ employee: employee_name}
 				]);
 			},
-			() => frappe.timeout(1),
+			() => frappe.timeout(3),
 			() => {
 			// To check if all the calculations are correctly done
 				if(ename === 'Test Employee 1')
@@ -43,7 +43,7 @@
 		() => salary_slip('Test Employee 1'),
 		() => frappe.timeout(6),
 		() => salary_slip('Test Employee 3'),
-		() => frappe.timeout(3),
+		() => frappe.timeout(5),
 		() => done()
 	]);
 });
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_structure/test_salary_structure.js b/erpnext/hr/doctype/salary_structure/test_salary_structure.js
index 5e028cf..542fa50 100644
--- a/erpnext/hr/doctype/salary_structure/test_salary_structure.js
+++ b/erpnext/hr/doctype/salary_structure/test_salary_structure.js
@@ -1,5 +1,5 @@
 QUnit.test("test Salary Structure", function(assert) {
-	assert.expect(6);
+	assert.expect(7);
 	let done = assert.async();
 	let employee_name1;
 
@@ -9,6 +9,7 @@
 				employee_name1 = r.name;
 			}
 		),
+		() => frappe.timeout(5),
 		() => frappe.db.get_value('Employee', {'employee_name': "Test Employee 3"}, 'name',
 			(r) => {
 			// Creating Salary Structure for employees);
@@ -48,12 +49,14 @@
 				]);
 			}
 		),
-		() => frappe.timeout(3),
+		() => frappe.timeout(15),
 		() => {
-		// To check if all the fields are correctly set
-			assert.ok(cur_frm.doc.employees[0].employee_name.includes('Test Employee 1') &&
-				cur_frm.doc.employees[1].employee_name.includes('Test Employee 3'),
-			'Employee names are correctly set');
+			// To check if all the fields are correctly set
+			assert.ok(cur_frm.doc.employees[0].employee_name=='Test Employee 1',
+				'Employee 1 name correctly set');
+
+			assert.ok(cur_frm.doc.employees[1].employee_name=='Test Employee 3',
+				'Employee 2 name correctly set');
 
 			assert.ok(cur_frm.doc.employees[0].base==25000,
 				'Base value for first employee is correctly set');
diff --git a/erpnext/manufacturing/doctype/operation/test_operation.js b/erpnext/manufacturing/doctype/operation/test_operation.js
index 5aafe42..42553ce 100644
--- a/erpnext/manufacturing/doctype/operation/test_operation.js
+++ b/erpnext/manufacturing/doctype/operation/test_operation.js
@@ -14,7 +14,7 @@
 				]
 			);
 		},
-		() => frappe.timeout(1),
+		() => frappe.timeout(3),
 		() => {
 			assert.ok(cur_frm.docname.includes('Assemble Keyboard'),
 				'Assemble Keyboard created successfully');
@@ -31,7 +31,7 @@
 				]
 			);
 		},
-		() => frappe.timeout(1),
+		() => frappe.timeout(3),
 
 		// Create a CPU operation
 		() => {
@@ -42,7 +42,7 @@
 				]
 			);
 		},
-		() => frappe.timeout(1),
+		() => frappe.timeout(3),
 
 		() => done()
 	]);
diff --git a/erpnext/restaurant/doctype/restaurant/test_restaurant.js b/erpnext/restaurant/doctype/restaurant/test_restaurant.js
index 1cc7c7f..6e1f141 100644
--- a/erpnext/restaurant/doctype/restaurant/test_restaurant.js
+++ b/erpnext/restaurant/doctype/restaurant/test_restaurant.js
@@ -18,6 +18,7 @@
 				{invoice_series_prefix: 'Test-Rest-1-Inv-'}
 			])
 		},
+		() => frappe.timeout(3),
 		() => {
 			assert.equal(cur_frm.doc.company, 'Test Company');
 		},
@@ -29,6 +30,7 @@
 				{invoice_series_prefix: 'Test-Rest-3-Inv-'}
 			]);
 		},
+		() => frappe.timeout(3),
 		() => {
 			assert.equal(cur_frm.doc.company, 'Test Company');
 		},
diff --git a/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
index 25057d8..7dca139 100644
--- a/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
+++ b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
@@ -50,6 +50,7 @@
 				]}
 			]);
 		},
+		() => frappe.timeout(2),
 		() => {
 			return frappe.tests.make("Restaurant Menu", [
 				{__newname: 'Restaurant Menu 2'},
@@ -66,6 +67,7 @@
 				]}
 			]);
 		},
+		() => frappe.timeout(2),
 		() => frappe.set_route('Form', 'Restaurant', 'Test Restaurant 1'),
 		() => cur_frm.set_value('active_menu', 'Restaurant Menu 1'),
 		() => cur_frm.save(),