[FIX] UI tests config for runbot
bzr revid: ddm@openerp.com-20131227112554-4q839w4xrrnmth0e
This commit is contained in:
@@ -77,7 +77,11 @@ class WebsiteUiSuite(unittest.TestSuite):
|
||||
last_check_time = time.time()
|
||||
|
||||
self._options['timeout'] = self._timeout
|
||||
self._options['port'] = tools.config['xmlrpc_port']
|
||||
self._options['port'] = tools.config.get('xmlrpc_port', 80)
|
||||
self._options['db'] = tools.config.get('db_name', '')
|
||||
# TODO Use correct key
|
||||
self._options['user'] = 'admin'
|
||||
self._options['password'] = tools.config.get('admin_passwd', 'admin')
|
||||
|
||||
phantom = subprocess.Popen([
|
||||
'phantomjs',
|
||||
@@ -139,5 +143,5 @@ class WebsiteUiSuite(unittest.TestSuite):
|
||||
|
||||
def load_tests(loader, base, _):
|
||||
base.addTest(WebsiteUiSuite('dummy_test.js', {}))
|
||||
base.addTest(WebsiteUiSuite('banner_tour_test.js', { 'path': '/web#action=website.action_website_homepage&login=admin&password=admin' }))
|
||||
base.addTest(WebsiteUiSuite('banner_tour_test.js', { 'action': 'website.action_website_homepage' }))
|
||||
return base
|
||||
|
||||
@@ -19,9 +19,16 @@ function waitFor(ready, callback, timeout) {
|
||||
|
||||
function run (test) {
|
||||
var options = JSON.parse(phantom.args);
|
||||
var scheme = options.scheme ? options.scheme+'://' : 'http://';
|
||||
var host = options.host ? options.host : 'localhost';
|
||||
var port = options.port ? ':'+options.port : '';
|
||||
var path = options.path ? options.path : '';
|
||||
var url = 'http://localhost'+port+path;
|
||||
var path = options.path ? options.path : '/web';
|
||||
var params = [];
|
||||
if (options.action) params.push('action='+options.action);
|
||||
if (options.db) params.push('source='+options.db);
|
||||
if (options.user) params.push('login='+options.user);
|
||||
if (options.password) params.push('password='+options.password);
|
||||
var url = scheme+host+port+path+'#'+params.join('&');
|
||||
var page = require('webpage').create();
|
||||
page.viewportSize = { width: 1920, height: 1080 };
|
||||
page.onError = function(message, trace) {
|
||||
|
||||
Reference in New Issue
Block a user