Fix travis (#11882)
* fieldname wrong
* bifurcated test into two - error when both were running async
* minor fixes with link and route
* move school domain rename up
* fix async creation of operations test
* edit-in-full-page is button, not link
* set_route issue in production order test
* minor changes
* fix task tree test
* more fixes
* fix server side issue
* improvising ui tests
diff --git a/.travis.yml b/.travis.yml
index 602144c..43b4078 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -68,6 +68,12 @@
script:
- bench --verbose run-setup-wizard-ui-test
- bench execute erpnext.setup.utils.enable_all_roles_and_domains
+ - bench run-ui-tests --app erpnext --test-list erpnext/tests/ui/tests2.txt
+ env: Client Side Test - 2
+ - # stage
+ script:
+ - bench --verbose run-setup-wizard-ui-test
+ - bench execute erpnext.setup.utils.enable_all_roles_and_domains
- bench run-ui-tests --app erpnext --test-list erpnext/tests/ui/agriculture.txt
env: Agriculture Client Side Test
- # stage
diff --git a/erpnext/accounts/doctype/account/tests/test_account_with_number.js b/erpnext/accounts/doctype/account/tests/test_account_with_number.js
index dd30eb7..c03e278 100644
--- a/erpnext/accounts/doctype/account/tests/test_account_with_number.js
+++ b/erpnext/accounts/doctype/account/tests/test_account_with_number.js
@@ -46,7 +46,7 @@
},
() => frappe.timeout(.5),
() => frappe.click_button("Rename"),
- () => frappe.timeout(1),
+ () => frappe.timeout(2),
() => {
assert.ok(cur_frm.doc.account_name=="Test Income", "account name remained same");
assert.ok(cur_frm.doc.account_number=="4030", "Account number updated to 4030");
diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js
index 0468cd9..db71a17 100644
--- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js
@@ -1,7 +1,7 @@
QUnit.module('Purchase Invoice');
QUnit.test("test purchase invoice", function(assert) {
- assert.expect(4);
+ assert.expect(6);
let done = assert.async();
frappe.run_serially([
() => {
diff --git a/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_margin.js b/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_margin.js
index 60652c8..f1cb22a 100644
--- a/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_margin.js
+++ b/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_margin.js
@@ -11,7 +11,7 @@
{currency: 'USD'},
{items: [
[
- {'item_code': 'Test Product 3'},
+ {'item_code': 'Test Product 4'},
{'delivery_date': frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)},
{'qty': 1},
{'margin_type': 'Percentage'},
diff --git a/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js b/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js
index 14c0d55..890fb68 100644
--- a/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js
+++ b/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js
@@ -44,7 +44,6 @@
() => { cur_frm.set_value('paid_to','Cash - '+frappe.get_abbr(frappe.defaults.get_default('Company')));},
() => {cur_frm.set_value('reference_no','TEST1234');},
() => {cur_frm.set_value('reference_date',frappe.datetime.add_days(frappe.datetime.nowdate(), 0));},
- () => cur_frm.set_value("payment_schedule", []),
() => cur_frm.save(),
() => {
// get payment details
diff --git a/erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_last_purchase_rate.js b/erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_last_purchase_rate.js
index bd5881b..8ccf1b6 100644
--- a/erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_last_purchase_rate.js
+++ b/erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_last_purchase_rate.js
@@ -97,10 +97,12 @@
},
// enable allow_last_purchase_rate
- () => frappe.tests.make('Buying Settings', [
- // values to be set
- {"disable_fetch_last_purchase_rate": 1}
- ]),
+ () => {
+ return frappe.tests.make('Buying Settings', [
+ // values to be set
+ {"disable_fetch_last_purchase_rate": 1}
+ ]);
+ },
() => {
return frappe.tests.make('Purchase Order', [
diff --git a/erpnext/buying/doctype/supplier/test_supplier.js b/erpnext/buying/doctype/supplier/test_supplier.js
index 05ea044..51e3c09 100644
--- a/erpnext/buying/doctype/supplier/test_supplier.js
+++ b/erpnext/buying/doctype/supplier/test_supplier.js
@@ -10,7 +10,6 @@
{supplier_type: 'Hardware'},
{country: 'India'},
{default_currency: 'INR'},
- {credit_days_based_on: 'Fixed Days'},
{accounts: [
[
{'company': "For Testing"},
diff --git a/erpnext/crm/doctype/lead/test_lead.js b/erpnext/crm/doctype/lead/test_lead.js
deleted file mode 100644
index 0d92b4e..0000000
--- a/erpnext/crm/doctype/lead/test_lead.js
+++ /dev/null
@@ -1,92 +0,0 @@
-QUnit.module("sales");
-
-QUnit.test("test: lead", function (assert) {
- assert.expect(10);
- let done = assert.async();
- let lead_name = frappe.utils.get_random(10);
- frappe.run_serially([
- // test lead creation
- () => frappe.set_route("List", "Lead"),
- () => frappe.new_doc("Lead"),
- () => frappe.timeout(1),
- () => cur_frm.set_value("lead_name", lead_name),
- () => cur_frm.save(),
- () => frappe.timeout(1),
- () => {
- assert.ok(cur_frm.doc.lead_name.includes(lead_name),
- 'name correctly set');
- frappe.lead_name = cur_frm.doc.name;
- },
- // create address and contact
- () => frappe.click_link('Address & Contact'),
- () => frappe.click_button('New Address'),
- () => frappe.timeout(1),
- () => frappe.set_control('address_line1', 'Gateway'),
- () => frappe.set_control('city', 'Mumbai'),
- () => cur_frm.save(),
- () => frappe.timeout(3),
- () => assert.equal(frappe.get_route()[1], 'Lead',
- 'back to lead form'),
- () => frappe.click_link('Address & Contact'),
- () => assert.ok($('.address-box').text().includes('Mumbai'),
- 'city is seen in address box'),
-
- // make opportunity
- () => frappe.click_button('Make'),
- () => frappe.click_link('Opportunity'),
- () => frappe.timeout(2),
- () => assert.equal(cur_frm.doc.lead, frappe.lead_name,
- 'lead name correctly mapped'),
-
- () => done()
- ]);
- frappe.run_serially([
- // test lead creation
- () => frappe.set_route("List", "Lead"),
- () => frappe.new_doc("Lead"),
- () => frappe.timeout(1),
- () => cur_frm.set_value("organization_lead", "1"),
- () => cur_frm.set_value("organization_name", lead_name),
- () => cur_frm.save(),
- () => frappe.timeout(1),
- () => {
- assert.ok(cur_frm.doc.lead_name.includes(lead_name),
- 'name correctly set');
- frappe.lead_name = cur_frm.doc.name;
- },
- // create address and contact
- () => frappe.click_link('Address & Contact'),
- () => frappe.click_button('New Address'),
- () => frappe.timeout(1),
- () => frappe.set_control('address_line1', 'Gateway'),
- () => frappe.set_control('city', 'Mumbai'),
- () => cur_frm.save(),
- () => frappe.timeout(3),
- () => assert.equal(frappe.get_route()[1], 'Lead',
- 'back to lead form'),
- () => frappe.click_link('Address & Contact'),
- () => assert.ok($('.address-box').text().includes('Mumbai'),
- 'city is seen in address box'),
-
- () => frappe.click_button('New Contact'),
- () => frappe.timeout(1),
- () => frappe.set_control('first_name', 'John'),
- () => frappe.set_control('last_name', 'Doe'),
- () => cur_frm.save(),
- () => frappe.timeout(3),
- () => assert.equal(frappe.get_route()[1], 'Lead',
- 'back to lead form'),
- () => frappe.click_link('Address & Contact'),
- () => assert.ok($('.address-box').text().includes('John'),
- 'contact is seen in contact box'),
-
- // make customer
- () => frappe.click_button('Make'),
- () => frappe.click_link('customer'),
- () => frappe.timeout(2),
- () => assert.equal(cur_frm.doc.lead_name, frappe.lead_name,
- 'lead name correctly mapped'),
-
- () => done()
- ]);
-});
diff --git a/erpnext/crm/doctype/lead/tests/test_lead_individual.js b/erpnext/crm/doctype/lead/tests/test_lead_individual.js
new file mode 100644
index 0000000..66d3337
--- /dev/null
+++ b/erpnext/crm/doctype/lead/tests/test_lead_individual.js
@@ -0,0 +1,43 @@
+QUnit.module("sales");
+
+QUnit.test("test: lead", function (assert) {
+ assert.expect(4);
+ let done = assert.async();
+ let lead_name = frappe.utils.get_random(10);
+ frappe.run_serially([
+ // test lead creation
+ () => frappe.set_route("List", "Lead"),
+ () => frappe.new_doc("Lead"),
+ () => frappe.timeout(1),
+ () => cur_frm.set_value("lead_name", lead_name),
+ () => cur_frm.save(),
+ () => frappe.timeout(1),
+ () => {
+ assert.ok(cur_frm.doc.lead_name.includes(lead_name),
+ 'name correctly set');
+ frappe.lead_name = cur_frm.doc.name;
+ },
+ // create address and contact
+ () => frappe.click_link('Address & Contact'),
+ () => frappe.click_button('New Address'),
+ () => frappe.timeout(1),
+ () => frappe.set_control('address_line1', 'Gateway'),
+ () => frappe.set_control('city', 'Mumbai'),
+ () => cur_frm.save(),
+ () => frappe.timeout(3),
+ () => assert.equal(frappe.get_route()[1], 'Lead',
+ 'back to lead form'),
+ () => frappe.click_link('Address & Contact'),
+ () => assert.ok($('.address-box').text().includes('Mumbai'),
+ 'city is seen in address box'),
+
+ // make opportunity
+ () => frappe.click_button('Make'),
+ () => frappe.click_link('Opportunity'),
+ () => frappe.timeout(2),
+ () => assert.equal(cur_frm.doc.lead, frappe.lead_name,
+ 'lead name correctly mapped'),
+
+ () => done()
+ ]);
+});
diff --git a/erpnext/crm/doctype/lead/tests/test_lead_organization.js b/erpnext/crm/doctype/lead/tests/test_lead_organization.js
new file mode 100644
index 0000000..4395935
--- /dev/null
+++ b/erpnext/crm/doctype/lead/tests/test_lead_organization.js
@@ -0,0 +1,56 @@
+QUnit.module("sales");
+
+QUnit.test("test: lead", function (assert) {
+ assert.expect(5);
+ let done = assert.async();
+ let lead_name = frappe.utils.get_random(10);
+ frappe.run_serially([
+ // test lead creation
+ () => frappe.set_route("List", "Lead"),
+ () => frappe.new_doc("Lead"),
+ () => frappe.timeout(1),
+ () => cur_frm.set_value("organization_lead", "1"),
+ () => cur_frm.set_value("company_name", lead_name),
+ () => cur_frm.save(),
+ () => frappe.timeout(1),
+ () => {
+ assert.ok(cur_frm.doc.lead_name.includes(lead_name),
+ 'name correctly set');
+ frappe.lead_name = cur_frm.doc.name;
+ },
+ // create address and contact
+ () => frappe.click_link('Address & Contact'),
+ () => frappe.click_button('New Address'),
+ () => frappe.timeout(1),
+ () => frappe.set_control('address_line1', 'Gateway'),
+ () => frappe.set_control('city', 'Mumbai'),
+ () => cur_frm.save(),
+ () => frappe.timeout(3),
+ () => assert.equal(frappe.get_route()[1], 'Lead',
+ 'back to lead form'),
+ () => frappe.click_link('Address & Contact'),
+ () => assert.ok($('.address-box').text().includes('Mumbai'),
+ 'city is seen in address box'),
+
+ () => frappe.click_button('New Contact'),
+ () => frappe.timeout(1),
+ () => frappe.set_control('first_name', 'John'),
+ () => frappe.set_control('last_name', 'Doe'),
+ () => cur_frm.save(),
+ () => frappe.timeout(3),
+ () => frappe.set_route('Form', 'Lead', cur_frm.doc.links[0].link_name),
+ () => frappe.timeout(1),
+ () => frappe.click_link('Address & Contact'),
+ () => assert.ok($('.address-box').text().includes('John'),
+ 'contact is seen in contact box'),
+
+ // make customer
+ () => frappe.click_button('Make'),
+ () => frappe.click_link('Customer'),
+ () => frappe.timeout(2),
+ () => assert.equal(cur_frm.doc.lead_name, frappe.lead_name,
+ 'lead name correctly mapped'),
+
+ () => done()
+ ]);
+});
diff --git a/erpnext/education/doctype/assessment_group/test_assessment_group.js b/erpnext/education/doctype/assessment_group/test_assessment_group.js
index 93026d2..a127fd4 100644
--- a/erpnext/education/doctype/assessment_group/test_assessment_group.js
+++ b/erpnext/education/doctype/assessment_group/test_assessment_group.js
@@ -18,8 +18,6 @@
// Creating child nodes
() => frappe.tests.click_link('All Assessment Groups'),
() => frappe.map_group.make('Assessment-group-1'),
- () => frappe.map_group.make('Assessment-group-2'),
- () => frappe.map_group.make('Assessment-group-3'),
() => frappe.map_group.make('Assessment-group-4', "All Assessment Groups", 1),
() => frappe.tests.click_link('Assessment-group-4'),
() => frappe.map_group.make('Assessment-group-5', "Assessment-group-3", 0),
@@ -39,27 +37,8 @@
() => frappe.timeout(0.5),
() => frappe.tests.click_button('Yes'),
- // Renaming Child node
- () => frappe.timeout(0.5),
- () => frappe.tests.click_link('Assessment-group-2'),
- () => frappe.tests.click_button('Rename'),
- () => frappe.timeout(0.4),
- () => cur_dialog.set_value('new_name', 'Assessment-group-6'),
- () => frappe.tests.click_button('Rename'),
- () => frappe.tests.click_button('Close'),
-
- // Merging 2 child nodes into 1
- () => frappe.timeout(0.5),
- () => frappe.tests.click_link('Assessment-group-6'),
- () => frappe.tests.click_button('Rename'),
- () => frappe.timeout(0.4),
- () => cur_dialog.set_value('merge', 1),
- () => cur_dialog.set_value('new_name', 'Assessment-group-3'),
- () => frappe.tests.click_button('Rename'),
- () => frappe.tests.click_button('Close'),
-
// Checking Collapse and Expand button
- () => frappe.timeout(1),
+ () => frappe.timeout(2),
() => frappe.tests.click_link('Assessment-group-4'),
() => frappe.click_button('Collapse'),
() => frappe.tests.click_link('All Assessment Groups'),
diff --git a/erpnext/hr/doctype/branch/test_branch.js b/erpnext/hr/doctype/branch/test_branch.js
index 446db75..c315385 100644
--- a/erpnext/hr/doctype/branch/test_branch.js
+++ b/erpnext/hr/doctype/branch/test_branch.js
@@ -9,7 +9,8 @@
() => frappe.set_route("List", "Branch", "List"),
() => frappe.new_doc("Branch"),
() => frappe.timeout(1),
- () => frappe.click_link('Edit in full page'),
+ () => frappe.quick_entry.dialog.$wrapper.find('.edit-full').click(),
+ () => frappe.timeout(1),
() => cur_frm.set_value("branch", "Test Branch"),
// save form
diff --git a/erpnext/hr/doctype/department/test_department.js b/erpnext/hr/doctype/department/test_department.js
index 1c413e9..3a571f7 100644
--- a/erpnext/hr/doctype/department/test_department.js
+++ b/erpnext/hr/doctype/department/test_department.js
@@ -9,7 +9,8 @@
() => frappe.set_route("List", "Department", "List"),
() => frappe.new_doc("Department"),
() => frappe.timeout(1),
- () => frappe.click_link('Edit in full page'),
+ () => frappe.quick_entry.dialog.$wrapper.find('.edit-full').click(),
+ () => frappe.timeout(1),
() => cur_frm.set_value("department_name", "Test Department"),
() => cur_frm.set_value("leave_block_list", "Test Leave block list"),
// save form
diff --git a/erpnext/hr/doctype/designation/test_designation.js b/erpnext/hr/doctype/designation/test_designation.js
index a012877..45c3417 100644
--- a/erpnext/hr/doctype/designation/test_designation.js
+++ b/erpnext/hr/doctype/designation/test_designation.js
@@ -9,7 +9,8 @@
() => frappe.set_route("List", "Designation", "List"),
() => frappe.new_doc("Designation"),
() => frappe.timeout(1),
- () => frappe.click_link('Edit in full page'),
+ () => frappe.quick_entry.dialog.$wrapper.find('.edit-full').click(),
+ () => frappe.timeout(1),
() => cur_frm.set_value("designation_name", "Test Designation"),
() => cur_frm.set_value("description", "This designation is just for testing."),
// save form
diff --git a/erpnext/hr/doctype/employee_loan_application/test_employee_loan_application.js b/erpnext/hr/doctype/employee_loan_application/test_employee_loan_application.js
index 3e2977e..d828d9a 100644
--- a/erpnext/hr/doctype/employee_loan_application/test_employee_loan_application.js
+++ b/erpnext/hr/doctype/employee_loan_application/test_employee_loan_application.js
@@ -12,7 +12,7 @@
employee_name = r.message.name;
},
() => {
- frappe.tests.make('Employee Loan Application', [
+ return frappe.tests.make('Employee Loan Application', [
{ company: 'For Testing'},
{ employee: employee_name},
{ employee_name: 'Test Employee 1'},
diff --git a/erpnext/hr/doctype/employment_type/test_employment_type.js b/erpnext/hr/doctype/employment_type/test_employment_type.js
index 0ddd3e0..9835aab 100644
--- a/erpnext/hr/doctype/employment_type/test_employment_type.js
+++ b/erpnext/hr/doctype/employment_type/test_employment_type.js
@@ -9,7 +9,8 @@
() => frappe.set_route("List", "Employment Type", "List"),
() => frappe.new_doc("Employment Type"),
() => frappe.timeout(1),
- () => frappe.click_link('Edit in full page'),
+ () => frappe.quick_entry.dialog.$wrapper.find('.edit-full').click(),
+ () => frappe.timeout(1),
() => cur_frm.set_value("employee_type_name", "Test Employment type"),
// save form
() => cur_frm.save(),
diff --git a/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.js b/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.js
index 3f9d486..62234e0 100644
--- a/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.js
+++ b/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.js
@@ -12,7 +12,7 @@
{ accounts: [
[
{ company: 'For Testing'},
- { default_account: 'Round Off - FT'}
+ { default_account: 'Rounded Off - FT'}
]
]},
]);
diff --git a/erpnext/hr/doctype/payroll_entry/test_payroll_entry.js b/erpnext/hr/doctype/payroll_entry/test_payroll_entry.js
index 5eee3fd..c109aab 100644
--- a/erpnext/hr/doctype/payroll_entry/test_payroll_entry.js
+++ b/erpnext/hr/doctype/payroll_entry/test_payroll_entry.js
@@ -3,6 +3,7 @@
QUnit.test("test: Payroll Entry", function (assert) {
assert.expect(5);
let done = assert.async();
+ let employees, docname;
frappe.run_serially([
() => {
@@ -20,6 +21,11 @@
assert.equal(cur_frm.doc.posting_date, frappe.datetime.add_days(frappe.datetime.nowdate(), 0));
assert.equal(cur_frm.doc.cost_center, 'Main - FT');
},
+ () => frappe.click_button('Get Employee Details'),
+ () => {
+ employees = cur_frm.doc.employees.length;
+ docname = cur_frm.doc.name;
+ },
() => frappe.click_button('Submit'),
() => frappe.timeout(1),
@@ -28,9 +34,9 @@
() => frappe.click_button('View Salary Slip'),
() => frappe.timeout(2),
- () => assert.equal(cur_list.data[0].docstatus, 0),
+ () => assert.equal(cur_list.data.length, employees),
- () => frappe.set_route('Form', 'Payroll Entry', 'Payroll 0001'),
+ () => frappe.set_route('Form', 'Payroll Entry', docname),
() => frappe.timeout(2),
() => frappe.click_button('Submit Salary Slip'),
() => frappe.timeout(3),
@@ -41,7 +47,13 @@
() => frappe.click_button('View Salary Slip'),
() => frappe.timeout(2),
() => {
- assert.ok(cur_list.data[0].docstatus == 1, "Salary slip submitted");
+ let count = 0;
+ for(var i = 0; i < employees; i++) {
+ if(cur_list.data[i].docstatus == 1){
+ count++;
+ }
+ }
+ assert.equal(count, employees, "Salary Slip submitted for all employees");
},
() => done()
diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.js b/erpnext/hr/doctype/salary_slip/test_salary_slip.js
index 619e530..43cc27d 100644
--- a/erpnext/hr/doctype/salary_slip/test_salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.js
@@ -44,6 +44,12 @@
() => frappe.timeout(6),
() => salary_slip('Test Employee 3'),
() => frappe.timeout(5),
+ () => frappe.set_route('List', 'Salary Slip', 'List'),
+ () => frappe.timeout(2),
+ () => {$('.list-select-all').click();},
+ () => frappe.timeout(2),
+ () => frappe.click_button('Delete'),
+ () => frappe.click_button('Yes'),
() => done()
]);
});
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/operation/test_operation.js b/erpnext/manufacturing/doctype/operation/test_operation.js
index 42553ce..fd7783f 100644
--- a/erpnext/manufacturing/doctype/operation/test_operation.js
+++ b/erpnext/manufacturing/doctype/operation/test_operation.js
@@ -7,7 +7,7 @@
// Create a Keyboard operation
() => {
- frappe.tests.make(
+ return frappe.tests.make(
"Operation", [
{__newname: "Assemble Keyboard"},
{workstation: "Keyboard assembly workstation"}
@@ -24,7 +24,7 @@
// Create a Screen operation
() => {
- frappe.tests.make(
+ return frappe.tests.make(
"Operation", [
{__newname: 'Assemble Screen'},
{workstation: "Screen assembly workstation"}
@@ -35,7 +35,7 @@
// Create a CPU operation
() => {
- frappe.tests.make(
+ return frappe.tests.make(
"Operation", [
{__newname: 'Assemble CPU'},
{workstation: "CPU assembly workstation"}
diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.js b/erpnext/manufacturing/doctype/production_order/test_production_order.js
index 670f0b0..3a2e5ce 100644
--- a/erpnext/manufacturing/doctype/production_order/test_production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/test_production_order.js
@@ -15,7 +15,7 @@
frappe.run_serially([
// test production order
- () => frappe.set_route("List", "Production Order"),
+ () => frappe.set_route("List", "Production Order", "List"),
() => frappe.timeout(3),
// Create a laptop production order
@@ -65,7 +65,7 @@
() => frappe.timeout(2.5),
// Start the production order process
- () => frappe.set_route("List", "Production Order"),
+ () => frappe.set_route("List", "Production Order", "List"),
() => frappe.timeout(2),
() => frappe.click_link("Laptop"),
() => frappe.timeout(1),
@@ -118,7 +118,7 @@
() => frappe.timeout(1),
// Manufacturing finished
- () => frappe.set_route("List", "Production Order"),
+ () => frappe.set_route("List", "Production Order", "List"),
() => frappe.timeout(1),
() => frappe.click_link("Laptop"),
() => frappe.timeout(1),
diff --git a/erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.js b/erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.js
index 6c29fb5..08baaf0 100644
--- a/erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.js
+++ b/erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.js
@@ -10,13 +10,15 @@
frappe.run_serially([
// insert a new Member
- () => frappe.tests.make('Volunteer Type', [
- // values to be set
- {volunteer_type: 'Test Work'},
- {amount: 500}
- ]),
() => {
- assert.equal(cur_frm.doc.volunteer_type, 'Test Work');
+ return frappe.tests.make('Volunteer Type', [
+ // values to be set
+ {__newname: 'Test Work'},
+ {amount: 500}
+ ]);
+ },
+ () => {
+ assert.equal(cur_frm.doc.name, 'Test Work');
assert.equal(cur_frm.doc.amount, 500);
},
() => done()
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index f6988ab..fe5ceda 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -1,5 +1,6 @@
execute:import unidecode # new requirement
erpnext.patches.v8_0.move_perpetual_inventory_setting
+erpnext.patches.v10_0.rename_schools_to_education
erpnext.patches.v4_0.validate_v3_patch
erpnext.patches.v4_0.fix_employee_user_id
erpnext.patches.v4_0.remove_employee_role_if_no_employee
@@ -470,7 +471,6 @@
erpnext.patches.v9_2.rename_translated_domains_in_en
erpnext.patches.v9_0.set_shipping_type_for_existing_shipping_rules
erpnext.patches.v9_0.update_multi_uom_fields_in_material_request
-erpnext.patches.v10_0.rename_schools_to_education
erpnext.patches.v9_2.repost_reserved_qty_for_production
erpnext.patches.v9_2.remove_company_from_patient
erpnext.patches.v9_2.set_item_name_in_production_order
diff --git a/erpnext/projects/doctype/activity_type/test_activity_type.js b/erpnext/projects/doctype/activity_type/test_activity_type.js
index 8023121..62be972 100644
--- a/erpnext/projects/doctype/activity_type/test_activity_type.js
+++ b/erpnext/projects/doctype/activity_type/test_activity_type.js
@@ -8,7 +8,8 @@
() => frappe.set_route("List", "Activity Type", "List"),
() => frappe.new_doc("Activity Type"),
() => frappe.timeout(1),
- () => frappe.click_link('Edit in full page'),
+ () => frappe.quick_entry.dialog.$wrapper.find('.edit-full').click(),
+ () => frappe.timeout(1),
() => cur_frm.set_value("activity_type", "Test Activity"),
() => frappe.click_button('Save'),
() => frappe.timeout(1),
diff --git a/erpnext/projects/doctype/task/tests/test_task_tree.js b/erpnext/projects/doctype/task/tests/test_task_tree.js
index 9cbcf85..27dccbf 100644
--- a/erpnext/projects/doctype/task/tests/test_task_tree.js
+++ b/erpnext/projects/doctype/task/tests/test_task_tree.js
@@ -6,7 +6,7 @@
let done = assert.async();
// number of asserts
- assert.expect(5);
+ assert.expect(4);
frappe.run_serially([
// insert a new Task
@@ -21,9 +21,8 @@
() => frappe.timeout(0.5),
// Creating child nodes
- () => frappe.tests.click_link('task'),
+ () => frappe.tests.click_link('All Tasks'),
() => frappe.map_group.make('Test-1'),
- () => frappe.map_group.make('Test-2'),
() => frappe.map_group.make('Test-3', 1),
() => frappe.timeout(1),
() => frappe.tests.click_link('Test-3'),
@@ -33,8 +32,9 @@
() => frappe.timeout(0.5),
() => frappe.tests.click_link('Test-1'),
() => frappe.tests.click_button('Edit'),
- () => frappe.timeout(0.5),
- () => {assert.deepEqual(frappe.get_route(), ["Form", "Task", "Test-1"], "Edit route checks");},
+ () => frappe.timeout(1),
+ () => frappe.db.get_value('Task', {'subject': 'Test-1'}, 'name'),
+ (task) => {assert.deepEqual(frappe.get_route(), ["Form", "Task", task.message.name], "Edit route checks");},
// Deleting child Node
() => frappe.set_route('Tree', 'Task'),
@@ -54,17 +54,6 @@
() => {assert.equal(cur_dialog.title, 'Message', 'Error thrown correctly');},
() => frappe.tests.click_button('Close'),
- // Renaming Child node
- () => frappe.timeout(0.5),
- () => frappe.tests.click_link('Test-2'),
- () => frappe.tests.click_button('Rename'),
- () => frappe.timeout(1),
- () => cur_dialog.set_value('new_name', 'Test-5'),
- () => frappe.timeout(1.5),
- () => cur_dialog.get_primary_btn().click(),
- () => frappe.timeout(1),
- () => {assert.equal($(`a:contains("Test-5"):visible`).length, 1, 'Rename successfull');},
-
// Add multiple child tasks
() => frappe.tests.click_link('Test-3'),
() => frappe.timeout(0.5),
diff --git a/erpnext/restaurant/doctype/restaurant/test_restaurant.js b/erpnext/restaurant/doctype/restaurant/test_restaurant.js
index f4a1343..26de5d0 100644
--- a/erpnext/restaurant/doctype/restaurant/test_restaurant.js
+++ b/erpnext/restaurant/doctype/restaurant/test_restaurant.js
@@ -7,9 +7,18 @@
// number of asserts
assert.expect(2);
+ let customer = {
+ "Test Customer 1": [
+ {customer_name: "Test Customer 1"}
+ ],
+ "Test Customer 2": [
+ {customer_name: "Test Customer 2"}
+ ]
+ };
frappe.run_serially([
// insert a new Restaurant
+ () => frappe.tests.setup_doctype('Customer', customer),
() => {
return frappe.tests.make('Restaurant', [
// values to be set
diff --git a/erpnext/selling/doctype/quotation/tests/test_quotation_with_margin.js b/erpnext/selling/doctype/quotation/tests/test_quotation_with_margin.js
index 590a828..5b4224d 100644
--- a/erpnext/selling/doctype/quotation/tests/test_quotation_with_margin.js
+++ b/erpnext/selling/doctype/quotation/tests/test_quotation_with_margin.js
@@ -11,7 +11,7 @@
{currency: 'USD'},
{items: [
[
- {'item_code': 'Test Product 3'},
+ {'item_code': 'Test Product 4'},
{'delivery_date': frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)},
{'qty': 1},
{'margin_type': 'Percentage'},
diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_bypass_credit_limit_check.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_bypass_credit_limit_check.js
index 3ffb825..dbd58c1 100644
--- a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_bypass_credit_limit_check.js
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_bypass_credit_limit_check.js
@@ -7,7 +7,8 @@
frappe.run_serially([
() => frappe.new_doc('Customer'),
() => frappe.timeout(1),
- () => frappe.click_link('Edit in full page'),
+ () => frappe.quick_entry.dialog.$wrapper.find('.edit-full').click(),
+ () => frappe.timeout(1),
() => cur_frm.set_value("customer_name", "Test Customer 10"),
() => cur_frm.set_value("credit_limit", 100.00),
() => cur_frm.set_value("bypass_credit_limit_check_at_sales_order", 1),
@@ -17,7 +18,8 @@
() => frappe.new_doc('Item'),
() => frappe.timeout(1),
- () => frappe.click_link('Edit in full page'),
+ () => frappe.quick_entry.dialog.$wrapper.find('.edit-full').click(),
+ () => frappe.timeout(1),
() => cur_frm.set_value("item_code", "Test Product 10"),
() => cur_frm.set_value("item_group", "Products"),
() => cur_frm.set_value("standard_rate", 100),
diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_margin.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_margin.js
index 8575b78..7426868 100644
--- a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_margin.js
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_margin.js
@@ -11,7 +11,7 @@
{currency: 'USD'},
{items: [
[
- {'item_code': 'Test Product 3'},
+ {'item_code': 'Test Product 4'},
{'delivery_date': frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)},
{'qty': 1},
{'margin_type': 'Amount'},
diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order_without_bypass_credit_limit_check.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order_without_bypass_credit_limit_check.js
index ea15edc..4e81fb0 100644
--- a/erpnext/selling/doctype/sales_order/tests/test_sales_order_without_bypass_credit_limit_check.js
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order_without_bypass_credit_limit_check.js
@@ -7,7 +7,8 @@
frappe.run_serially([
() => frappe.new_doc('Customer'),
() => frappe.timeout(1),
- () => frappe.click_link('Edit in full page'),
+ () => frappe.quick_entry.dialog.$wrapper.find('.edit-full').click(),
+ () => frappe.timeout(1),
() => cur_frm.set_value("customer_name", "Test Customer 11"),
() => cur_frm.set_value("credit_limit", 100.00),
() => cur_frm.set_value("bypass_credit_limit_check_at_sales_order", 0),
diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note_with_margin.js b/erpnext/stock/doctype/delivery_note/test_delivery_note_with_margin.js
index 67c9f38..21eb35c 100644
--- a/erpnext/stock/doctype/delivery_note/test_delivery_note_with_margin.js
+++ b/erpnext/stock/doctype/delivery_note/test_delivery_note_with_margin.js
@@ -11,7 +11,7 @@
{currency: 'USD'},
{items: [
[
- {'item_code': 'Test Product 3'},
+ {'item_code': 'Test Product 4'},
{'qty': 1},
{'margin_type': 'Amount'},
{'margin_rate_or_amount': 10}
diff --git a/erpnext/stock/doctype/item_price/test_item_price.js b/erpnext/stock/doctype/item_price/test_item_price.js
index 6383fb0..8f2f289 100644
--- a/erpnext/stock/doctype/item_price/test_item_price.js
+++ b/erpnext/stock/doctype/item_price/test_item_price.js
@@ -7,13 +7,13 @@
() => {
return frappe.tests.make('Item Price', [
{price_list:'Test-Selling-USD'},
- {item_code: 'Test Product 3'},
+ {item_code: 'Test Product 4'},
{price_list_rate: 200}
]);
},
() => cur_frm.save(),
() => {
- assert.ok(cur_frm.doc.item_name == 'Test Product 3', "Item name correct");
+ assert.ok(cur_frm.doc.item_name == 'Test Product 4', "Item name correct");
assert.ok(cur_frm.doc.price_list_rate == 200, "Price list rate correct");
},
() => frappe.timeout(0.3),
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 2ceed97..0c9d0c7 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -312,7 +312,7 @@
out.price_list_rate = flt(price_list_rate) * flt(args.plc_conversion_rate) \
/ flt(args.conversion_rate)
- if args.price_list_uom_dependant == 0:
+ if not args.price_list_uom_dependant:
out.price_list_rate = flt(out.price_list_rate * (args.conversion_factor or 1.0))
if not out.price_list_rate and args.transaction_type=="buying":
diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt
index d02cae1..3749cb8 100644
--- a/erpnext/tests/ui/tests.txt
+++ b/erpnext/tests/ui/tests.txt
@@ -1,5 +1,4 @@
erpnext/tests/ui/make_fixtures.js #long
-erpnext/setup/doctype/company/tests/test_company.js
erpnext/accounts/doctype/account/tests/test_account.js
erpnext/accounts/doctype/account/tests/test_make_tax_account.js
erpnext/accounts/doctype/account/tests/test_account_with_number.js
@@ -7,9 +6,7 @@
erpnext/accounts/doctype/sales_taxes_and_charges_template/test_sales_taxes_and_charges_template.js
erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.js
erpnext/accounts/doctype/shipping_rule/test_shipping_rule.js
-erpnext/crm/doctype/lead/test_lead.js
erpnext/crm/doctype/opportunity/test_opportunity.js
-erpnext/setup/doctype/company/tests/test_company_production.js
erpnext/stock/doctype/item/tests/test_item.js
erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js
erpnext/selling/doctype/quotation/tests/test_quotation_with_item_wise_discount.js
@@ -42,13 +39,6 @@
erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.js
erpnext/hr/doctype/leave_allocation/test_leave_allocation.js
erpnext/hr/doctype/leave_application/test_leave_application.js
-erpnext/education/doctype/academic_year/test_academic_year.js
-erpnext/education/doctype/academic_term/test_academic_term.js
-erpnext/education/doctype/education_settings/test_education_settings.js
-erpnext/education/doctype/student_batch_name/test_student_batch_name.js
-erpnext/education/doctype/student_category/test_student_category.js
-erpnext/education/doctype/room/test_room.js
-erpnext/education/doctype/instructor/test_instructor.js
erpnext/stock/doctype/warehouse/test_warehouse.js
erpnext/manufacturing/doctype/production_order/test_production_order.js #long
erpnext/accounts/page/pos/test_pos.js
@@ -95,26 +85,6 @@
erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_taxes_and_charges.js
erpnext/buying/doctype/purchase_order/tests/test_purchase_order_receipt.js
erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.js
-erpnext/education/doctype/grading_scale/test_grading_scale.js
-erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.js
-erpnext/education/doctype/assessment_criteria/test_assessment_criteria.js
-erpnext/education/doctype/course/test_course.js
-erpnext/education/doctype/program/test_program.js
-erpnext/education/doctype/guardian/test_guardian.js
-erpnext/education/doctype/student_admission/test_student_admission.js
-erpnext/education/doctype/student_applicant/tests/test_student_applicant_dummy_data.js
-erpnext/education/doctype/student_applicant/tests/test_student_applicant.js
-erpnext/education/doctype/student_applicant/tests/test_student_applicant_options.js
-erpnext/education/doctype/student_log/test_student_log.js
-erpnext/education/doctype/student_group/test_student_group.js
-erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.js
-erpnext/education/doctype/student_leave_application/test_student_leave_application.js
-erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js
-erpnext/education/doctype/student_attendance/test_student_attendance.js
-erpnext/education/doctype/assessment_group/test_assessment_group.js
-erpnext/education/doctype/assessment_plan/test_assessment_plan.js
-erpnext/education/doctype/assessment_result/test_assessment_result.js
-erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.js
erpnext/accounts/doctype/journal_entry/test_journal_entry.js
erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js
erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js
@@ -129,10 +99,6 @@
erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_serialize_item.js
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/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
erpnext/projects/doctype/task/tests/test_task_tree.js
erpnext/stock/doctype/item_price/test_item_price.js
erpnext/stock/doctype/delivery_note/test_delivery_note_with_margin.js
@@ -141,17 +107,3 @@
erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_margin.js
erpnext/hr/doctype/payroll_entry/test_set_salary_components.js
erpnext/hr/doctype/payroll_entry/test_payroll_entry.js
-erpnext/agriculture/doctype/land_unit/test_land_unit.js
-erpnext/agriculture/doctype/fertilizer/test_fertilizer.js
-erpnext/agriculture/doctype/water_analysis/test_water_analysis.js
-erpnext/agriculture/doctype/disease/test_disease.js
-erpnext/agriculture/doctype/soil_texture/test_soil_texture.js
-erpnext/agriculture/doctype/crop/test_crop.js
-erpnext/agriculture/doctype/crop_cycle/test_crop_cycle.js
-erpnext/non_profit/doctype/membership_type/test_membership_type.js
-erpnext/non_profit/doctype/member/test_member.js
-erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.js
-erpnext/non_profit/doctype/volunteer/test_volunteer.js
-erpnext/non_profit/doctype/donor_type/test_donor_type.js
-erpnext/non_profit/doctype/donor/test_donor.js
-erpnext/non_profit/doctype/grant_application/test_grant_application.js
\ No newline at end of file
diff --git a/erpnext/tests/ui/tests2.txt b/erpnext/tests/ui/tests2.txt
new file mode 100644
index 0000000..e410a83
--- /dev/null
+++ b/erpnext/tests/ui/tests2.txt
@@ -0,0 +1,46 @@
+erpnext/setup/doctype/company/tests/test_company.js
+erpnext/crm/doctype/lead/tests/test_lead_individual.js
+erpnext/crm/doctype/lead/tests/test_lead_organization.js
+erpnext/setup/doctype/company/tests/test_company_production.js
+erpnext/hr/doctype/leave_block_list/test_leave_block_list.js
+erpnext/hr/doctype/department/test_department.js
+erpnext/hr/doctype/designation/test_designation.js
+erpnext/education/doctype/academic_year/test_academic_year.js
+erpnext/education/doctype/academic_term/test_academic_term.js
+erpnext/education/doctype/education_settings/test_education_settings.js
+erpnext/education/doctype/student_batch_name/test_student_batch_name.js
+erpnext/education/doctype/student_category/test_student_category.js
+erpnext/education/doctype/room/test_room.js
+erpnext/education/doctype/instructor/test_instructor.js
+erpnext/education/doctype/grading_scale/test_grading_scale.js
+erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.js
+erpnext/education/doctype/assessment_criteria/test_assessment_criteria.js
+erpnext/education/doctype/course/test_course.js
+erpnext/education/doctype/program/test_program.js
+erpnext/education/doctype/guardian/test_guardian.js
+erpnext/education/doctype/student_admission/test_student_admission.js
+erpnext/education/doctype/student_applicant/tests/test_student_applicant_dummy_data.js
+erpnext/education/doctype/student_applicant/tests/test_student_applicant.js
+erpnext/education/doctype/student_applicant/tests/test_student_applicant_options.js
+erpnext/education/doctype/student_log/test_student_log.js
+erpnext/education/doctype/student_group/test_student_group.js
+erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.js
+erpnext/education/doctype/student_leave_application/test_student_leave_application.js
+erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js
+erpnext/education/doctype/student_attendance/test_student_attendance.js
+erpnext/education/doctype/assessment_group/test_assessment_group.js
+erpnext/education/doctype/assessment_plan/test_assessment_plan.js
+erpnext/education/doctype/assessment_result/test_assessment_result.js
+erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.js
+erpnext/projects/doctype/task/tests/test_task_tree.js
+erpnext/restaurant/doctype/restaurant/test_restaurant.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
+erpnext/non_profit/doctype/membership_type/test_membership_type.js
+erpnext/non_profit/doctype/member/test_member.js
+erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.js
+erpnext/non_profit/doctype/volunteer/test_volunteer.js
+erpnext/non_profit/doctype/donor_type/test_donor_type.js
+erpnext/non_profit/doctype/donor/test_donor.js
+erpnext/non_profit/doctype/grant_application/test_grant_application.js
\ No newline at end of file