Fix UI tests (#11309)

* decrease the timeout

* delete the duplicate test
This commit is contained in:
Manas Solanki 2017-10-25 11:42:22 +05:30 committed by Nabin Hait
parent 5c5a853894
commit a5eee4629f
4 changed files with 10 additions and 47 deletions

View File

@ -27,13 +27,13 @@ QUnit.test("Test: Offer Letter [HR]", function (assert) {
]},
]);
},
() => frappe.timeout(12),
() => frappe.timeout(10),
() => frappe.click_button('Submit'),
() => frappe.timeout(2),
() => frappe.click_button('Yes'),
() => frappe.timeout(8),
() => frappe.timeout(5),
// To check if the fields are correctly set
() => {
// To check if the fields are correctly set
assert.ok(cur_frm.get_field('status').value=='Accepted',
'Status of job offer is correct');
assert.ok(cur_frm.get_field('designation').value=='Software Developer',
@ -45,7 +45,7 @@ QUnit.test("Test: Offer Letter [HR]", function (assert) {
() => {
assert.ok(cur_list.data[0].docstatus==1,'Offer Letter Submitted successfully');
},
() => frappe.timeout(4),
() => frappe.timeout(2),
() => done()
]);
});

View File

@ -1,7 +1,7 @@
QUnit.module('hr');
QUnit.test("Test: Training Event [HR]", function (assert) {
assert.expect(4);
assert.expect(5);
let done = assert.async();
let employee_name;
@ -21,7 +21,8 @@ QUnit.test("Test: Training Event [HR]", function (assert) {
{ employees: [
[
{employee: employee_name},
{employee_name: 'Test Employee 1'}
{employee_name: 'Test Employee 1'},
{attendance: 'Optional'}
]
]},
]);
@ -41,6 +42,9 @@ QUnit.test("Test: Training Event [HR]", function (assert) {
assert.ok(cur_frm.doc.employees[0].employee_name=='Test Employee 1',
'Attendee Employee is correctly set');
assert.ok(cur_frm.doc.employees[0].attendance=='Optional',
'Attendance is correctly set');
},
() => frappe.set_route('List','Training Event','List'),

View File

@ -1,40 +0,0 @@
QUnit.module('hr');
QUnit.test("test: Training Event", function (assert) {
// number of asserts
assert.expect(1);
let done = assert.async();
frappe.run_serially([
// insert a new Training Event
() => frappe.set_route("List", "Training Event", "List"),
() => frappe.new_doc("Training Event"),
() => frappe.timeout(1),
() => frappe.click_link('Edit in full page'),
() => cur_frm.set_value("event_name", "Test Event " + frappe.utils.get_random(10)),
() => cur_frm.set_value("start_time", "2017-07-26, 2:00 pm PDT"),
() => cur_frm.set_value("end_time", "2017-07-26, 2:30 pm PDT"),
() => cur_frm.set_value("introduction", "This is a test report"),
() => cur_frm.set_value("location", "Fake office"),
() => frappe.click_button('Add Row'),
() => frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name'),
(r) => {
console.log(r);
return cur_frm.fields_dict.employees.grid.grid_rows[0].doc.employee = r.message.name;
},
() => {
return cur_frm.fields_dict.employees.grid.grid_rows[0].doc.attendance = "Optional";
},
() => frappe.click_button('Save'),
() => frappe.timeout(2),
() => frappe.click_button('Submit'),
() => frappe.timeout(2),
() => frappe.click_button('Yes'),
() => frappe.timeout(1),
() => {
assert.equal(cur_frm.doc.docstatus, 1);
},
() => done()
]);
});

View File

@ -72,7 +72,6 @@ erpnext/hr/doctype/appraisal/test_appraisal.js
erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.js
erpnext/hr/doctype/expense_claim/test_expense_claim.js
erpnext/hr/doctype/training_event/tests/test_training_event.js
erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js
erpnext/hr/doctype/training_result_employee/test_training_result.js
erpnext/hr/doctype/training_feedback/test_training_feedback.js
erpnext/hr/doctype/loan_type/test_loan_type.js