diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 5e5eb1a0c..d2cb0d237 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4500,42 +4500,94 @@ } }, "intern": { - "version": "2.2.2", - "from": "intern@2.2.2", + "version": "3.0.6", + "from": "intern@3.0.6", "dependencies": { "istanbul": { - "version": "0.2.16", - "from": "istanbul@0.2.16", + "version": "0.3.17", + "from": "istanbul@0.3.17", "dependencies": { "esprima": { - "version": "1.2.5", - "from": "esprima@1.2.x" + "version": "2.4.1", + "from": "esprima@2.4.x" }, "escodegen": { - "version": "1.3.3", - "from": "escodegen@1.3.x", + "version": "1.6.1", + "from": "escodegen@1.6.x", "dependencies": { - "esutils": { - "version": "1.0.0", - "from": "esutils@~1.0.0" - }, "estraverse": { - "version": "1.5.1", - "from": "estraverse@~1.5.0" + "version": "1.9.3", + "from": "estraverse@^1.9.1" + }, + "esutils": { + "version": "1.1.6", + "from": "esutils@^1.1.6" }, "esprima": { - "version": "1.1.1", - "from": "esprima@~1.1.1" + "version": "1.2.5", + "from": "esprima@^1.2.2" + }, + "optionator": { + "version": "0.5.0", + "from": "optionator@^0.5.0", + "dependencies": { + "prelude-ls": { + "version": "1.1.2", + "from": "prelude-ls@~1.1.1" + }, + "deep-is": { + "version": "0.1.3", + "from": "deep-is@~0.1.2" + }, + "type-check": { + "version": "0.3.2", + "from": "type-check@~0.3.1" + }, + "levn": { + "version": "0.2.5", + "from": "levn@~0.2.5" + }, + "fast-levenshtein": { + "version": "1.0.7", + "from": "fast-levenshtein@~1.0.0" + } + } + }, + "source-map": { + "version": "0.1.43", + "from": "source-map@~0.1.40", + "dependencies": { + "amdefine": { + "version": "1.0.0", + "from": "amdefine@>=0.0.4" + } + } } } }, "handlebars": { - "version": "1.3.0", - "from": "handlebars@1.3.x", + "version": "3.0.0", + "from": "handlebars@3.0.0", "dependencies": { "optimist": { - "version": "0.3.7", - "from": "optimist@~0.3" + "version": "0.6.1", + "from": "optimist@^0.6.1", + "dependencies": { + "minimist": { + "version": "0.0.10", + "from": "minimist@~0.0.1" + } + } + }, + "source-map": { + "version": "0.1.43", + "from": "source-map@^0.1.40", + "dependencies": { + "amdefine": { + "version": "1.0.0", + "from": "amdefine@>=0.0.4" + } + } }, "uglify-js": { "version": "2.3.6", @@ -4544,6 +4596,10 @@ "async": { "version": "0.2.10", "from": "async@~0.2.6" + }, + "optimist": { + "version": "0.3.7", + "from": "optimist@~0.3.5" } } } @@ -4560,46 +4616,28 @@ } }, "nopt": { - "version": "3.0.4", + "version": "3.0.6", "from": "nopt@3.x" }, "fileset": { - "version": "0.1.8", - "from": "fileset@0.1.x", + "version": "0.2.1", + "from": "fileset@0.2.x", "dependencies": { "minimatch": { - "version": "0.4.0", - "from": "minimatch@0.x", + "version": "2.0.10", + "from": "minimatch@2.x", "dependencies": { - "lru-cache": { - "version": "2.7.0", - "from": "lru-cache@2" - }, - "sigmund": { - "version": "1.0.1", - "from": "sigmund@~1.0.0" - } - } - }, - "glob": { - "version": "3.2.11", - "from": "glob@3.x", - "dependencies": { - "inherits": { - "version": "2.0.1", - "from": "inherits@2" - }, - "minimatch": { - "version": "0.3.0", - "from": "minimatch@0.3", + "brace-expansion": { + "version": "1.1.2", + "from": "brace-expansion@^1.0.0", "dependencies": { - "lru-cache": { - "version": "2.7.0", - "from": "lru-cache@2" + "balanced-match": { + "version": "0.3.0", + "from": "balanced-match@^0.3.0" }, - "sigmund": { - "version": "1.0.1", - "from": "sigmund@~1.0.0" + "concat-map": { + "version": "0.0.1", + "from": "concat-map@0.0.1" } } } @@ -4612,8 +4650,12 @@ "from": "which@1.0.x" }, "async": { - "version": "0.9.2", - "from": "async@0.9.x" + "version": "1.5.2", + "from": "async@1.x" + }, + "supports-color": { + "version": "1.3.1", + "from": "supports-color@1.3.x" }, "abbrev": { "version": "1.0.7", @@ -4624,15 +4666,15 @@ "from": "wordwrap@0.0.x" }, "resolve": { - "version": "0.7.4", - "from": "resolve@0.7.x" + "version": "1.1.6", + "from": "resolve@1.1.x" }, "js-yaml": { - "version": "3.4.3", + "version": "3.4.6", "from": "js-yaml@3.x", "dependencies": { "argparse": { - "version": "1.0.2", + "version": "1.0.3", "from": "argparse@^1.0.2", "dependencies": { "sprintf-js": { @@ -4642,8 +4684,22 @@ } }, "esprima": { - "version": "2.7.0", + "version": "2.7.1", "from": "esprima@^2.6.0" + }, + "inherit": { + "version": "2.2.2", + "from": "inherit@^2.2.2" + } + } + }, + "once": { + "version": "1.3.3", + "from": "once@1.x", + "dependencies": { + "wrappy": { + "version": "1.0.1", + "from": "wrappy@1" } } } @@ -4660,48 +4716,53 @@ } }, "dojo": { - "version": "2.0.0-dev", - "from": "https://github.com/csnover/dojo2-core/archive/ebfa11ba3972944218623a4bd9d124cb8108d70c.tar.gz", - "resolved": "https://github.com/csnover/dojo2-core/archive/ebfa11ba3972944218623a4bd9d124cb8108d70c.tar.gz" + "version": "2.0.0-alpha.6", + "from": "dojo@2.0.0-alpha.6" }, "chai": { - "version": "1.9.1", - "from": "chai@1.9.1", + "version": "3.0.0", + "from": "chai@3.0.0", "dependencies": { "assertion-error": { - "version": "1.0.0", - "from": "assertion-error@1.0.0" + "version": "1.0.1", + "from": "assertion-error@^1.0.1" }, "deep-eql": { "version": "0.1.3", - "from": "deep-eql@0.1.3", + "from": "deep-eql@^0.1.3", "dependencies": { "type-detect": { "version": "0.1.1", "from": "type-detect@0.1.1" } } + }, + "type-detect": { + "version": "1.0.0", + "from": "type-detect@^1.0.0" } } }, "leadfoot": { - "version": "1.2.1", - "from": "leadfoot@1.2.1", + "version": "1.6.4", + "from": "leadfoot@1.6.4", "dependencies": { - "dojo": { - "version": "2.0.0-alpha4", - "from": "dojo@2.0.0-alpha4" + "jszip": { + "version": "2.5.0", + "from": "jszip@2.5.0", + "dependencies": { + "pako": { + "version": "0.2.8", + "from": "pako@~0.2.5" + } + } } } }, "digdug": { - "version": "1.2.1", - "from": "digdug@1.2.1", + "version": "1.3.2", + "from": "digdug@1.3.2", "dependencies": { - "dojo": { - "version": "2.0.0-alpha4", - "from": "dojo@2.0.0-alpha4" - }, "decompress": { "version": "0.2.3", "from": "decompress@0.2.3", diff --git a/package.json b/package.json index e44a6ef67..2831fa91e 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "gulp-eslint": "1.0.0", "gulp-lintspaces": "0.3.2", "gulp-shell": "0.4.1", - "intern": "2.2.2", + "intern": "3.0.6", "karma": "~0.13.9", "karma-chai": "~0.1.0", "karma-mocha": "~0.2.0", diff --git a/static/tests/functional/config/intern.js b/static/tests/functional/config/intern.js index 6229575ef..03af1a0d8 100644 --- a/static/tests/functional/config/intern.js +++ b/static/tests/functional/config/intern.js @@ -23,6 +23,6 @@ define(function() { maxConcurrency: 1, grep: /^/, excludeInstrumentation: /^/, - reporters: ['console', 'tests/functional/screenshot_on_fail'] + reporters: ['Runner', 'tests/functional/screenshot_on_fail'] }; }); diff --git a/static/tests/functional/helpers.js b/static/tests/functional/helpers.js index d3385de8e..0e721d988 100644 --- a/static/tests/functional/helpers.js +++ b/static/tests/functional/helpers.js @@ -17,9 +17,8 @@ define([ 'intern/dojo/node!lodash', 'intern/chai!assert', - 'intern/dojo/node!fs', 'intern/dojo/node!leadfoot/Command' -], function(_, assert, fs, Command) { +], function(_, assert, Command) { 'use strict'; _.defaults(Command.prototype, { @@ -39,20 +38,6 @@ define([ .end(); }); }, - takeScreenshotAndSave: function(filename) { - return new this.constructor(this, function() { - return this.parent - .takeScreenshot() - .then(function(buffer) { - var targetDir = process.env.ARTIFACTS || process.cwd(); - if (!filename) filename = new Date().toTimeString(); - filename = filename.replace(/[\s\*\?\\\/]/g, '_'); - filename = targetDir + '/' + filename + '.png'; - console.log('Saving screenshot to', filename); // eslint-disable-line no-console - fs.writeFileSync(filename, buffer); - }); - }); - }, waitForCssSelector: function(cssSelector, timeout) { return new this.constructor(this, function() { var self = this, currentTimeout; @@ -110,7 +95,6 @@ define([ x = element; element = null; } - return new this.constructor(this, function() { this._session._dragSource = { element: element || this.parent._context[0], diff --git a/static/tests/functional/pages/clusters.js b/static/tests/functional/pages/clusters.js index 9f4734061..738a9d4f1 100644 --- a/static/tests/functional/pages/clusters.js +++ b/static/tests/functional/pages/clusters.js @@ -86,6 +86,7 @@ define([ } return true; }) + .end() .waitForCssSelector('.dashboard-tab', 1000); } }; diff --git a/static/tests/functional/pages/common.js b/static/tests/functional/pages/common.js index a30e043ba..2d0a9d18d 100644 --- a/static/tests/functional/pages/common.js +++ b/static/tests/functional/pages/common.js @@ -18,12 +18,13 @@ define([ 'intern/dojo/node!lodash', 'intern/chai!assert', 'tests/functional/helpers', + 'intern/dojo/node!leadfoot/helpers/pollUntil', 'tests/functional/pages/login', 'tests/functional/pages/welcome', 'tests/functional/pages/cluster', 'tests/functional/pages/clusters' ], -function(_, assert, Helpers, LoginPage, WelcomePage, ClusterPage, ClustersPage) { +function(_, assert, Helpers, pollUntil, LoginPage, WelcomePage, ClusterPage, ClustersPage) { 'use strict'; function CommonMethods(remote) { this.remote = remote; @@ -113,6 +114,9 @@ function(_, assert, Helpers, LoginPage, WelcomePage, ClusterPage, ClustersPage) .waitForCssSelector('button.btn-add-nodes', 3000) .clickByCssSelector('button.btn-add-nodes') .waitForCssSelector('.node', 3000) + .then(pollUntil(function() { + return window.$('.node-list-management-buttons').is(':visible') && window.$('.role-panel').is(':visible') || null; + }, 3000)) .then(function() { if (nodeNameFilter) return self.clusterPage.searchForNode(nodeNameFilter); }) diff --git a/static/tests/functional/pages/node.js b/static/tests/functional/pages/node.js index 363375624..60db67dbc 100644 --- a/static/tests/functional/pages/node.js +++ b/static/tests/functional/pages/node.js @@ -38,7 +38,9 @@ define([ // the following timeout as we have 0.3s transition for the button .sleep(500) .clickByCssSelector('div.compact-node .node-hardware p.btn') - .waitForCssSelector('.node-popover', 1000); + .waitForCssSelector('.node-popover', 1000) + // the following timeout as we have 0.3s transition for the popover + .sleep(300); }, openNodePopup: function(fromExtendedView) { var self = this, diff --git a/static/tests/functional/screenshot_on_fail.js b/static/tests/functional/screenshot_on_fail.js index 082ba28e3..31b07fb32 100644 --- a/static/tests/functional/screenshot_on_fail.js +++ b/static/tests/functional/screenshot_on_fail.js @@ -14,21 +14,38 @@ * under the License. **/ -define(function() { +define(['intern/dojo/node!fs'], function(fs) { 'use strict'; - var remotes = {}; - - function saveScreenshot(testOrSuite) { - var remote = remotes[testOrSuite.sessionId]; - if (remote && remote.takeScreenshotAndSave) remote.takeScreenshotAndSave(testOrSuite.id); - } - - return { - '/session/start': function(remote) { - remotes[remote.sessionId] = remote; - }, - '/suite/error': saveScreenshot, - '/test/fail': saveScreenshot + var ScreenshotOnFailReporter = function() { + this.remotes = {}; }; + + ScreenshotOnFailReporter.prototype = { + saveScreenshot: function(testOrSuite) { + var remote = this.remotes[testOrSuite.sessionId]; + if (remote) { + remote.takeScreenshot().then(function(buffer) { + var targetDir = process.env.ARTIFACTS || process.cwd(); + var filename = testOrSuite.id + ' - ' + new Date().toTimeString(); + filename = filename.replace(/[\s\*\?\\\/]/g, '_'); + filename = targetDir + '/' + filename + '.png'; + fs.writeFileSync(filename, buffer); + console.log('Saved screenshot to', filename); // eslint-disable-line no-console + }); + } + }, + sessionStart: function(remote) { + var sessionId = remote._session._sessionId; + this.remotes[sessionId] = remote; + }, + suiteError: function(suite) { + this.saveScreenshot(suite); + }, + testFail: function(test) { + this.saveScreenshot(test); + } + }; + + return ScreenshotOnFailReporter; }); diff --git a/static/tests/functional/test_cluster_network.js b/static/tests/functional/test_cluster_network.js index c1d5dedce..242c4cae5 100644 --- a/static/tests/functional/test_cluster_network.js +++ b/static/tests/functional/test_cluster_network.js @@ -62,7 +62,14 @@ define([ }, afterEach: function() { return this.remote - .clickByCssSelector('.btn-revert-changes'); + .findByCssSelector('.btn-revert-changes') + .then(function(element) { + return element.isEnabled() + .then(function(isEnabled) { + if (isEnabled) return element.click(); + }); + }) + .end(); }, 'Add ranges manipulations': function() { var rangeSelector = '.public .ip_ranges '; @@ -184,6 +191,7 @@ define([ .clickByCssSelector('.glyphicon-pencil') .waitForCssSelector('.network-group-name input[type=text]', 2000) .findByCssSelector('.node-group-renaming input[type=text]') + .clearValue() .type('Node_Network_Group_2') // Enter .type('\uE007') diff --git a/static/tests/functional/test_login_logout.js b/static/tests/functional/test_login_logout.js index 5107e76c4..4789a2f9e 100644 --- a/static/tests/functional/test_login_logout.js +++ b/static/tests/functional/test_login_logout.js @@ -42,7 +42,7 @@ define([ .then(function() { return loginPage.login('login', '*****'); }) - .assertElementExists('div.login-error', 'Error message is expected to get displayed'); + .assertElementAppears('div.login-error', 1000, 'Error message is expected to get displayed'); }, 'Login with proper credentials': function() { return this.remote diff --git a/static/tests/functional/test_node_interfaces.js b/static/tests/functional/test_node_interfaces.js index b836d5e74..47d52aa6c 100644 --- a/static/tests/functional/test_node_interfaces.js +++ b/static/tests/functional/test_node_interfaces.js @@ -17,9 +17,10 @@ define([ 'intern!object', 'tests/functional/helpers', + 'intern/dojo/node!leadfoot/helpers/pollUntil', 'tests/functional/pages/interfaces', 'tests/functional/pages/common' -], function(registerSuite, helpers, InterfacesPage, Common) { +], function(registerSuite, helpers, pollUntil, InterfacesPage, Common) { 'use strict'; registerSuite(function() { @@ -46,7 +47,10 @@ define([ }) .clickByCssSelector('.node.pending_addition input[type=checkbox]:not(:checked)') .clickByCssSelector('button.btn-configure-interfaces') - .assertElementAppears('div.ifc-list', 2000, 'Node interfaces loaded'); + .assertElementAppears('div.ifc-list', 2000, 'Node interfaces loaded') + .then(pollUntil(function() { + return window.$('div.ifc-list').is(':visible') || null; + }, 1000)); }, afterEach: function() { return this.remote diff --git a/static/tests/functional/test_node_management_panel.js b/static/tests/functional/test_node_management_panel.js index 2de707632..b71de43e8 100644 --- a/static/tests/functional/test_node_management_panel.js +++ b/static/tests/functional/test_node_management_panel.js @@ -87,7 +87,7 @@ define([ .assertElementAppears(searchInputSelector, 200, 'Search input appears on the page') .setInputValue(searchInputSelector, 'Super') // need to wait debounced search input - .sleep(200) + .sleep(300) .assertElementsExist('.node-list .node', 3, 'Search was successfull') .clickByCssSelector('.page-title') .assertElementNotExists(searchButtonSelector, 'Active search control remains open when clicking outside the input') diff --git a/static/tests/functional/test_node_view.js b/static/tests/functional/test_node_view.js index 4f1f0c63e..d918b1765 100644 --- a/static/tests/functional/test_node_view.js +++ b/static/tests/functional/test_node_view.js @@ -17,12 +17,13 @@ define([ 'intern!object', 'intern/chai!assert', + 'intern/dojo/node!leadfoot/helpers/pollUntil', 'tests/functional/pages/node', 'tests/functional/pages/modal', 'tests/functional/pages/common', 'tests/functional/pages/cluster', 'tests/functional/helpers' -], function(registerSuite, assert, NodeComponent, ModalWindow, Common, ClusterPage) { +], function(registerSuite, assert, pollUntil, NodeComponent, ModalWindow, Common, ClusterPage) { 'use strict'; registerSuite(function() { @@ -119,7 +120,7 @@ define([ .then(function() { return node.openCompactNodeExtendedView(); }) - .clickByCssSelector('.node-name [type=checkbox]') + .clickByCssSelector('.node-popover .node-name input[type=checkbox]') .assertElementExists('.compact-node .node-checkbox i.glyphicon-ok', 'Node compact panel is checked') .then(function() { return node.openNodePopup(true); @@ -149,6 +150,9 @@ define([ return this.remote .clickByCssSelector('button.btn-add-nodes') .assertElementAppears('.node-list', 2000, 'Unallocated node list loaded') + .then(pollUntil(function() { + return window.$('.node-list').is(':visible') || null; + }, 3000)) .then(function() { return node.openCompactNodeExtendedView(); })