UI functional test runner improvements
- Made selenium version controllable via env variable - Made browser controllable via env variable - Updated default Chrome driver version - Increased some timeouts - Made some check more bulletproof Change-Id: I11cd0c8b32d0b22d6cd08b476b33e248217e8b7c
This commit is contained in:
parent
3525483860
commit
d08d89c0ba
|
@ -176,6 +176,11 @@ Setup for Web UI Tests
|
||||||
cd fuel-web
|
cd fuel-web
|
||||||
./run_tests.sh --webui
|
./run_tests.sh --webui
|
||||||
|
|
||||||
|
By default Firefox browser is used. You can specify the browser using
|
||||||
|
BROWSER environment variable::
|
||||||
|
|
||||||
|
BROWSER=chrome ./run_tests.sh --webui
|
||||||
|
|
||||||
|
|
||||||
.. _running-parallel-tests-py:
|
.. _running-parallel-tests-py:
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ gulp.task('i18n:validate', function() {
|
||||||
validateTranslations(tranlations, locales);
|
validateTranslations(tranlations, locales);
|
||||||
});
|
});
|
||||||
|
|
||||||
var selenium = require('selenium-standalone');
|
|
||||||
var seleniumProcess = null;
|
var seleniumProcess = null;
|
||||||
function shutdownSelenium() {
|
function shutdownSelenium() {
|
||||||
if (seleniumProcess) {
|
if (seleniumProcess) {
|
||||||
|
@ -51,15 +50,27 @@ function shutdownSelenium() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var SELENIUM_VERSION = '2.45.0';
|
||||||
|
var SELENIUM_DRIVERS = {chrome: {version: '2.20'}};
|
||||||
|
|
||||||
gulp.task('selenium:fetch', function(cb) {
|
gulp.task('selenium:fetch', function(cb) {
|
||||||
var defaultVersion = '2.45.0';
|
var selenium = require('selenium-standalone');
|
||||||
selenium.install({version: argv.version || defaultVersion}, cb);
|
selenium.install({
|
||||||
|
version: process.env.SELENIUM_VERSION || SELENIUM_VERSION,
|
||||||
|
dirvers: SELENIUM_DRIVERS
|
||||||
|
}, cb);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('selenium', ['selenium:fetch'], function(cb) {
|
gulp.task('selenium', ['selenium:fetch'], function(cb) {
|
||||||
|
var selenium = require('selenium-standalone');
|
||||||
var port = process.env.SELENIUM_SERVER_PORT || 4444;
|
var port = process.env.SELENIUM_SERVER_PORT || 4444;
|
||||||
selenium.start(
|
selenium.start(
|
||||||
{seleniumArgs: ['--port', port], spawnOptions: {stdio: 'pipe'}},
|
{
|
||||||
|
version: process.env.SELENIUM_VERSION || SELENIUM_VERSION,
|
||||||
|
dirvers: SELENIUM_DRIVERS,
|
||||||
|
seleniumArgs: ['--port', port],
|
||||||
|
spawnOptions: {stdio: 'pipe'}
|
||||||
|
},
|
||||||
function(err, child) {
|
function(err, child) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
child.on('exit', function() {
|
child.on('exit', function() {
|
||||||
|
@ -80,7 +91,7 @@ gulp.task('karma', function(cb) {
|
||||||
var Server = require('karma').Server;
|
var Server = require('karma').Server;
|
||||||
new Server({
|
new Server({
|
||||||
configFile: __dirname + '/karma.config.js',
|
configFile: __dirname + '/karma.config.js',
|
||||||
browsers: [argv.browser || 'firefox']
|
browsers: [argv.browser || process.env.BROWSER || 'firefox']
|
||||||
}, cb).start();
|
}, cb).start();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -88,7 +99,7 @@ function runIntern(params) {
|
||||||
return function() {
|
return function() {
|
||||||
var baseDir = 'static';
|
var baseDir = 'static';
|
||||||
var runner = './node_modules/.bin/intern-runner';
|
var runner = './node_modules/.bin/intern-runner';
|
||||||
var browser = params.browser || argv.browser || 'firefox';
|
var browser = argv.browser || process.env.BROWSER || 'firefox';
|
||||||
var options = [['config', 'tests/intern-' + browser + '.js']];
|
var options = [['config', 'tests/intern-' + browser + '.js']];
|
||||||
var suiteOptions = [];
|
var suiteOptions = [];
|
||||||
['suites', 'functionalSuites'].forEach(function(suiteType) {
|
['suites', 'functionalSuites'].forEach(function(suiteType) {
|
||||||
|
|
|
@ -34,7 +34,7 @@ define([
|
||||||
.clickLinkByText(tabName)
|
.clickLinkByText(tabName)
|
||||||
.end()
|
.end()
|
||||||
.then(pollUntil(function(textToFind) {
|
.then(pollUntil(function(textToFind) {
|
||||||
return $('.cluster-tab.active').text() == textToFind ? true : null; // eslint-disable-line no-undef
|
return window.$('.cluster-tab.active').text() == textToFind || null;
|
||||||
}, [tabName], 3000));
|
}, [tabName], 3000));
|
||||||
},
|
},
|
||||||
removeCluster: function(clusterName) {
|
removeCluster: function(clusterName) {
|
||||||
|
@ -135,7 +135,7 @@ define([
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return self.modal.waitToClose();
|
return self.modal.waitToClose();
|
||||||
})
|
})
|
||||||
.waitForElementDeletion('div.progress-bar', 10000);
|
.waitForElementDeletion('div.progress-bar', 20000);
|
||||||
},
|
},
|
||||||
isTabLocked: function(tabName) {
|
isTabLocked: function(tabName) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
|
@ -110,9 +110,9 @@ define([
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return self.clusterPage.goToTab('Nodes');
|
return self.clusterPage.goToTab('Nodes');
|
||||||
})
|
})
|
||||||
.waitForCssSelector('button.btn-add-nodes', 1000)
|
.waitForCssSelector('button.btn-add-nodes', 3000)
|
||||||
.clickByCssSelector('button.btn-add-nodes')
|
.clickByCssSelector('button.btn-add-nodes')
|
||||||
.waitForCssSelector('.node', 2000)
|
.waitForCssSelector('.node', 3000)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
if (nodeNameFilter) return self.clusterPage.searchForNode(nodeNameFilter);
|
if (nodeNameFilter) return self.clusterPage.searchForNode(nodeNameFilter);
|
||||||
})
|
})
|
||||||
|
@ -123,7 +123,7 @@ define([
|
||||||
return self.clusterPage.checkNodes(nodesAmount, nodeStatus);
|
return self.clusterPage.checkNodes(nodesAmount, nodeStatus);
|
||||||
})
|
})
|
||||||
.clickByCssSelector('.btn-apply')
|
.clickByCssSelector('.btn-apply')
|
||||||
.waitForElementDeletion('.btn-apply', 2000);
|
.waitForElementDeletion('.btn-apply', 3000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return CommonMethods;
|
return CommonMethods;
|
||||||
|
|
|
@ -31,6 +31,7 @@ define([
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
return this.remote
|
return this.remote
|
||||||
|
.setFindTimeout(500)
|
||||||
.setWindowSize(1280, 1024)
|
.setWindowSize(1280, 1024)
|
||||||
.getCurrentUrl()
|
.getCurrentUrl()
|
||||||
.then(function(url) {
|
.then(function(url) {
|
||||||
|
|
|
@ -15,8 +15,9 @@
|
||||||
**/
|
**/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
|
'intern/dojo/node!leadfoot/helpers/pollUntil',
|
||||||
'../../helpers'
|
'../../helpers'
|
||||||
], function() {
|
], function(pollUntil) {
|
||||||
'use strict';
|
'use strict';
|
||||||
function ModalWindow(remote) {
|
function ModalWindow(remote) {
|
||||||
this.remote = remote;
|
this.remote = remote;
|
||||||
|
@ -24,25 +25,29 @@ define([
|
||||||
|
|
||||||
ModalWindow.prototype = {
|
ModalWindow.prototype = {
|
||||||
constructor: ModalWindow,
|
constructor: ModalWindow,
|
||||||
|
modalSelector: '#modal-container > .modal',
|
||||||
waitToOpen: function() {
|
waitToOpen: function() {
|
||||||
return this.remote
|
return this.remote
|
||||||
.waitForCssSelector('div.modal-content', 2000);
|
.waitForCssSelector(this.modalSelector, 2000)
|
||||||
|
.then(pollUntil(function(modalSelector) {
|
||||||
|
return window.$(modalSelector).css('opacity') == 1 || null;
|
||||||
|
}, [this.modalSelector], 3000));
|
||||||
},
|
},
|
||||||
checkTitle: function(expectedTitle) {
|
checkTitle: function(expectedTitle) {
|
||||||
return this.remote
|
return this.remote
|
||||||
.assertElementContainsText('h4.modal-title', expectedTitle, 'Unexpected modal window title');
|
.assertElementContainsText(this.modalSelector + ' h4.modal-title', expectedTitle, 'Unexpected modal window title');
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
return this.remote
|
return this.remote
|
||||||
.clickByCssSelector('.modal-header button.close')
|
.clickByCssSelector(this.modalSelector + ' .modal-header button.close')
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return self.waitToClose();
|
return self.waitToClose();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
clickFooterButton: function(buttonText) {
|
clickFooterButton: function(buttonText) {
|
||||||
return this.remote
|
return this.remote
|
||||||
.findAllByCssSelector('.modal-footer button')
|
.findAllByCssSelector(this.modalSelector + ' .modal-footer button')
|
||||||
.then(function(buttons) {
|
.then(function(buttons) {
|
||||||
return buttons.reduce(function(result, button) {
|
return buttons.reduce(function(result, button) {
|
||||||
return button.getVisibleText()
|
return button.getVisibleText()
|
||||||
|
@ -62,7 +67,7 @@ define([
|
||||||
},
|
},
|
||||||
waitToClose: function() {
|
waitToClose: function() {
|
||||||
return this.remote
|
return this.remote
|
||||||
.waitForElementDeletion('div.modal-content', 5000);
|
.waitForElementDeletion(this.modalSelector, 5000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return ModalWindow;
|
return ModalWindow;
|
||||||
|
|
|
@ -232,7 +232,7 @@ define([
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return dashboardPage.startDeployment();
|
return dashboardPage.startDeployment();
|
||||||
})
|
})
|
||||||
.assertElementDisappears('.dashboard-block .progress', 10000, 'Progress bar disappears after deployment')
|
.assertElementDisappears('.dashboard-block .progress', 60000, 'Progress bar disappears after deployment')
|
||||||
.assertElementAppears('.dashboard-tab .alert strong', 1000, 'Error message is shown when adding error node')
|
.assertElementAppears('.dashboard-tab .alert strong', 1000, 'Error message is shown when adding error node')
|
||||||
.assertElementTextEquals('.dashboard-tab .alert strong', 'Error',
|
.assertElementTextEquals('.dashboard-tab .alert strong', 'Error',
|
||||||
'Deployment failed in case of adding offline nodes')
|
'Deployment failed in case of adding offline nodes')
|
||||||
|
|
|
@ -100,7 +100,7 @@ define([
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return dashboardPage.stopDeployment();
|
return dashboardPage.stopDeployment();
|
||||||
})
|
})
|
||||||
.assertElementDisappears('div.deploy-process div.progress', 5000, 'Deployment stopped')
|
.assertElementDisappears('div.deploy-process div.progress', 20000, 'Deployment stopped')
|
||||||
.assertElementAppears(dashboardPage.deployButtonSelector, 1000, 'Deployment button available')
|
.assertElementAppears(dashboardPage.deployButtonSelector, 1000, 'Deployment button available')
|
||||||
.assertElementContainsText('div.alert-warning strong', 'Success', 'Deployment successfully stopped alert is expected')
|
.assertElementContainsText('div.alert-warning strong', 'Success', 'Deployment successfully stopped alert is expected')
|
||||||
.assertElementNotExists('.go-to-healthcheck', 'Healthcheck link is not visible after stopped deploy')
|
.assertElementNotExists('.go-to-healthcheck', 'Healthcheck link is not visible after stopped deploy')
|
||||||
|
@ -134,7 +134,7 @@ define([
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return dashboardPage.startDeployment();
|
return dashboardPage.startDeployment();
|
||||||
})
|
})
|
||||||
.assertElementDisappears('.dashboard-block .progress', 50000, 'Progress bar disappears after deployment')
|
.assertElementDisappears('.dashboard-block .progress', 60000, 'Progress bar disappears after deployment')
|
||||||
.assertElementAppears('.links-block', 5000, 'Deployment completed')
|
.assertElementAppears('.links-block', 5000, 'Deployment completed')
|
||||||
.assertElementExists('.go-to-healthcheck', 'Healthcheck link is visible after deploy')
|
.assertElementExists('.go-to-healthcheck', 'Healthcheck link is visible after deploy')
|
||||||
.findByLinkText('Horizon')
|
.findByLinkText('Horizon')
|
||||||
|
|
Loading…
Reference in New Issue