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
This commit is contained in:
Nabin Hait
2017-10-20 11:26:17 +05:30
committed by GitHub
parent bb60a59b96
commit b4f5f14438
12 changed files with 28 additions and 64 deletions

View File

@@ -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()
]);
});

View File

@@ -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 @@ QUnit.test("test: purchase order", function(assert) {
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 @@ QUnit.test("test: purchase order", function(assert) {
() => 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");

View File

@@ -27,6 +27,7 @@ QUnit.test("test: request_for_quotation", function(assert) {
{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 @@ QUnit.test("test: request_for_quotation", function(assert) {
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 @@ QUnit.test("test: request_for_quotation", function(assert) {
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");
},

View File

@@ -56,7 +56,8 @@ QUnit.test("test: supplier", function(assert) {
() => 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(),

View File

@@ -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()
]);
});

View File

@@ -27,6 +27,7 @@ QUnit.test("test: supplier quotation", function(assert) {
{terms: 'This is a term'}
]);
},
() => frappe.timeout(3),
() => {
// Get Supplier details
assert.ok(cur_frm.doc.supplier == 'Test Supplier', "Supplier correct");