This commit is contained in:
@@ -140,4 +140,4 @@ 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' }))
|
||||
return base
|
||||
return base
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
var testTemplate = require('./ui_test_template.js');
|
||||
|
||||
var waitFor = testTemplate.waitFor;
|
||||
|
||||
function test (page) {
|
||||
testTemplate.runTest(function testBannerTour (page) {
|
||||
var waitFor = testTemplate.waitFor;
|
||||
page.evaluate(function () {
|
||||
localStorage.clear();
|
||||
});
|
||||
@@ -28,6 +27,4 @@ function test (page) {
|
||||
phantom.exit();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
testTemplate.runTest(test);
|
||||
});
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
function waitFor(ready, callback, timeout) {
|
||||
var timeoutMillis = timeout ? Math.round(timeout*1000) : 30000;
|
||||
var start = new Date().getTime();
|
||||
@@ -19,22 +17,17 @@ function waitFor(ready, callback, timeout) {
|
||||
}, 100);
|
||||
};
|
||||
|
||||
|
||||
|
||||
function runTest (test) {
|
||||
var options = JSON.parse(phantom.args);
|
||||
var port = options.port ? ':'+options.port : '';
|
||||
var path = options.path ? options.path : '';
|
||||
var url = 'http://localhost'+port+path;
|
||||
|
||||
var page = require('webpage').create();
|
||||
|
||||
page.viewportSize = { width: 1920, height: 1080 };
|
||||
page.onError = function(message, trace) {
|
||||
console.log('{ "event": "error", "message": "'+message+'"}');
|
||||
phantom.exit(1);
|
||||
};
|
||||
|
||||
page.open(url, function (status) {
|
||||
if (status !== 'success') {
|
||||
console.log('{ "event": "failure", "message": "'+url+' failed to load"}');
|
||||
|
||||
Reference in New Issue
Block a user