(obsolete) New UI Testing Framework!

Hello all,

In order to improve the stability on the UI side, we have added a new framework for UI testing.


  • We are using QUnit to write the tests, Selenium with Chromedriver to run the tests.
  • All the tests will be in the tests/ui folder of the app
  • Tests will be run via a DocType Test Runner which will be called by Selenium on the CI. You can also test locally from the Test Runner interface
  • Lots of core functions have been changed to return Promise objects, so that they can be gracefully triggered serially with frappe.run_serially
  • Helper functions to quickly edit forms.
  • Easily build test fixtures (like Customers, Items etc) by passing simple JSON objects.

Next Steps

  • We will be preparing a plan to build tests for most of the core Frappe and ERPNext features.
  • We will start insisting on test cases for new contributions :slight_smile:

Sample Test

QUnit.test("test quotation", function(assert) {
	let done = assert.async();
		() => frappe.tests.setup_doctype('Customer'),
		() => frappe.tests.setup_doctype('Item'),
		() => {
			return frappe.tests.make('Quotation', [
				{customer: 'Test Customer 1'},
				{items: [
						{'item_code': 'Test Product 1'},
						{'qty': 5}
		() => {
			// get_item_details
			assert.ok(cur_frm.doc.items[0].item_name=='Test Product 1');

			// calculate_taxes_and_totals
		() => done()

Test Runner



Note that starting with v11, ERPNext moved from the QUnit and Selenium test framework to Cypress, as introduced here Bringing back UI Tests using Cypress