Fixed multiple ui tests
This commit is contained in:
parent
80b902cea6
commit
de9eebe51c
@ -65,7 +65,7 @@ QUnit.test("test: request_for_quotation", function(assert) {
|
|||||||
assert.ok(cur_frm.doc.docstatus == 1, "Quotation request submitted");
|
assert.ok(cur_frm.doc.docstatus == 1, "Quotation request submitted");
|
||||||
},
|
},
|
||||||
() => frappe.click_button('Send Supplier Emails'),
|
() => frappe.click_button('Send Supplier Emails'),
|
||||||
() => frappe.timeout(3),
|
() => frappe.timeout(4),
|
||||||
() => {
|
() => {
|
||||||
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");
|
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");
|
||||||
},
|
},
|
||||||
|
@ -14,8 +14,12 @@ QUnit.test("Test: Attendance [HR]", function (assert) {
|
|||||||
"Form for new Attendance opened successfully."),
|
"Form for new Attendance opened successfully."),
|
||||||
// set values in form
|
// set values in form
|
||||||
() => cur_frm.set_value("company", "Test Company"),
|
() => cur_frm.set_value("company", "Test Company"),
|
||||||
() => frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name'),
|
() => {
|
||||||
(employee) => cur_frm.set_value("employee", employee.message.name),
|
frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name', function(r) {
|
||||||
|
cur_frm.set_value("employee", r.name)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
() => frappe.timeout(1),
|
||||||
() => cur_frm.save(),
|
() => cur_frm.save(),
|
||||||
() => frappe.timeout(1),
|
() => frappe.timeout(1),
|
||||||
// check docstatus of attendance before submit [Draft]
|
// check docstatus of attendance before submit [Draft]
|
||||||
|
@ -38,9 +38,23 @@ QUnit.test("Test: Employee attendance tool [HR]", function (assert) {
|
|||||||
() => frappe.set_route("List", "Attendance", "List"),
|
() => frappe.set_route("List", "Attendance", "List"),
|
||||||
() => frappe.timeout(1),
|
() => frappe.timeout(1),
|
||||||
() => {
|
() => {
|
||||||
let marked_attendance = cur_list.data.filter(d => d.attendance_date == date_of_attendance);
|
return frappe.call({
|
||||||
assert.equal(marked_attendance.length, 3,
|
method: "frappe.client.get_list",
|
||||||
'all the attendance are marked for correct date');
|
args: {
|
||||||
|
doctype: "Employee",
|
||||||
|
filters: {
|
||||||
|
"branch": "Test Branch",
|
||||||
|
"department": "Test Department",
|
||||||
|
"company": "Test Company",
|
||||||
|
"status": "Active"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
callback: function(r) {
|
||||||
|
let marked_attendance = cur_list.data.filter(d => d.attendance_date == date_of_attendance);
|
||||||
|
assert.equal(marked_attendance.length, r.message.length,
|
||||||
|
'all the attendance are marked for correct date');
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
() => done()
|
() => done()
|
||||||
]);
|
]);
|
||||||
|
@ -10,8 +10,12 @@ QUnit.test("Test: Leave allocation [HR]", function (assert) {
|
|||||||
() => frappe.set_route("List", "Leave Allocation", "List"),
|
() => frappe.set_route("List", "Leave Allocation", "List"),
|
||||||
() => frappe.new_doc("Leave Allocation"),
|
() => frappe.new_doc("Leave Allocation"),
|
||||||
() => frappe.timeout(1),
|
() => frappe.timeout(1),
|
||||||
() => frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name'),
|
() => {
|
||||||
(employee) => cur_frm.set_value("employee", employee.message.name),
|
frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name', function(r) {
|
||||||
|
cur_frm.set_value("employee", r.name)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
() => frappe.timeout(1),
|
||||||
() => cur_frm.set_value("leave_type", "Test Leave type"),
|
() => cur_frm.set_value("leave_type", "Test Leave type"),
|
||||||
() => cur_frm.set_value("to_date", frappe.datetime.add_months(today_date, 2)), // for two months
|
() => cur_frm.set_value("to_date", frappe.datetime.add_months(today_date, 2)), // for two months
|
||||||
() => cur_frm.set_value("description", "This is just for testing"),
|
() => cur_frm.set_value("description", "This is just for testing"),
|
||||||
|
@ -21,15 +21,29 @@ QUnit.test("Test: Leave control panel [HR]", function (assert) {
|
|||||||
// allocate leaves
|
// allocate leaves
|
||||||
() => frappe.click_button('Allocate'),
|
() => frappe.click_button('Allocate'),
|
||||||
() => frappe.timeout(1),
|
() => frappe.timeout(1),
|
||||||
() => assert.equal("Message", cur_dialog.title,
|
() => assert.equal("Message", cur_dialog.title, "leave alloction message shown"),
|
||||||
"leave alloction message shown"),
|
|
||||||
() => frappe.click_button('Close'),
|
() => frappe.click_button('Close'),
|
||||||
() => frappe.set_route("List", "Leave Allocation", "List"),
|
() => frappe.set_route("List", "Leave Allocation", "List"),
|
||||||
() => frappe.timeout(1),
|
() => frappe.timeout(1),
|
||||||
() => {
|
() => {
|
||||||
let leave_allocated = cur_list.data.filter(d => d.leave_type == "Test Leave type");
|
return frappe.call({
|
||||||
assert.equal(3, leave_allocated.length,
|
method: "frappe.client.get_list",
|
||||||
'leave allocation successfully done for all the employees');
|
args: {
|
||||||
|
doctype: "Employee",
|
||||||
|
filters: {
|
||||||
|
"branch": "Test Branch",
|
||||||
|
"department": "Test Department",
|
||||||
|
"company": "Test Company",
|
||||||
|
"designation": "Test Designation",
|
||||||
|
"status": "Active"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
callback: function(r) {
|
||||||
|
let leave_allocated = cur_list.data.filter(d => d.leave_type == "Test Leave type");
|
||||||
|
assert.equal(r.message.length, leave_allocated.length,
|
||||||
|
'leave allocation successfully done for all the employees');
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
() => done()
|
() => done()
|
||||||
]);
|
]);
|
||||||
|
@ -30,7 +30,7 @@ QUnit.test("test: quotation", function (assert) {
|
|||||||
() => cur_frm.doc.items[0].rate = 200,
|
() => cur_frm.doc.items[0].rate = 200,
|
||||||
() => frappe.timeout(0.3),
|
() => frappe.timeout(0.3),
|
||||||
() => cur_frm.set_value("tc_name", "Test Term 1"),
|
() => cur_frm.set_value("tc_name", "Test Term 1"),
|
||||||
() => frappe.timeout(0.3),
|
() => frappe.timeout(0.5),
|
||||||
() => cur_frm.save(),
|
() => cur_frm.save(),
|
||||||
() => {
|
() => {
|
||||||
// Check Address and Contact Info
|
// Check Address and Contact Info
|
||||||
|
@ -27,7 +27,12 @@ QUnit.test("test sales order", function(assert) {
|
|||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
return frappe.tests.set_form_values(cur_frm, [
|
return frappe.tests.set_form_values(cur_frm, [
|
||||||
{selling_price_list:'Test-Selling-USD'},
|
{selling_price_list:'Test-Selling-USD'}
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
() => frappe.timeout(.5),
|
||||||
|
() => {
|
||||||
|
return frappe.tests.set_form_values(cur_frm, [
|
||||||
{currency: 'USD'},
|
{currency: 'USD'},
|
||||||
{apply_discount_on:'Grand Total'},
|
{apply_discount_on:'Grand Total'},
|
||||||
{additional_discount_percentage:10}
|
{additional_discount_percentage:10}
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
QUnit.test("test:POS Settings", function(assert) {
|
|
||||||
assert.expect(1);
|
|
||||||
let done = assert.async();
|
|
||||||
|
|
||||||
frappe.run_serially([
|
|
||||||
() => frappe.set_route('Form', 'POS Settings'),
|
|
||||||
() => cur_frm.set_value('use_pos_in_offline_mode', 0),
|
|
||||||
() => frappe.timeout(0.2),
|
|
||||||
() => cur_frm.save(),
|
|
||||||
() => frappe.timeout(1),
|
|
||||||
() => frappe.ui.toolbar.clear_cache(),
|
|
||||||
() => frappe.timeout(10),
|
|
||||||
() => assert.ok(cur_frm.doc.use_pos_in_offline_mode==0, "Enabled online"),
|
|
||||||
() => frappe.timeout(2),
|
|
||||||
() => done()
|
|
||||||
]);
|
|
||||||
});
|
|
@ -17,12 +17,14 @@ def run_setup_wizard_test():
|
|||||||
# Language slide
|
# Language slide
|
||||||
driver.set_select("language", "English (United States)")
|
driver.set_select("language", "English (United States)")
|
||||||
driver.wait_for_ajax(True)
|
driver.wait_for_ajax(True)
|
||||||
|
driver.wait_for('.next-btn', timeout=100)
|
||||||
driver.wait_till_clickable(".next-btn").click()
|
driver.wait_till_clickable(".next-btn").click()
|
||||||
|
|
||||||
# Region slide
|
# Region slide
|
||||||
driver.wait_for_ajax(True)
|
driver.wait_for_ajax(True)
|
||||||
driver.set_select("country", "India")
|
driver.set_select("country", "India")
|
||||||
driver.wait_for_ajax(True)
|
driver.wait_for_ajax(True)
|
||||||
|
driver.wait_for('.next-btn', timeout=100)
|
||||||
driver.wait_till_clickable(".next-btn").click()
|
driver.wait_till_clickable(".next-btn").click()
|
||||||
|
|
||||||
# Profile slide
|
# Profile slide
|
||||||
|
@ -50,7 +50,6 @@ erpnext/schools/doctype/room/test_room.js
|
|||||||
erpnext/schools/doctype/instructor/test_instructor.js
|
erpnext/schools/doctype/instructor/test_instructor.js
|
||||||
erpnext/stock/doctype/warehouse/test_warehouse.js
|
erpnext/stock/doctype/warehouse/test_warehouse.js
|
||||||
erpnext/manufacturing/doctype/production_order/test_production_order.js #long
|
erpnext/manufacturing/doctype/production_order/test_production_order.js #long
|
||||||
erpnext/selling/page/point_of_sale/tests/test_pos_settings.js
|
|
||||||
erpnext/selling/page/point_of_sale/tests/test_point_of_sale.js
|
erpnext/selling/page/point_of_sale/tests/test_point_of_sale.js
|
||||||
erpnext/accounts/page/pos/test_pos.js
|
erpnext/accounts/page/pos/test_pos.js
|
||||||
erpnext/selling/doctype/product_bundle/test_product_bundle.js
|
erpnext/selling/doctype/product_bundle/test_product_bundle.js
|
||||||
|
Loading…
x
Reference in New Issue
Block a user