fix ui tests
diff --git a/erpnext/selling/doctype/quotation/tests/test_quotation.js b/erpnext/selling/doctype/quotation/tests/test_quotation.js
index 1683fa5..37491ed 100644
--- a/erpnext/selling/doctype/quotation/tests/test_quotation.js
+++ b/erpnext/selling/doctype/quotation/tests/test_quotation.js
@@ -10,7 +10,8 @@
 						{"item_code": "Test Product 1"},
 						{"qty": 5}
 					]]
-				}
+				},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => {
@@ -18,7 +19,7 @@
 			assert.ok(cur_frm.doc.items[0].item_name == "Test Product 1", "Added Test Product 1");
 
 			// calculate_taxes_and_totals
-			assert.ok(cur_frm.doc.grand_total === 500, "Total Amount is correct");
+			assert.ok(cur_frm.doc.grand_total === 500, String(cur_frm.doc.grand_total));
 		},
 		() => cur_frm.set_value("customer_address", "Test1-Billing"),
 		() => cur_frm.set_value("shipping_address_name", "Test1-Warehouse"),
@@ -30,6 +31,7 @@
 		() => cur_frm.doc.items[0].rate = 200,
 		() => frappe.timeout(0.3),
 		() => cur_frm.set_value("tc_name", "Test Term 1"),
+		() => cur_frm.set_value("payment_schedule", []),
 		() => frappe.timeout(0.5),
 		() => cur_frm.save(),
 		() => {
diff --git a/erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js b/erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js
index b7b5a47..aeb5d1b 100644
--- a/erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js
+++ b/erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js
@@ -16,13 +16,15 @@
 				]},
 				{customer_address: 'Test1-Billing'},
 				{shipping_address_name: 'Test1-Shipping'},
-				{contact_person: 'Contact 1-Test Customer 1'}
+				{contact_person: 'Contact 1-Test Customer 1'},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => {
 			return frappe.tests.set_form_values(cur_frm, [
 				{apply_discount_on:'Grand Total'},
-				{additional_discount_percentage:10}
+				{additional_discount_percentage:10},
+				{payment_schedule: []}
 			]);
 		},
 		() => cur_frm.save(),
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 daa8131..12661e3 100644
--- a/erpnext/selling/doctype/sales_order/tests/test_sales_order.js
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order.js
@@ -19,13 +19,15 @@
 				{contact_person: 'Contact 1-Test Customer 1'},
 				{taxes_and_charges: 'TEST In State GST'},
 				{tc_name: 'Test Term 1'},
-				{terms: 'This is Test'}
+				{terms: 'This is Test'},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => {
 			return frappe.tests.set_form_values(cur_frm, [
 				{selling_price_list:'Test-Selling-USD'},
-				{currency: 'USD'}
+				{currency: 'USD'},
+				{payment_schedule: []}
 			]);
 		},
 		() => frappe.timeout(1),
diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_discount_on_grand_total.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_discount_on_grand_total.js
index 3247c85..de61a61 100644
--- a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_discount_on_grand_total.js
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_discount_on_grand_total.js
@@ -16,13 +16,15 @@
 				]},
 				{customer_address: 'Test1-Billing'},
 				{shipping_address_name: 'Test1-Shipping'},
-				{contact_person: 'Contact 1-Test Customer 1'}
+				{contact_person: 'Contact 1-Test Customer 1'},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => {
 			return frappe.tests.set_form_values(cur_frm, [
 				{apply_discount_on:'Grand Total'},
-				{additional_discount_percentage:10}
+				{additional_discount_percentage:10},
+				{payment_schedule: []}
 			]);
 		},
 		() => cur_frm.save(),
diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_item_wise_discount.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_item_wise_discount.js
index c745374..2c48108 100644
--- a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_item_wise_discount.js
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_item_wise_discount.js
@@ -18,7 +18,8 @@
 				]},
 				{customer_address: 'Test1-Billing'},
 				{shipping_address_name: 'Test1-Shipping'},
-				{contact_person: 'Contact 1-Test Customer 1'}
+				{contact_person: 'Contact 1-Test Customer 1'},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => cur_frm.save(),
diff --git a/erpnext/tests/ui/make_fixtures.js b/erpnext/tests/ui/make_fixtures.js
index 0bd7491..78ec8f1 100644
--- a/erpnext/tests/ui/make_fixtures.js
+++ b/erpnext/tests/ui/make_fixtures.js
@@ -217,6 +217,25 @@
 			{price_list: '_Test Price List'},
 			{price_list_rate: 200}
 		]
+	},
+	"Payment Term": {
+		"_Test Payment Term": [
+			{payment_term_name: '_Test Payment Term'},
+			{due_date_based_on: 'Day(s) after invoice date'},
+			{invoice_portion: 100},
+			{credit_days: 0}
+		]
+	},
+	"Payment Terms Template": {
+		"_Test Payment Term Template UI": [
+			{template_name: "_Test Payment Term Template UI"},
+			{terms: [
+				[
+					{payment_term: '_Test Payment Term'},
+					{invoice_portion: 100}
+				]
+			]}
+		]
 	}
 });