[ui test] Minor files (#10133)
* added permissions for Administrator user * updated files * minor files for future tests * added entry for all tests
This commit is contained in:
parent
7b764d03c2
commit
c54510660e
@ -1,8 +1,7 @@
|
||||
// Testing Setup Module in Schools
|
||||
QUnit.module('setup');
|
||||
QUnit.module('schools');
|
||||
|
||||
// Testing Academic Term option
|
||||
QUnit.test('test academic term', function(assert){
|
||||
QUnit.test('Test: Academic Term', function(assert){
|
||||
assert.expect(4);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
|
@ -1,23 +1,22 @@
|
||||
// Testing Setup Module in Schools
|
||||
QUnit.module('setup');
|
||||
QUnit.module('schools');
|
||||
|
||||
// Testing Academic Year Testing option
|
||||
QUnit.test('test academic year', function(assert){
|
||||
QUnit.test('Test: Academic Year', function(assert){
|
||||
assert.expect(3);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Academic Year', [
|
||||
{academic_year_name: '2015-16'},
|
||||
{year_start_date: '2015-07-20'},
|
||||
{year_end_date:'2016-06-20'},
|
||||
{academic_year_name: '2016-17'},
|
||||
{year_start_date: '2016-07-20'},
|
||||
{year_end_date:'2017-06-20'},
|
||||
]);
|
||||
},
|
||||
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.academic_year_name=='2015-16');
|
||||
assert.ok(cur_frm.doc.year_start_date=='2015-07-20');
|
||||
assert.ok(cur_frm.doc.year_end_date=='2016-06-20');
|
||||
assert.ok(cur_frm.doc.academic_year_name=='2016-17');
|
||||
assert.ok(cur_frm.doc.year_start_date=='2016-07-20');
|
||||
assert.ok(cur_frm.doc.year_end_date=='2017-06-20');
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
|
20
erpnext/schools/doctype/instructor/test_instructor.js
Normal file
20
erpnext/schools/doctype/instructor/test_instructor.js
Normal file
@ -0,0 +1,20 @@
|
||||
// Testing Setup Module in Schools
|
||||
QUnit.module('schools');
|
||||
|
||||
QUnit.test('Test: Instructor', function(assert){
|
||||
assert.expect(2);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make("Instructor", [
|
||||
{instructor_name: 'Instructor 1'},
|
||||
{department: 'Test Department'}
|
||||
]);
|
||||
},
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.instructor_name == 'Instructor 1');
|
||||
assert.ok(cur_frm.doc.department = 'Test Department');
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
});
|
22
erpnext/schools/doctype/room/test_room.js
Normal file
22
erpnext/schools/doctype/room/test_room.js
Normal file
@ -0,0 +1,22 @@
|
||||
// Testing Setup Module in Schools
|
||||
QUnit.module('schools');
|
||||
|
||||
QUnit.test('Test: Room', function(assert){
|
||||
assert.expect(3);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Room', [
|
||||
{room_name: 'Room 1'},
|
||||
{room_number: '1'},
|
||||
{seating_capacity: '60'},
|
||||
]);
|
||||
},
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.room_name == 'Room 1');
|
||||
assert.ok(cur_frm.doc.room_number = '1');
|
||||
assert.ok(cur_frm.doc.seating_capacity = '60');
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
});
|
@ -0,0 +1,25 @@
|
||||
// Testing Setup Module in Schools
|
||||
QUnit.module('schools');
|
||||
|
||||
QUnit.test("Test: School Settings", function(assert){
|
||||
assert.expect(3);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => frappe.set_route("List", "School Settings"),
|
||||
() => frappe.timeout(0.4),
|
||||
() => {
|
||||
return frappe.tests.set_form_values(cur_frm, [
|
||||
{current_academic_year: '2016-17'},
|
||||
{current_academic_term: '2016-17 (Semester 1)'},
|
||||
{attendance_freeze_date: '2016-07-20'}
|
||||
]);
|
||||
},
|
||||
() => {
|
||||
cur_frm.save();
|
||||
assert.ok(cur_frm.doc.current_academic_year=="2016-17");
|
||||
assert.ok(cur_frm.doc.current_academic_term=="2016-17 (Semester 1)");
|
||||
assert.ok(cur_frm.doc.attendance_freeze_date=="2016-07-20");
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
});
|
@ -0,0 +1,19 @@
|
||||
// Testing Setup Module in Schools
|
||||
QUnit.module('schools');
|
||||
|
||||
QUnit.test('Test: Student Batch Name', function(assert){
|
||||
assert.expect(1);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Student Batch Name', [
|
||||
{batch_name: 'A'}
|
||||
]);
|
||||
},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.batch_name=='A');
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
});
|
@ -0,0 +1,19 @@
|
||||
// Testing Setup Module in Schools
|
||||
QUnit.module('schools');
|
||||
|
||||
QUnit.test('Test: Student Category', function(assert){
|
||||
assert.expect(1);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Student Category', [
|
||||
{category: 'Reservation'}
|
||||
]);
|
||||
},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.name=='Reservation');
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
});
|
@ -107,7 +107,7 @@ def enable_all_roles_and_domains():
|
||||
_role.save()
|
||||
|
||||
# add all roles to users
|
||||
user = frappe.get_doc("User", "test@erpnext.com")
|
||||
user = frappe.get_doc("User", "Administrator")
|
||||
user.add_roles(*[role.get("name") for role in roles])
|
||||
|
||||
domains = frappe.get_list("Domain")
|
||||
|
@ -20,3 +20,10 @@ erpnext/hr/doctype/employment_type/test_employment_type.js
|
||||
erpnext/hr/doctype/employee/test_employee.js
|
||||
erpnext/hr/doctype/employee_attendance_tool/test_employee_attendance_tool.js
|
||||
erpnext/hr/doctype/attendance/test_attendance.js
|
||||
erpnext/schools/doctype/academic_year/test_academic_year.js
|
||||
erpnext/schools/doctype/academic_term/test_academic_term.js
|
||||
erpnext/schools/doctype/school_settings/test_school_settings.js
|
||||
erpnext/schools/doctype/student_batch_name/test_student_batch_name.js
|
||||
erpnext/schools/doctype/student_category/test_student_category.js
|
||||
erpnext/schools/doctype/room/test_room.js
|
||||
erpnext/schools/doctype/instructor/test_instructor.js
|
||||
|
Loading…
x
Reference in New Issue
Block a user