UI test fixed for supplier quotation (#11260)

* UI test fixed for supplier quotation

* ui test fixes for purchase order

* Fixed number of assertion in student admission test

* Fixed multiple ui tests

* ui tests
This commit is contained in:
Nabin Hait 2017-10-21 10:44:30 +05:30 committed by GitHub
parent 5a4d5bfaf2
commit 4825eccad5
8 changed files with 18 additions and 27 deletions

View File

@ -1,7 +1,7 @@
QUnit.module('Buying');
QUnit.test("test: purchase order", function(assert) {
assert.expect(17);
assert.expect(16);
let done = assert.async();
frappe.run_serially([
@ -40,7 +40,6 @@ QUnit.test("test: purchase order", function(assert) {
// Get supplier details
assert.ok(cur_frm.doc.supplier_name == 'Test Supplier', "Supplier name correct");
assert.ok(cur_frm.doc.schedule_date == frappe.datetime.add_days(frappe.datetime.now_date(), 1), "Schedule Date correct");
assert.ok($('div.control-value.like-disabled-input.for-description').text().includes('Contact 3'), "Contact display correct");
assert.ok(cur_frm.doc.contact_email == 'test@supplier.com', "Contact email correct");
// Get item details
assert.ok(cur_frm.doc.items[0].item_name == 'Test Product 4', "Item name correct");

View File

@ -33,7 +33,7 @@ QUnit.test("test: supplier quotation", function(assert) {
assert.ok(cur_frm.doc.supplier == 'Test Supplier', "Supplier correct");
assert.ok(cur_frm.doc.company == cur_frm.doc.company, "Company correct");
// Get Contact details
assert.ok(cur_frm.doc.contact_display == 'Contact 3', "Conatct correct");
assert.ok(cur_frm.doc.contact_person == 'Contact 3-Test Supplier', "Conatct correct");
assert.ok(cur_frm.doc.contact_email == 'test@supplier.com', "Email correct");
// Get uom
assert.ok(cur_frm.doc.items[0].uom == 'Unit', "Multi uom correct");

View File

@ -15,7 +15,8 @@ QUnit.test("test: Restaurant", function (assert) {
// values to be set
{__newname: 'Test Restaurant 1'},
{company: 'Test Company'},
{invoice_series_prefix: 'Test-Rest-1-Inv-'}
{invoice_series_prefix: 'Test-Rest-1-Inv-'},
{default_customer: 'Test Customer 1'}
])
},
() => frappe.timeout(3),
@ -27,7 +28,8 @@ QUnit.test("test: Restaurant", function (assert) {
// values to be set
{__newname: 'Test Restaurant 2'},
{company: 'Test Company'},
{invoice_series_prefix: 'Test-Rest-3-Inv-'}
{invoice_series_prefix: 'Test-Rest-3-Inv-'},
{default_customer: 'Test Customer 2'}
]);
},
() => frappe.timeout(3),

View File

@ -16,7 +16,7 @@ QUnit.test("test: Restaurant Menu", function (assert) {
{item_group: "Products"},
{is_stock_item: 1},
],
"Test Product 3": [
"Food Item 3": [
{item_code: "Food Item 3"},
{item_group: "Products"},
{is_stock_item: 1},

View File

@ -2,7 +2,7 @@
QUnit.module('schools');
QUnit.test('Test: Student Admission', function(assert) {
assert.expect(9);
assert.expect(10);
let done = assert.async();
frappe.run_serially([
() => {

View File

@ -41,9 +41,14 @@ class StudentApplicant(Document):
def validation_from_student_admission(self):
student_admission = get_student_admission_data(self.student_admission, self.program)
if student_admission:
if not (getdate(student_admission.minimum_age) >= getdate(self.date_of_birth) >=
getdate(student_admission.maximum_age)):
frappe.throw(_("Not eligible for the admission in this program as per DOB"))
if ((
student_admission.minimum_age
and getdate(student_admission.minimum_age) > getdate(self.date_of_birth)
) or (
student_admission.maximum_age
and getdate(student_admission.maximum_age) < getdate(self.date_of_birth)
)):
frappe.throw(_("Not eligible for the admission in this program as per DOB"))
def on_payment_authorized(self, *args, **kwargs):
self.db_set('paid', 1)

View File

@ -4,15 +4,10 @@ QUnit.module('schools');
QUnit.test('Test: Student Group', function(assert){
assert.expect(2);
let done = assert.async();
let instructor_code;
let group_based_on = ["test-batch-wise-group", "test-course-wise-group"];
let tasks = [];
frappe.run_serially([
// Saving Instructor code beforehand
() => frappe.db.get_value('Instructor', {'instructor_name': 'Instructor 1'}, 'name'),
(instructor) => {instructor_code = instructor.message.name;},
// Creating a Batch and Course based group
() => {
return frappe.tests.make('Student Group', [
@ -22,12 +17,7 @@ QUnit.test('Test: Student Group', function(assert){
{group_based_on: 'Batch'},
{student_group_name: group_based_on[0]},
{max_strength: 10},
{batch: 'A'},
{instructors: [
[
{instructor: instructor_code}
]
]}
{batch: 'A'}
]);
},
() => {
@ -40,11 +30,6 @@ QUnit.test('Test: Student Group', function(assert){
{max_strength: 10},
{batch: 'A'},
{course: 'Test_Sub'},
{instructors: [
[
{instructor: instructor_code}
]
]}
]);
},

View File

@ -131,6 +131,6 @@ erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_serialize_i
erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js
erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_last_purchase_rate.js
erpnext/restaurant/doctype/restaurant/test_restaurant.js
erpnext/restaurant/doctype/test_restaurant_table/test_restaurant_table.js
erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.js
erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.js