[UI Test] UI test added for Pricing Rule (#10237)

* [UI Test] UI test added for Pricing Rule

* [mod]minor chages in pricing rule test

* [fix] codacy fixed
diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.js b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.js
new file mode 100644
index 0000000..4d34033
--- /dev/null
+++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.js
@@ -0,0 +1,28 @@
+QUnit.module('Pricing Rule"');
+
+QUnit.test("test pricing rule", function(assert) {
+	assert.expect(2);
+	let done = assert.async();
+	frappe.run_serially([
+		() => {
+			return frappe.tests.make("Pricing Rule", [
+				{title: 'Test Pricing Rule'},
+				{item_code:'Test Product 2'},
+				{selling:1},
+				{applicable_for:'Customer'},
+				{customer:'Test Customer 3'},
+				{min_qty:1},
+				{max_qty:20},
+				{valid_upto: frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)},
+				{discount_percentage:10},
+				{for_price_list:'Standard Selling'}
+			]);
+		},
+		() => {
+			assert.ok(cur_frm.doc.item_code=='Test Product 2');
+			assert.ok(cur_frm.doc.customer=='Test Customer 3');
+		},
+		() => done()
+	]);
+});
+
diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt
index a685d2b..fb86b7c 100644
--- a/erpnext/tests/ui/tests.txt
+++ b/erpnext/tests/ui/tests.txt
@@ -2,6 +2,7 @@
 erpnext/setup/doctype/company/tests/test_company.js
 erpnext/accounts/doctype/account/test_account.js
 erpnext/accounts/doctype/account/test_make_tax_account.js
+erpnext/accounts/doctype/pricing_rule/test_pricing_rule.js
 erpnext/accounts/doctype/sales_taxes_and_charges_template/test_sales_taxes_and_charges_template.js
 erpnext/accounts/doctype/shipping_rule/test_shipping_rule.js
 erpnext/crm/doctype/lead/test_lead.js