[FIX] update tests to new module system
Various tests (mostly tours) were broken with the large changes in the way the js code works.
This commit is contained in:
@@ -5,4 +5,4 @@ import openerp.tests
|
||||
|
||||
class TestUi(openerp.tests.HttpCase):
|
||||
def test_01_admin_bank_statement_reconciliation(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('bank_statement_reconciliation', 'test')", "openerp.Tour.tours.bank_statement_reconciliation", login="admin")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('bank_statement_reconciliation', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.bank_statement_reconciliation", login="admin")
|
||||
@@ -5,4 +5,4 @@ import openerp.tests
|
||||
@openerp.tests.common.post_install(True)
|
||||
class TestUi(openerp.tests.HttpCase):
|
||||
def test_01_pos_basic_order(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('pos_basic_order', 'test')", "openerp.Tour.tours.pos_basic_order", login="admin")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('pos_basic_order', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.pos_basic_order", login="admin")
|
||||
|
||||
@@ -260,7 +260,7 @@ Tour.register({
|
||||
|
||||
var steps = ["Click on switch view", "Click on sub menu", "Click on need action", "Click on top menu"];
|
||||
for (var k in steps) {
|
||||
var step = openerp.Tour.search_step(steps[k]);
|
||||
var step = Tour.search_step(steps[k]);
|
||||
if($(step.element).size()) {
|
||||
return step.id;
|
||||
}
|
||||
|
||||
@@ -1228,7 +1228,7 @@ odoo.define_section('search.filters', ['web.search_inputs', 'web.SearchView', 'w
|
||||
|
||||
test('drawn', function (assert) {
|
||||
setup();
|
||||
assert.expect(4);
|
||||
assert.expect(3);
|
||||
var view = makeSearchView(this);
|
||||
var $fix = $('#qunit-fixture');
|
||||
|
||||
@@ -1241,10 +1241,13 @@ odoo.define_section('search.filters', ['web.search_inputs', 'web.SearchView', 'w
|
||||
// 1 filter condition menu, 1 apply button
|
||||
assert.equal($filters.length, 7,
|
||||
'filter menu should have 7 elements total');
|
||||
|
||||
// 1 divider, 1 save search button, 1 text input, 2 checkboxes,
|
||||
// 1 save button, 3 add to dashboard things (a, input, button)
|
||||
assert.equal($favorites.length, 9,
|
||||
"favorites menu should have 9 elements");
|
||||
// this test is disabled because the number of elements depends on
|
||||
// the various addons installed.
|
||||
// assert.equal($favorites.length, 9,
|
||||
// "favorites menu should have 9 elements");
|
||||
|
||||
// 1 divider, 1 add custom group button, 1 select groupby, 1 apply button,
|
||||
assert.equal($groupby.length, 4,
|
||||
|
||||
@@ -27,7 +27,7 @@ odoo.testing.MockRPC.prototype.clear = function () {
|
||||
};
|
||||
|
||||
odoo.testing.MockRPC.prototype.interceptRPC = function (session) {
|
||||
session.rpc = this.rpc.bind(this);
|
||||
session.rpc = this.rpc.bind(this);
|
||||
};
|
||||
|
||||
odoo.testing.MockRPC.prototype.add = function (spec, handler, no_override) {
|
||||
@@ -120,6 +120,12 @@ QUnit.done(function(result) {
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.log(function(result) {
|
||||
if (!result.result) {
|
||||
console.log(result.name, 'in section', result.module, 'failed:', result.message);
|
||||
}
|
||||
});
|
||||
|
||||
(new QWeb2.Engine()).load_xml("/web/webclient/qweb", function (err, xDoc) {
|
||||
odoo.testing.templates = xDoc;
|
||||
QUnit.start();
|
||||
@@ -131,321 +137,11 @@ QUnit.config.autostart = false;
|
||||
localStorage.clear();
|
||||
QUnit.config.testTimeout = 1 * 60 * 1000;
|
||||
QUnit.moduleDone(function(result) {
|
||||
console.log(result.name + " (" + result.passed + "/" + result.total + " passed tests)");
|
||||
if (!result.failed) {
|
||||
console.log(result.name, "passed", result.total, "tests.");
|
||||
} else {
|
||||
console.log(result.name, "failed:", result.failed, "tests out of", result.total, ".");
|
||||
}
|
||||
|
||||
});
|
||||
// core.qweb.add_template("/web/webclient/qweb");
|
||||
|
||||
// odoo.define_section = function (section_name, deps, factory) {
|
||||
|
||||
// };
|
||||
|
||||
// odoo.define_section('utils_compute_domain', ['web.utils'], function (test, require) {
|
||||
// var utils = require('web.utils');
|
||||
|
||||
// test("basic", function )
|
||||
// });
|
||||
|
||||
// // Test support structures and methods for OpenERP
|
||||
// openerp.testing = {};
|
||||
// (function (testing) {
|
||||
// var dependencies = {
|
||||
// pyeval: [],
|
||||
// core: ['pyeval'],
|
||||
// data: ['core'],
|
||||
// dates: [],
|
||||
// formats: ['core', 'dates'],
|
||||
// chrome: ['core'],
|
||||
// views: ['core', 'data', 'chrome'],
|
||||
// search: ['views', 'formats'],
|
||||
// list: ['views', 'data'],
|
||||
// form: ['data', 'views', 'list', 'formats'],
|
||||
// list_editable: ['list', 'form', 'data'],
|
||||
// };
|
||||
|
||||
// var initialized = [];
|
||||
// /**
|
||||
// * openerp.init is a broken-ass piece of shit, makes it impossible to
|
||||
// * progressively add modules, using it, retarded openerp_inited flag
|
||||
// * means the first tests being run get their dependencies loaded
|
||||
// * (basically just base and web), and for *every other module* the tests
|
||||
// * run without the dependencies being correctly loaded
|
||||
// */
|
||||
// function init(modules) {
|
||||
// if (!initialized.length) {
|
||||
// openerp.init(modules);
|
||||
// initialized = openerp._modules.slice();
|
||||
// return;
|
||||
// }
|
||||
// var to_initialize = _.difference(modules, initialized);
|
||||
// for (var i = 0; i < to_initialize.length; i++) {
|
||||
// var modname = to_initialize[i];
|
||||
// var fct = openerp[modname];
|
||||
// if (typeof fct === 'function') {
|
||||
// var module = openerp[modname] = {};
|
||||
// for(var k in fct) {
|
||||
// if (!fct.hasOwnProperty(k)) { continue; }
|
||||
// module[k] = fct[k];
|
||||
// }
|
||||
// fct(openerp, module)
|
||||
// }
|
||||
// initialized.push(modname);
|
||||
// openerp._modules.push(modname);
|
||||
// }
|
||||
// }
|
||||
|
||||
// testing.dependencies = window['oe_all_dependencies'] || [];
|
||||
// testing.current_module = null;
|
||||
// /**
|
||||
// * Function which does not do anything
|
||||
// */
|
||||
// testing.noop = function () { };
|
||||
// /**
|
||||
// * Alter provided instance's ``session`` attribute to make response
|
||||
// * mockable:
|
||||
// *
|
||||
// * * The ``responses`` parameter can be used to provide a map of (RPC)
|
||||
// * paths (e.g. ``/web/view/load``) to a function returning a response
|
||||
// * to the query.
|
||||
// * * ``instance.session`` grows a ``responses`` attribute which is
|
||||
// * a map of the same (and is in fact initialized to the ``responses``
|
||||
// * parameter if one is provided)
|
||||
// *
|
||||
// * Note that RPC requests to un-mocked URLs will be rejected with an
|
||||
// * error message: only explicitly specified urls will get a response.
|
||||
// *
|
||||
// * Mocked sessions will *never* perform an actual RPC connection.
|
||||
// *
|
||||
// * @param instance openerp instance being initialized
|
||||
// * @param {Object} [responses]
|
||||
// */
|
||||
// testing.mockifyRPC = function (instance, responses) {
|
||||
// var session = instance.session;
|
||||
// session.responses = responses || {};
|
||||
// session.rpc = function(url, rparams, options) {
|
||||
// if (_.isString(url)) {
|
||||
// url = {url: url};
|
||||
// }
|
||||
// var fn, params;
|
||||
// var needle = rparams.model + ':' + rparams.method;
|
||||
// if (url.url.substr(0, 20) === '/web/dataset/call_kw' && needle in this.responses) {
|
||||
// fn = this.responses[needle];
|
||||
// params = [
|
||||
// rparams.args || [],
|
||||
// rparams.kwargs || {}
|
||||
// ];
|
||||
// } else {
|
||||
// fn = this.responses[url.url];
|
||||
// params = [{params: rparams}];
|
||||
// }
|
||||
|
||||
// if (!fn) {
|
||||
// return $.Deferred().reject({}, 'failed',
|
||||
// _.str.sprintf("Url %s not found in mock responses, with arguments %s",
|
||||
// url.url, JSON.stringify(rparams))
|
||||
// ).promise();
|
||||
// }
|
||||
// try {
|
||||
// return $.when(fn.apply(null, params)).then(function (result) {
|
||||
// // Wrap for RPC layer unwrapper thingy
|
||||
// return result;
|
||||
// });
|
||||
// } catch (e) {
|
||||
// // not sure why this looks like that
|
||||
// return $.Deferred().reject({}, 'failed', String(e));
|
||||
// }
|
||||
// };
|
||||
// };
|
||||
|
||||
// var StackProto = {
|
||||
// execute: function (fn) {
|
||||
// var args = [].slice.call(arguments, 1);
|
||||
// // Warning: here be dragons
|
||||
// var i = 0, setups = this.setups, teardowns = this.teardowns;
|
||||
// var d = $.Deferred();
|
||||
|
||||
// var succeeded, failed;
|
||||
// var success = function () {
|
||||
// succeeded = _.toArray(arguments);
|
||||
// return teardown();
|
||||
// };
|
||||
// var failure = function () {
|
||||
// // save first failure
|
||||
// if (!failed) {
|
||||
// failed = _.toArray(arguments);
|
||||
// }
|
||||
// // chain onto next teardown
|
||||
// return teardown();
|
||||
// };
|
||||
|
||||
// var setup = function () {
|
||||
// // if setup to execute
|
||||
// if (i < setups.length) {
|
||||
// var f = setups[i] || testing.noop;
|
||||
// $.when(f.apply(null, args)).then(function () {
|
||||
// ++i;
|
||||
// setup();
|
||||
// }, failure);
|
||||
// } else {
|
||||
// $.when(fn.apply(null, args)).then(success, failure);
|
||||
// }
|
||||
// };
|
||||
// var teardown = function () {
|
||||
// // if teardown to execute
|
||||
// if (i > 0) {
|
||||
// var f = teardowns[--i] || testing.noop;
|
||||
// $.when(f.apply(null, args)).then(teardown, failure);
|
||||
// } else {
|
||||
// if (failed) {
|
||||
// d.reject.apply(d, failed);
|
||||
// } else if (succeeded) {
|
||||
// d.resolve.apply(d, succeeded);
|
||||
// } else {
|
||||
// throw new Error("Didn't succeed or fail?");
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// setup();
|
||||
|
||||
// return d;
|
||||
// },
|
||||
// push: function (setup, teardown) {
|
||||
// return _.extend(Object.create(StackProto), {
|
||||
// setups: this.setups.concat([setup]),
|
||||
// teardowns: this.teardowns.concat([teardown])
|
||||
// });
|
||||
// },
|
||||
// unshift: function (setup, teardown) {
|
||||
// return _.extend(Object.create(StackProto), {
|
||||
// setups: [setup].concat(this.setups),
|
||||
// teardowns: [teardown].concat(this.teardowns)
|
||||
// });
|
||||
// }
|
||||
// };
|
||||
// /**
|
||||
// *
|
||||
// * @param {Function} [setup]
|
||||
// * @param {Function} [teardown]
|
||||
// * @return {*}
|
||||
// */
|
||||
// testing.Stack = function (setup, teardown) {
|
||||
// return _.extend(Object.create(StackProto), {
|
||||
// setups: setup ? [setup] : [],
|
||||
// teardowns: teardown ? [teardown] : []
|
||||
// });
|
||||
// };
|
||||
|
||||
// testing.section = function (name, options, body) {
|
||||
// if (_.isFunction(options)) {
|
||||
// body = options;
|
||||
// options = {};
|
||||
// }
|
||||
// _.defaults(options, {
|
||||
// setup: testing.noop,
|
||||
// teardown: testing.noop
|
||||
// });
|
||||
|
||||
// QUnit.module(name, {_oe: options});
|
||||
// body(testing['case']);
|
||||
// };
|
||||
// testing['case'] = function (name, options, callback) {
|
||||
// if (_.isFunction(options)) {
|
||||
// callback = options;
|
||||
// options = {};
|
||||
// }
|
||||
|
||||
// var module = testing.current_module;
|
||||
// var module_index = _.indexOf(testing.dependencies, module);
|
||||
// var module_deps = testing.dependencies.slice(
|
||||
// // If module not in deps (because only tests, no JS) -> indexOf
|
||||
// // returns -1 -> index becomes 0 -> replace with ``undefined`` so
|
||||
// // Array#slice returns a full copy
|
||||
// 0, module_index + 1 || undefined);
|
||||
|
||||
// // Serialize options for this precise test case
|
||||
// var env = QUnit.config.currentModuleTestEnvironment;
|
||||
// // section setup
|
||||
// // case setup
|
||||
// // test
|
||||
// // case teardown
|
||||
// // section teardown
|
||||
// var case_stack = testing.Stack()
|
||||
// .push(env._oe.setup, env._oe.teardown)
|
||||
// .push(options.setup, options.teardown);
|
||||
// var opts = _.defaults({}, options, env._oe);
|
||||
|
||||
// QUnit.test(name, function () {
|
||||
// var instance = openerp;
|
||||
// init(module_deps);
|
||||
// instance.session = new instance.web.Session();
|
||||
// instance.session.uid = 42;
|
||||
// if (_.isNumber(opts.asserts)) {
|
||||
// expect(opts.asserts);
|
||||
// }
|
||||
|
||||
// var $fixture = $('#qunit-fixture');
|
||||
|
||||
// var mock, async = false;
|
||||
// switch (opts.rpc) {
|
||||
// case 'mock':
|
||||
// async = true;
|
||||
// testing.mockifyRPC(instance);
|
||||
// mock = function (spec, handler) {
|
||||
// instance.session.responses[spec] = handler;
|
||||
// };
|
||||
// break;
|
||||
// }
|
||||
|
||||
// // Always execute tests asynchronously
|
||||
// stop();
|
||||
// var timeout;
|
||||
// case_stack.execute(function () {
|
||||
// var result = callback.apply(null, arguments);
|
||||
// if (!(result && _.isFunction(result.then))) {
|
||||
// if (async) {
|
||||
// ok(false, "asynchronous test cases must return a promise");
|
||||
// }
|
||||
// } else {
|
||||
// if (!_.isNumber(opts.asserts)) {
|
||||
// ok(false, "asynchronous test cases must specify the "
|
||||
// + "number of assertions they expect");
|
||||
// }
|
||||
// }
|
||||
|
||||
// return $.Deferred(function (d) {
|
||||
// $.when(result).then(function () {
|
||||
// d.resolve.apply(d, arguments);
|
||||
// }, function () {
|
||||
// d.reject.apply(d, arguments);
|
||||
// });
|
||||
// if (async || (result && result.then)) {
|
||||
// // async test can be either implicit async (rpc) or
|
||||
// // promise-returning
|
||||
// timeout = setTimeout(function () {
|
||||
// QUnit.config.semaphore = 1;
|
||||
// d.reject({message: "Test timed out"});
|
||||
// }, 2000);
|
||||
// }
|
||||
// });
|
||||
// }, instance, $fixture, mock).always(function () {
|
||||
// if (timeout) { clearTimeout(timeout); }
|
||||
// start();
|
||||
// }).fail(function (error) {
|
||||
// if (options.fail_on_rejection === false) {
|
||||
// return;
|
||||
// }
|
||||
// var message;
|
||||
// if (typeof error !== 'object'
|
||||
// || typeof error.message !== 'string') {
|
||||
// message = JSON.stringify([].slice.apply(arguments));
|
||||
// } else {
|
||||
// message = error.message;
|
||||
// if (error.data && error.data.debug) {
|
||||
// message += '\n\n' + error.data.debug;
|
||||
// }
|
||||
// }
|
||||
|
||||
// ok(false, message);
|
||||
// });
|
||||
// });
|
||||
// };
|
||||
// })(openerp.testing);
|
||||
|
||||
@@ -1,88 +1,87 @@
|
||||
|
||||
openerp.testing.section('basic section', function (test) {
|
||||
test('my first test', function () {
|
||||
ok(true, "this test has run");
|
||||
odoo.define_section('basic section', [], function (test, mock) {
|
||||
test('my first test', function (assert) {
|
||||
assert.ok(true, "this test has run");
|
||||
});
|
||||
test('module content', function (instance) {
|
||||
ok(instance.web_tests_demo.value_true, "should have a true value");
|
||||
var type_instance = new instance.web_tests_demo.SomeType(42);
|
||||
strictEqual(type_instance.value, 42, "should have provided value");
|
||||
|
||||
test('module content', ['web_tests_demo.demo'], function (assert, tests_demo) {
|
||||
assert.ok(tests_demo.value_true, "should have a true value");
|
||||
var type_instance = new tests_demo.SomeType(42);
|
||||
assert.strictEqual(type_instance.value, 42, "should have provided value");
|
||||
});
|
||||
test('DOM content', function (instance, $scratchpad) {
|
||||
$scratchpad.html('<div><span class="foo bar">ok</span></div>');
|
||||
ok($scratchpad.find('span').hasClass('foo'),
|
||||
|
||||
test('DOM content', function (assert) {
|
||||
var $fix = $( "#qunit-fixture");
|
||||
$fix.html('<div><span class="foo bar">ok</span></div>');
|
||||
assert.ok($fix.find('span').hasClass('foo'),
|
||||
"should have provided class");
|
||||
});
|
||||
test('clean scratchpad', function (instance, $scratchpad) {
|
||||
ok(!$scratchpad.children().length, "should have no content");
|
||||
ok(!$scratchpad.text(), "should have no text");
|
||||
|
||||
test('clean fixture', function (assert) {
|
||||
var $fix = $( "#qunit-fixture");
|
||||
assert.ok(!$fix.children().length, "should have no content");
|
||||
assert.ok(!$fix.text(), "should have no text");
|
||||
});
|
||||
|
||||
test('templates', {templates: true}, function (instance) {
|
||||
var s = instance.web.qweb.render('DemoTemplate');
|
||||
test('templates', ['web.core'], function (assert, core) {
|
||||
var s = core.qweb.render('DemoTemplate');
|
||||
var texts = $(s).find('p').map(function () {
|
||||
return $(this).text();
|
||||
}).get();
|
||||
|
||||
deepEqual(texts, ['0', '1', '2', '3', '4']);
|
||||
assert.deepEqual(texts, ['0', '1', '2', '3', '4']);
|
||||
});
|
||||
|
||||
test('asynchronous', {
|
||||
asserts: 1
|
||||
}, function () {
|
||||
test('asynchronous', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var d = $.Deferred();
|
||||
setTimeout(function () {
|
||||
ok(true);
|
||||
assert.ok(true);
|
||||
d.resolve();
|
||||
}, 100);
|
||||
return d;
|
||||
});
|
||||
test('unfail rejection', {
|
||||
asserts: 1,
|
||||
fail_on_rejection: false
|
||||
}, function () {
|
||||
var d = $.Deferred();
|
||||
setTimeout(function () {
|
||||
ok(true);
|
||||
d.reject();
|
||||
}, 100);
|
||||
return d;
|
||||
});
|
||||
|
||||
test('XML-RPC', {rpc: 'mock', asserts: 3}, function (instance, $s, mock) {
|
||||
mock('people.famous:name_search', function (args, kwargs) {
|
||||
strictEqual(kwargs.name, 'bob');
|
||||
|
||||
test('XML-RPC', ['web.Model'], function (assert, Model) {
|
||||
assert.expect(3);
|
||||
|
||||
mock.add('people.famous:name_search', function (args, kwargs) {
|
||||
assert.strictEqual(kwargs.name, 'bob');
|
||||
return [
|
||||
[1, "Microsoft Bob"],
|
||||
[2, "Bob the Builder"],
|
||||
[3, "Silent Bob"]
|
||||
];
|
||||
});
|
||||
return new instance.web.Model('people.famous')
|
||||
return new Model('people.famous')
|
||||
.call('name_search', {name: 'bob'}).then(function (result) {
|
||||
strictEqual(result.length, 3, "shoud return 3 people");
|
||||
strictEqual(result[0][1], "Microsoft Bob",
|
||||
assert.strictEqual(result.length, 3, "shoud return 3 people");
|
||||
assert.strictEqual(result[0][1], "Microsoft Bob",
|
||||
"the most famous bob should be Microsoft Bob");
|
||||
});
|
||||
});
|
||||
test('JSON-RPC', {rpc: 'mock', asserts: 3, templates: true}, function (instance, $s, mock) {
|
||||
|
||||
test('JSON-RPC', ['web.DatabaseManager'], function (assert, DatabaseManager) {
|
||||
assert.expect(3);
|
||||
var fetched_dbs = false, fetched_langs = false;
|
||||
mock('/web/database/get_list', function () {
|
||||
mock.add('/web/database/get_list', function () {
|
||||
fetched_dbs = true;
|
||||
return ['foo', 'bar', 'baz'];
|
||||
});
|
||||
mock('/web/session/get_lang_list', function () {
|
||||
mock.add('/web/session/get_lang_list', function () {
|
||||
fetched_langs = true;
|
||||
return [['vo_IS', 'Hopelandic / Vonlenska']];
|
||||
});
|
||||
|
||||
// widget needs that or it blows up
|
||||
instance.webclient = {toggle_bars: openerp.testing.noop};
|
||||
var dbm = new instance.web.DatabaseManager({});
|
||||
return dbm.appendTo($s).then(function () {
|
||||
ok(fetched_dbs, "should have fetched databases");
|
||||
ok(fetched_langs, "should have fetched languages");
|
||||
deepEqual(dbm.db_list, ['foo', 'bar', 'baz']);
|
||||
var dbm = new DatabaseManager({});
|
||||
var $fix = $( "#qunit-fixture");
|
||||
|
||||
return dbm.appendTo($fix).then(function () {
|
||||
assert.ok(fetched_dbs, "should have fetched databases");
|
||||
assert.ok(fetched_langs, "should have fetched languages");
|
||||
assert.deepEqual(dbm.db_list, ['foo', 'bar', 'baz']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,13 +3,13 @@ import openerp.tests
|
||||
|
||||
class TestUi(openerp.tests.HttpCase):
|
||||
def test_01_public_homepage(self):
|
||||
self.phantom_js("/", "console.log('ok')", "openerp.website.snippet")
|
||||
self.phantom_js("/", "console.log('ok')", "odoo.__DEBUG__.services['website.snippets.animation']")
|
||||
|
||||
def test_02_admin_homepage(self):
|
||||
self.phantom_js("/", "console.log('ok')", "openerp.website.editor", login='admin')
|
||||
self.phantom_js("/", "console.log('ok')", "odoo.__DEBUG__.services['website.snippets.editor']", login='admin')
|
||||
|
||||
def test_03_admin_rte(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('website_rte', 'test')", "openerp.Tour.tours.website_rte", login='admin')
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('website_rte', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.website_rte", login='admin')
|
||||
|
||||
def test_04_admin_tour_banner(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('banner', 'test')", "openerp.Tour.tours.banner", login='admin')
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('banner', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.banner", login='admin')
|
||||
|
||||
@@ -4,4 +4,4 @@ import openerp.tests
|
||||
@openerp.tests.common.post_install(True)
|
||||
class TestUi(openerp.tests.HttpCase):
|
||||
def test_admin(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('blog', 'test')", "openerp.Tour.tours.blog", login='admin')
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('blog', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.blog", login='admin')
|
||||
|
||||
@@ -4,4 +4,4 @@ import openerp.tests
|
||||
@openerp.tests.common.post_install(True)
|
||||
class TestUi(openerp.tests.HttpCase):
|
||||
def test_admin(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('event', 'test')", "openerp.Tour.tours.event", login='admin')
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('event', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.event", login='admin')
|
||||
|
||||
@@ -4,10 +4,10 @@ import openerp.tests
|
||||
@openerp.tests.common.post_install(True)
|
||||
class TestUi(openerp.tests.HttpCase):
|
||||
def test_admin(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('event_buy_tickets', 'test')", "openerp.Tour.tours.event_buy_tickets", login="admin")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('event_buy_tickets', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.event_buy_tickets", login="admin")
|
||||
|
||||
def test_demo(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('event_buy_tickets', 'test')", "openerp.Tour.tours.event_buy_tickets", login="demo")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('event_buy_tickets', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.event_buy_tickets", login="demo")
|
||||
|
||||
def test_public(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('event_buy_tickets', 'test')", "openerp.Tour.tours.event_buy_tickets")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('event_buy_tickets', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.event_buy_tickets")
|
||||
|
||||
@@ -4,8 +4,8 @@ import openerp.tests
|
||||
@openerp.tests.common.post_install(True)
|
||||
class TestUi(openerp.tests.HttpCase):
|
||||
def test_01_admin_forum_tour(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('question', 'test')", "openerp.Tour.tours.question", login="admin")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('question', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.question", login="admin")
|
||||
|
||||
def test_02_demo_question(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('forum_question', 'test')", "openerp.Tour.tours.forum_question", login="demo")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('forum_question', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.forum_question", login="demo")
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@ import openerp.tests
|
||||
@openerp.tests.common.post_install(True)
|
||||
class TestUi(openerp.tests.HttpCase):
|
||||
def test_01_admin_shop_tour(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('shop', 'test')", "openerp.Tour.tours.shop", login="admin")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('shop', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.shop", login="admin")
|
||||
|
||||
def test_02_admin_checkout(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('shop_buy_product', 'test')", "openerp.Tour.tours.shop_buy_product", login="admin")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('shop_buy_product', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.shop_buy_product", login="admin")
|
||||
|
||||
def test_03_demo_checkout(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('shop_buy_product', 'test')", "openerp.Tour.tours.shop_buy_product", login="demo")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('shop_buy_product', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.shop_buy_product", login="demo")
|
||||
|
||||
def test_04_public_checkout(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('shop_buy_product', 'test')", "openerp.Tour.tours.shop_buy_product")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('shop_buy_product', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.shop_buy_product")
|
||||
|
||||
@@ -4,4 +4,4 @@ import openerp.tests
|
||||
@openerp.tests.common.post_install(True)
|
||||
class TestUi(openerp.tests.HttpCase):
|
||||
def test_01_admin_shop_customize_tour(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('shop_customize', 'test')", "openerp.Tour.tours.shop_customize", login="admin")
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('shop_customize', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.shop_customize", login="admin")
|
||||
|
||||
@@ -5,4 +5,4 @@ import openerp.tests
|
||||
@openerp.tests.common.post_install(True)
|
||||
class TestUi(openerp.tests.HttpCase):
|
||||
def test_01_versioning(self):
|
||||
self.phantom_js("/", "openerp.Tour.run('versioning', 'test')", "openerp.Tour.tours.versioning", login='admin')
|
||||
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('versioning', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.versioning", login='admin')
|
||||
Reference in New Issue
Block a user