refactor: Delete Qunit test files

Since it is no longer used
This commit is contained in:
Frappe Bot 2021-04-27 20:48:47 +05:30 committed by Suraj Shetty
parent 07d3f6bd06
commit d30596b15e
52 changed files with 0 additions and 6610 deletions

View file

@ -135,7 +135,6 @@
"PhotoSwipeUI_Default": true,
"fluxify": true,
"io": true,
"QUnit": true,
"JsBarcode": true,
"L": true,
"Chart": true,

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Auto Repeat", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Auto Repeat
() => frappe.tests.make('Auto Repeat', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Contact", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Contact
() => frappe.tests.make('Contact', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Communication", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Communication
() => frappe.tests.make('Communication', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: DocType", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new DocType
() => frappe.tests.make('DocType', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Domain", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially('Domain', [
// insert a new Domain
() => frappe.tests.make([
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: File", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new File
() => frappe.tests.make('File', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Page", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Page
() => frappe.tests.make('Page', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Payment Gateway", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Payment Gateway
() => frappe.tests.make('Payment Gateway', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Prepared Report", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Prepared Report
() => frappe.tests.make('Prepared Report', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,33 +0,0 @@
// Test for creating query report
QUnit.test("Test Query Report", function(assert){
assert.expect(2);
let done = assert.async();
let random = frappe.utils.get_random(10);
frappe.run_serially([
() => frappe.set_route('List', 'ToDo'),
() => frappe.new_doc('ToDo'),
() => frappe.quick_entry.dialog.set_value('description', random),
() => frappe.quick_entry.insert(),
() => {
return frappe.tests.make('Report', [
{report_name: 'ToDo List Report'},
{report_type: 'Query Report'},
{ref_doctype: 'ToDo'}
]);
},
() => frappe.set_route('Form','Report', 'ToDo List Report'),
//Query
() => cur_frm.set_value('query','select description,owner,status from `tabToDo`'),
() => cur_frm.save(),
() => frappe.set_route('query-report','ToDo List Report'),
() => frappe.timeout(5),
() => {
assert.ok($('div.slick-header-column').length == 4,'Correct numbers of columns visible');
//To check if the result is present
assert.ok($('div.r1:contains('+random+')').is(':visible'),'Result is visible in report');
frappe.timeout(3);
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Report", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Report
() => frappe.tests.make('Report', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,33 +0,0 @@
QUnit.module('Core');
QUnit.test("test: Role Profile", function (assert) {
let done = assert.async();
assert.expect(3);
frappe.run_serially([
// insert a new user
() => frappe.tests.make('Role Profile', [
{role_profile: 'Test 2'}
]),
() => {
$('input.box')[0].checked = true;
$('input.box')[2].checked = true;
$('input.box')[4].checked = true;
cur_frm.save();
},
() => frappe.timeout(1),
() => cur_frm.refresh(),
() => frappe.timeout(2),
() => {
assert.equal($('input.box')[0].checked, true);
assert.equal($('input.box')[2].checked, true);
assert.equal($('input.box')[4].checked, true);
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: SMS Settings", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially('SMS Settings', [
// insert a new SMS Settings
() => frappe.tests.make([
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: System Settings", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially('System Settings', [
// insert a new System Settings
() => frappe.tests.make([
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Transaction Log", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Transaction Log
() => frappe.tests.make('Transaction Log', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: User", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new User
() => frappe.tests.make('User', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,35 +0,0 @@
QUnit.module('Core');
QUnit.test("test: Set role profile in user", function (assert) {
let done = assert.async();
assert.expect(3);
frappe.run_serially([
// Insert a new user
() => frappe.tests.make('User', [
{email: 'test@test2.com'},
{first_name: 'Test 2'},
{send_welcome_email: 0}
]),
() => frappe.timeout(2),
() => {
return frappe.tests.set_form_values(cur_frm, [
{role_profile_name:'Test 2'}
]);
},
() => cur_frm.save(),
() => frappe.timeout(2),
() => {
assert.equal($('input.box')[0].checked, true);
assert.equal($('input.box')[2].checked, true);
assert.equal($('input.box')[4].checked, true);
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: User Permission", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially('User Permission', [
// insert a new User Permission
() => frappe.tests.make([
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: View Log", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new View Log
() => frappe.tests.make('View Log', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Custom Field", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Custom Field
() => frappe.tests.make('Custom Field', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,44 +0,0 @@
// try and delete a standard row, it should fail
QUnit.module('Customize Form');
QUnit.test("test customize form", function(assert) {
assert.expect(2);
let done = assert.async();
frappe.run_serially([
() => frappe.set_route('Form', 'Customize Form'),
() => frappe.timeout(1),
() => cur_frm.set_value('doc_type', 'ToDo'),
() => frappe.timeout(2),
() => {
// find the status column as there may be other custom fields like
// kanban etc.
frappe.row_idx = 0;
cur_frm.doc.fields.every((d, i) => {
if(d.fieldname==='status') {
frappe.row_idx = i;
return false;
} else {
return true;
}
});
assert.equal(cur_frm.doc.fields[frappe.row_idx].fieldname, 'status',
'check if selected field is "status"');
},
// open "status" row
() => cur_frm.fields_dict.fields.grid.grid_rows[frappe.row_idx].toggle_view(),
() => frappe.timeout(0.5),
// try deleting it
() => $('.grid-delete-row:visible').click(),
() => frappe.timeout(0.5),
() => frappe.hide_msgprint(),
() => frappe.timeout(0.5),
// status still exists
() => assert.equal(cur_frm.doc.fields[frappe.row_idx].fieldname, 'status',
'check if selected field is still "status"'),
() => done()
]);
});

View file

@ -1,8 +0,0 @@
// Copyright (c) 2021, Frappe Technologies and contributors
// For license information, please see license.txt
frappe.ui.form.on('Test rename new', {
// refresh: function(frm) {
// }
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Data Migration Connector", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Data Migration Connector
() => frappe.tests.make('Data Migration Connector', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Data Migration Mapping", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Data Migration Mapping
() => frappe.tests.make('Data Migration Mapping', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Data Migration Plan", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Data Migration Plan
() => frappe.tests.make('Data Migration Plan', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Data Migration Run", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Data Migration Run
() => frappe.tests.make('Data Migration Run', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,42 +0,0 @@
QUnit.test("test: Event", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(4);
const subject = '_Test Event 1';
const datetime = frappe.datetime.now_datetime();
const hex = '#6be273';
const rgb = 'rgb(107, 226, 115)';
frappe.run_serially([
// insert a new Event
() => frappe.tests.make('Event', [
// values to be set
{subject: subject},
{starts_on: datetime},
{color: hex},
{event_type: 'Private'}
]),
() => {
assert.equal(cur_frm.doc.subject, subject, 'Subject correctly set');
assert.equal(cur_frm.doc.starts_on, datetime, 'Date correctly set');
assert.equal(cur_frm.doc.color, hex, 'Color correctly set');
// set filters explicitly for list view
frappe.route_options = {
event_type: 'Private'
};
},
() => frappe.set_route('List', 'Event', 'Calendar'),
() => frappe.timeout(2),
() => {
const bg_color = $(`.result:visible .fc-day-grid-event:contains("${subject}")`)
.css('background-color');
assert.equal(bg_color, rgb, 'Event background color is set correctly');
},
() => done()
]);
});

View file

@ -1,19 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Note", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Note
() => frappe.tests.make('Note', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: ToDo", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new ToDo
() => frappe.tests.make('ToDo', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Document Follow", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Document Follow
() => frappe.tests.make('Document Follow', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Email Queue", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Email Queue
() => frappe.tests.make('Email Queue', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Email Template", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Email Template
() => frappe.tests.make('Email Template', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Newsletter", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Newsletter
() => frappe.tests.make('Newsletter', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Notification", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Notification
() => frappe.tests.make('Notification', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Braintree Settings", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Braintree Setting
() => frappe.tests.make('Braintree Settings', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: S3 Backup Settings", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new S3 Backup Settings
() => frappe.tests.make('S3 Backup Settings', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Slack Webhook URL", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Slack Webhook URL
() => frappe.tests.make('Slack Webhook URL', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Social Login Key", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Social Login Key
() => frappe.tests.make('Social Login Key', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Stripe Settings", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Stripe Settings
() => frappe.tests.make('Stripe Settings', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Webhook", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Webhook
() => frappe.tests.make('Webhook', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Print Settings", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Print Settings
() => frappe.tests.make('Print Settings', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,20 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Print Style", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Print Style
() => frappe.tests.make('Print Style', [
// values to be set
{print_style_name: 'Test Print Style'},
{css: '/* some css value */'}
]),
]);
});

View file

@ -162,7 +162,6 @@
"public/js/frappe/utils/common.js",
"public/js/frappe/utils/urllib.js",
"public/js/frappe/utils/pretty_date.js",
"public/js/frappe/utils/test_utils.js",
"public/js/frappe/utils/tools.js",
"public/js/frappe/utils/datetime.js",
"public/js/frappe/utils/number_format.js",

View file

@ -1,51 +0,0 @@
// for testing
frappe.click_button = function(text, idx) {
let container = '';
if(typeof idx === 'string') {
container = idx + ' ';
idx = 0;
}
let element = $(`${container}.btn:contains("${text}"):visible`);
if(!element.length) {
throw `did not find any button containing ${text}`;
}
element.get(idx || 0).click();
return frappe.timeout(0.5);
};
frappe.click_link = function(text, idx) {
let element = $(`a:contains("${text}"):visible`);
if(!element.length) {
throw `did not find any link containing ${text}`;
}
element.get(idx || 0).click();
return frappe.timeout(0.5);
};
frappe.click_element = function(selector, idx) {
// Selector by class name like $(`.cart-items`)
let element = $(`${selector}`);
if(!element.length) {
throw `did not find any link containing ${selector}`;
}
element.get(idx || 0).click();
return frappe.timeout(0.5);
};
frappe.set_control= function(fieldname, value) {
let control = $(`.form-control[data-fieldname="${fieldname}"]:visible`);
if(!control.length) {
throw `did not find any control with fieldname ${fieldname}`;
}
control.val(value).trigger('change');
return frappe.timeout(0.5);
};
frappe.click_check = function(label, idx) {
let check = $(`.checkbox:contains("${label}") input`);
if(!check.length) {
throw `did not find any checkbox with label ${label}`;
}
check.get(idx || 0).click();
return frappe.timeout(0.5);
};

View file

@ -1,436 +0,0 @@
/*!
* QUnit 2.3.3
* https://qunitjs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2017-06-02T14:07Z
*/
/** Font Family and Sizes */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult {
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
}
#qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
#qunit-tests { font-size: smaller; }
/** Resets */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
margin: 0;
padding: 0;
}
/** Header (excluding toolbar) */
#qunit-header {
padding: 0.5em 0 0.5em 1em;
color: #8699A4;
background-color: #0D3349;
font-size: 1.5em;
line-height: 1em;
font-weight: 400;
border-radius: 5px 5px 0 0;
}
#qunit-header a {
text-decoration: none;
color: #C2CCD1;
}
#qunit-header a:hover,
#qunit-header a:focus {
color: #FFF;
}
#qunit-banner {
height: 5px;
}
#qunit-filteredTest {
padding: 0.5em 1em 0.5em 1em;
color: #366097;
background-color: #F4FF77;
}
#qunit-userAgent {
padding: 0.5em 1em 0.5em 1em;
color: #FFF;
background-color: #2B81AF;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
/** Toolbar */
#qunit-testrunner-toolbar {
padding: 0.5em 1em 0.5em 1em;
color: #5E740B;
background-color: #EEE;
}
#qunit-testrunner-toolbar .clearfix {
height: 0;
clear: both;
}
#qunit-testrunner-toolbar label {
display: inline-block;
}
#qunit-testrunner-toolbar input[type=checkbox],
#qunit-testrunner-toolbar input[type=radio] {
margin: 3px;
vertical-align: -2px;
}
#qunit-testrunner-toolbar input[type=text] {
box-sizing: border-box;
height: 1.6em;
}
.qunit-url-config,
.qunit-filter,
#qunit-modulefilter {
display: inline-block;
line-height: 2.1em;
}
.qunit-filter,
#qunit-modulefilter {
float: right;
position: relative;
margin-left: 1em;
}
.qunit-url-config label {
margin-right: 0.5em;
}
#qunit-modulefilter-search {
box-sizing: border-box;
width: 400px;
}
#qunit-modulefilter-search-container:after {
position: absolute;
right: 0.3em;
content: "\25bc";
color: black;
}
#qunit-modulefilter-dropdown {
/* align with #qunit-modulefilter-search */
box-sizing: border-box;
width: 400px;
position: absolute;
right: 0;
top: 50%;
margin-top: 0.8em;
border: 1px solid #D3D3D3;
border-top: none;
border-radius: 0 0 .25em .25em;
color: #000;
background-color: #F5F5F5;
z-index: 99;
}
#qunit-modulefilter-dropdown a {
color: inherit;
text-decoration: none;
}
#qunit-modulefilter-dropdown .clickable.checked {
font-weight: bold;
color: #000;
background-color: #D2E0E6;
}
#qunit-modulefilter-dropdown .clickable:hover {
color: #FFF;
background-color: #0D3349;
}
#qunit-modulefilter-actions {
display: block;
overflow: auto;
/* align with #qunit-modulefilter-dropdown-list */
font: smaller/1.5em sans-serif;
}
#qunit-modulefilter-dropdown #qunit-modulefilter-actions > * {
box-sizing: border-box;
max-height: 2.8em;
display: block;
padding: 0.4em;
}
#qunit-modulefilter-dropdown #qunit-modulefilter-actions > button {
float: right;
font: inherit;
}
#qunit-modulefilter-dropdown #qunit-modulefilter-actions > :last-child {
/* insert padding to align with checkbox margins */
padding-left: 3px;
}
#qunit-modulefilter-dropdown-list {
max-height: 200px;
overflow-y: auto;
margin: 0;
border-top: 2px groove threedhighlight;
padding: 0.4em 0 0;
font: smaller/1.5em sans-serif;
}
#qunit-modulefilter-dropdown-list li {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#qunit-modulefilter-dropdown-list .clickable {
display: block;
padding-left: 0.15em;
}
/** Tests: Pass/Fail */
#qunit-tests {
list-style-position: inside;
}
#qunit-tests li {
padding: 0.4em 1em 0.4em 1em;
border-bottom: 1px solid #FFF;
list-style-position: inside;
}
#qunit-tests > li {
display: none;
}
#qunit-tests li.running,
#qunit-tests li.pass,
#qunit-tests li.fail,
#qunit-tests li.skipped,
#qunit-tests li.aborted {
display: list-item;
}
#qunit-tests.hidepass {
position: relative;
}
#qunit-tests.hidepass li.running,
#qunit-tests.hidepass li.pass:not(.todo) {
visibility: hidden;
position: absolute;
width: 0;
height: 0;
padding: 0;
border: 0;
margin: 0;
}
#qunit-tests li strong {
cursor: pointer;
}
#qunit-tests li.skipped strong {
cursor: default;
}
#qunit-tests li a {
padding: 0.5em;
color: #C2CCD1;
text-decoration: none;
}
#qunit-tests li p a {
padding: 0.25em;
color: #6B6464;
}
#qunit-tests li a:hover,
#qunit-tests li a:focus {
color: #000;
}
#qunit-tests li .runtime {
float: right;
font-size: smaller;
}
.qunit-assert-list {
margin-top: 0.5em;
padding: 0.5em;
background-color: #FFF;
border-radius: 5px;
}
.qunit-source {
margin: 0.6em 0 0.3em;
}
.qunit-collapsed {
display: none;
}
#qunit-tests table {
border-collapse: collapse;
margin-top: 0.2em;
}
#qunit-tests th {
text-align: right;
vertical-align: top;
padding: 0 0.5em 0 0;
}
#qunit-tests td {
vertical-align: top;
}
#qunit-tests pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
}
#qunit-tests del {
color: #374E0C;
background-color: #E0F2BE;
text-decoration: none;
}
#qunit-tests ins {
color: #500;
background-color: #FFCACA;
text-decoration: none;
}
/*** Test Counts */
#qunit-tests b.counts { color: #000; }
#qunit-tests b.passed { color: #5E740B; }
#qunit-tests b.failed { color: #710909; }
#qunit-tests li li {
padding: 5px;
background-color: #FFF;
border-bottom: none;
list-style-position: inside;
}
/*** Passing Styles */
#qunit-tests li li.pass {
color: #3C510C;
background-color: #FFF;
border-left: 10px solid #C6E746;
}
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
#qunit-tests .pass .test-name { color: #366097; }
#qunit-tests .pass .test-actual,
#qunit-tests .pass .test-expected { color: #999; }
#qunit-banner.qunit-pass { background-color: #C6E746; }
/*** Failing Styles */
#qunit-tests li li.fail {
color: #710909;
background-color: #FFF;
border-left: 10px solid #EE5757;
white-space: pre;
}
#qunit-tests > li:last-child {
border-radius: 0 0 5px 5px;
}
#qunit-tests .fail { color: #000; background-color: #EE5757; }
#qunit-tests .fail .test-name,
#qunit-tests .fail .module-name { color: #000; }
#qunit-tests .fail .test-actual { color: #EE5757; }
#qunit-tests .fail .test-expected { color: #008000; }
#qunit-banner.qunit-fail { background-color: #EE5757; }
/*** Aborted tests */
#qunit-tests .aborted { color: #000; background-color: orange; }
/*** Skipped tests */
#qunit-tests .skipped {
background-color: #EBECE9;
}
#qunit-tests .qunit-todo-label,
#qunit-tests .qunit-skipped-label {
background-color: #F4FF77;
display: inline-block;
font-style: normal;
color: #366097;
line-height: 1.8em;
padding: 0 0.5em;
margin: -0.4em 0.4em -0.4em 0;
}
#qunit-tests .qunit-todo-label {
background-color: #EEE;
}
/** Result */
#qunit-testresult {
color: #2B81AF;
background-color: #D2E0E6;
border-bottom: 1px solid #FFF;
}
#qunit-testresult .clearfix {
height: 0;
clear: both;
}
#qunit-testresult .module-name {
font-weight: 700;
}
#qunit-testresult-display {
padding: 0.5em 1em 0.5em 1em;
width: 85%;
float:left;
}
#qunit-testresult-controls {
padding: 0.5em 1em 0.5em 1em;
width: 10%;
float:left;
}
/** Fixture */
#qunit-fixture {
position: absolute;
top: -10000px;
left: -10000px;
width: 1000px;
height: 1000px;
}

