[ui test] Minor files (#10133)
* added permissions for Administrator user
* updated files
* minor files for future tests
* added entry for all tests
diff --git a/erpnext/schools/doctype/academic_term/test_academic_term.js b/erpnext/schools/doctype/academic_term/test_academic_term.js
index c74071b..688ad54 100644
--- a/erpnext/schools/doctype/academic_term/test_academic_term.js
+++ b/erpnext/schools/doctype/academic_term/test_academic_term.js
@@ -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([
diff --git a/erpnext/schools/doctype/academic_year/test_academic_year.js b/erpnext/schools/doctype/academic_year/test_academic_year.js
index 5123b6e..7bf1772 100644
--- a/erpnext/schools/doctype/academic_year/test_academic_year.js
+++ b/erpnext/schools/doctype/academic_year/test_academic_year.js
@@ -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()
]);
diff --git a/erpnext/schools/doctype/instructor/test_instructor.js b/erpnext/schools/doctype/instructor/test_instructor.js
new file mode 100644
index 0000000..a9e2561
--- /dev/null
+++ b/erpnext/schools/doctype/instructor/test_instructor.js
@@ -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()
+ ]);
+});
diff --git a/erpnext/schools/doctype/room/test_room.js b/erpnext/schools/doctype/room/test_room.js
new file mode 100644
index 0000000..0a93a85
--- /dev/null
+++ b/erpnext/schools/doctype/room/test_room.js
@@ -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()
+ ]);
+});
diff --git a/erpnext/schools/doctype/school_settings/test_school_settings.js b/erpnext/schools/doctype/school_settings/test_school_settings.js
new file mode 100644
index 0000000..6414056
--- /dev/null
+++ b/erpnext/schools/doctype/school_settings/test_school_settings.js
@@ -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()
+ ]);
+});
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_batch_name/test_student_batch_name.js b/erpnext/schools/doctype/student_batch_name/test_student_batch_name.js
new file mode 100644
index 0000000..6a10dc1
--- /dev/null
+++ b/erpnext/schools/doctype/student_batch_name/test_student_batch_name.js
@@ -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()
+ ]);
+});
diff --git a/erpnext/schools/doctype/student_category/test_student_category.js b/erpnext/schools/doctype/student_category/test_student_category.js
new file mode 100644
index 0000000..5e3109a
--- /dev/null
+++ b/erpnext/schools/doctype/student_category/test_student_category.js
@@ -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()
+ ]);
+});
diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py
index 086235e..888099f 100644
--- a/erpnext/setup/utils.py
+++ b/erpnext/setup/utils.py
@@ -107,7 +107,7 @@
_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")
diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt
index 90b8e58..f51c1de 100644
--- a/erpnext/tests/ui/tests.txt
+++ b/erpnext/tests/ui/tests.txt
@@ -19,4 +19,11 @@
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
\ No newline at end of file
+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