UI test cases

This commit is contained in:
tunde 2017-09-26 01:32:08 +01:00
parent c4b0d17c08
commit 192587fe56
5 changed files with 23 additions and 7 deletions

View File

@ -19,7 +19,8 @@ QUnit.test("test purchase invoice", function(assert) {
{contact_person: 'Contact 3-Test Supplier'},
{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'}
]);
},
() => cur_frm.save(),
@ -33,6 +34,9 @@ QUnit.test("test purchase invoice", function(assert) {
// grand_total Calculated
assert.ok(cur_frm.doc.grand_total==590, "Grad Total correct");
assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
},
() => frappe.tests.click_button('Submit'),
() => frappe.tests.click_button('Yes'),

View File

@ -1,7 +1,7 @@
QUnit.module('Sales Invoice');
QUnit.test("test sales Invoice", function(assert) {
assert.expect(4);
assert.expect(6);
let done = assert.async();
frappe.run_serially([
() => {
@ -19,7 +19,8 @@ QUnit.test("test sales Invoice", function(assert) {
{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'}
]);
},
() => cur_frm.save(),
@ -31,7 +32,10 @@ QUnit.test("test sales Invoice", function(assert) {
// get tax account head details
assert.ok(cur_frm.doc.taxes[0].account_head=='CGST - '+frappe.get_abbr(frappe.defaults.get_default('Company')), " Account Head abbr correct");
// grand_total Calculated
assert.ok(cur_frm.doc.grand_total==590, "Grad Total correct");
assert.ok(cur_frm.doc.grand_total==590, "Grand Total correct");
assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
},
() => frappe.tests.click_button('Submit'),

View File

@ -19,7 +19,8 @@ QUnit.test("test sales Invoice with payment", function(assert) {
{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'}
]);
},
() => cur_frm.save(),
@ -43,6 +44,7 @@ QUnit.test("test sales Invoice with payment", function(assert) {
() => { cur_frm.set_value('paid_to','Cash - '+frappe.get_abbr(frappe.defaults.get_default('Company')));},
() => {cur_frm.set_value('reference_no','TEST1234');},
() => {cur_frm.set_value('reference_date',frappe.datetime.add_days(frappe.datetime.nowdate(), 0));},
() => cur_frm.set_value("payment_schedule", []),
() => cur_frm.save(),
() => {
// get payment details

View File

@ -1,5 +1,5 @@
QUnit.test("test: quotation", function (assert) {
assert.expect(10);
assert.expect(12);
let done = assert.async();
frappe.run_serially([
() => {
@ -49,6 +49,9 @@ QUnit.test("test: quotation", function (assert) {
// Check Terms and Condtions
assert.ok(cur_frm.doc.tc_name == "Test Term 1", "Terms and Conditions Checked");
assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
},
() => done()
]);

View File

@ -1,7 +1,7 @@
QUnit.module('Sales Order');
QUnit.test("test sales order", function(assert) {
assert.expect(10);
assert.expect(12);
let done = assert.async();
frappe.run_serially([
() => {
@ -50,6 +50,9 @@ QUnit.test("test sales order", function(assert) {
() => cur_frm.print_doc(),
() => frappe.timeout(1),
() => {
assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
assert.ok($('.btn-print-print').is(':visible'), "Print Format Available");
frappe.timeout(1);
assert.ok($(".section-break+ .section-break .column-break:nth-child(1) .data-field:nth-child(1) .value").text().includes("Billing Street 1"), "Print Preview Works As Expected");