File diff suppressed because it is too large Load diff

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Contact Us Settings", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Contact Us Settings
() => frappe.tests.make('Contact Us Settings', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Web Form", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Web Form
() => frappe.tests.make('Web Form', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,23 +0,0 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Web Page", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Web Page
() => frappe.tests.make('Web Page', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View file

@ -1,59 +0,0 @@
QUnit.module('setup');
QUnit.test("Test Workflow", function(assert) {
assert.expect(1);
let done = assert.async();
frappe.run_serially([
() => {
return frappe.tests.make('Workflow', [
{workflow_name: "Test User Workflow"},
{document_type: "User"},
{is_active: 1},
{override_status: 1},
{states: [
[
{state: 'Pending'},
{doc_status: 0},
{allow_edit: 'Administrator'}
],
[
{state: 'Approved'},
{doc_status: 1},
{allow_edit: 'Administrator'}
],
[
{state: 'Rejected'},
{doc_status: 2},
{allow_edit: 'Administrator'}
]
]},
{transitions: [
[
{state: 'Pending'},
{action: 'Review'},
{next_state: 'Pending'},
{allowed: 'Administrator'}
],
[
{state: 'Pending'},
{action: 'Approve'},
{next_state: 'Approved'},
{allowed: 'Administrator'}
],
[
{state: 'Approved'},
{action: 'Reject'},
{next_state: 'Rejected'},
{allowed: 'Administrator'}
],
]},
{workflow_state_field: 'workflow_state'}
]);
},
() => frappe.timeout(1),
() => {assert.equal($('.msgprint').text(), "Created Custom Field workflow_state in User", "Workflow created");},
() => frappe.tests.click_button('Close'),
() => done()
]);
});

View file

@ -1,51 +0,0 @@
QUnit.module('setup');
QUnit.test("Test Workflow", function(assert) {
assert.expect(5);
let done = assert.async();
frappe.run_serially([
() => frappe.set_route('Form', 'User', 'New User 1'),
() => frappe.timeout(1),
() => {
cur_frm.set_value('email', 'test1@testmail.com');
cur_frm.set_value('first_name', 'Test Name');
cur_frm.set_value('send_welcome_email', 0);
return cur_frm.save();
},
() => frappe.tests.click_button('Actions'),
() => frappe.timeout(0.5),
() => {
let review = $(`.dropdown-menu li:contains("Review"):visible`).size();
let approve = $(`.dropdown-menu li:contains("Approve"):visible`).size();
assert.equal(review, 1, "Review Action exists");
assert.equal(approve, 1, "Approve Action exists");
},
() => frappe.tests.click_dropdown_item('Approve'),
() => frappe.timeout(1),
() => frappe.tests.click_button('Yes'),
() => frappe.timeout(1),
() => {
assert.equal($('.msgprint').text(), "Did not saveInsufficient Permission for User", "Approve action working");
frappe.tests.click_button('Close');
},
() => frappe.timeout(1),
() => {
cur_frm.set_value('role_profile_name', 'Test 2');
return cur_frm.save();
},
() => frappe.tests.click_button('Actions'),
() => frappe.timeout(1),
() => {
let reject = $(`.dropdown-menu li:contains("Reject"):visible`).size();
assert.equal(reject, 1, "Reject Action exists");
},
() => frappe.tests.click_dropdown_item('Reject'),
() => frappe.timeout(1),
() => {
if(frappe.tests.click_button('Close'))
assert.equal(1, 1, "Reject action works");
},
() => done()
]);
});