[UI Test] UI Test for Sales Order Cancel, amend and save (#10570)
diff --git a/erpnext/selling/doctype/quotation/tests/test_quotation_submit_cancel_amend.js b/erpnext/selling/doctype/quotation/tests/test_quotation_submit_cancel_amend.js
new file mode 100644
index 0000000..26a099e
--- /dev/null
+++ b/erpnext/selling/doctype/quotation/tests/test_quotation_submit_cancel_amend.js
@@ -0,0 +1,41 @@
+QUnit.module('Quotation');
+
+QUnit.test("test quotation submit cancel amend", function(assert) {
+ assert.expect(2);
+ let done = assert.async();
+ frappe.run_serially([
+ () => {
+ return frappe.tests.make('Quotation', [
+ {customer: 'Test Customer 1'},
+ {items: [
+ [
+ {'delivery_date': frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)},
+ {'qty': 5},
+ {'item_code': 'Test Product 1'}
+ ]
+ ]},
+ {customer_address: 'Test1-Billing'},
+ {shipping_address_name: 'Test1-Shipping'},
+ {contact_person: 'Contact 1-Test Customer 1'}
+ ]);
+ },
+ () => cur_frm.save(),
+ () => {
+ // get_item_details
+ assert.ok(cur_frm.doc.items[0].item_name=='Test Product 1', "Item name correct");
+ // get uom details
+ assert.ok(cur_frm.doc.grand_total== 500, "Grand total correct ");
+
+ },
+ () => frappe.tests.click_button('Submit'),
+ () => frappe.tests.click_button('Yes'),
+ () => frappe.timeout(1),
+ () => frappe.tests.click_button('Close'),
+ () => frappe.tests.click_button('Cancel'),
+ () => frappe.tests.click_button('Yes'),
+ () => frappe.timeout(0.5),
+ () => frappe.tests.click_button('Amend'),
+ () => cur_frm.save(),
+ () => done()
+ ]);
+});
diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt
index 12e2da8..a8b8d7e 100644
--- a/erpnext/tests/ui/tests.txt
+++ b/erpnext/tests/ui/tests.txt
@@ -111,4 +111,5 @@
erpnext/schools/doctype/assessment_result_tool/test_assessment_result_tool.js
erpnext/accounts/doctype/journal_entry/test_journal_entry.js
erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js
-erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js
\ No newline at end of file
+erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js
+erpnext/selling/doctype/quotation/tests/test_quotation_submit_cancel_amend.js
\ No newline at end of file