Completely separate UI func and unit tests

We're no longer using Intern for unit-testing, so we need to move
all intern-related files to a separate directory
(tests/functional). It's needed to setup eslint properly - unit
and functional tests are run in a different environments (node
and browsers) and require different configuration.

Change-Id: I9b938faed5a2b280645a022e47cc12958fd1ddfd
This commit is contained in:
Vitaly Kramskikh 2016-01-10 17:49:26 +03:00
parent cd52d7c318
commit 7419625bbe
29 changed files with 30 additions and 33 deletions

View File

@ -100,7 +100,7 @@ function runIntern(params) {
var baseDir = 'static';
var runner = './node_modules/.bin/intern-runner';
var browser = argv.browser || process.env.BROWSER || 'firefox';
var options = [['config', 'tests/intern-' + browser + '.js']];
var options = [['config', 'tests/functional/config/intern-' + browser + '.js']];
var suiteOptions = [];
['suites', 'functionalSuites'].forEach(function(suiteType) {
if (params[suiteType]) {

View File

@ -0,0 +1,8 @@
---
rules:
prefer-arrow-callback: 0
object-shorthand: 0
env:
node: true
globals:
sinon: false

View File

@ -17,8 +17,5 @@
define(['./intern'], function(config) {
'use strict';
config.environments = [{browserName: 'phantomjs'}];
config.loader.shim.react = {
deps: ['vendor/npm/es5-shim/es5-shim']
};
return config;
});

View File

@ -20,16 +20,9 @@ define(function() {
return {
proxyPort: 9057,
proxyUrl: 'http://localhost:9057/',
capabilities: {
'selenium-version': '2.45.0'
},
maxConcurrency: 1,
useLoader: {
'host-node': 'requirejs',
'host-browser': '/vendor/npm/requirejs/require.js'
},
grep: /^/,
excludeInstrumentation: /^/,
reporters: ['console', 'tests/screenshot_on_fail']
reporters: ['console', 'tests/functional/screenshot_on_fail']
};
});

View File

@ -18,7 +18,7 @@ define([
'intern/dojo/node!lodash',
'tests/functional/pages/modal',
'intern/dojo/node!leadfoot/helpers/pollUntil',
'../../helpers'
'tests/functional/helpers'
], function(_, ModalWindow, pollUntil) {
'use strict';
function ClusterPage(remote) {

View File

@ -17,7 +17,7 @@
define([
'intern/dojo/node!lodash',
'tests/functional/pages/modal',
'../../helpers'
'tests/functional/helpers'
], function(_, ModalWindow) {
'use strict';
function ClustersPage(remote) {

View File

@ -17,7 +17,7 @@
define([
'intern/dojo/node!lodash',
'intern/chai!assert',
'../../helpers',
'tests/functional/helpers',
'tests/functional/pages/login',
'tests/functional/pages/welcome',
'tests/functional/pages/cluster',

View File

@ -16,7 +16,7 @@
define([
'tests/functional/pages/modal',
'../../helpers'
'tests/functional/helpers'
], function(ModalWindow) {
'use strict';
function DashboardPage(remote) {

View File

@ -15,7 +15,7 @@
**/
define([
'../../helpers'
'tests/functional/helpers'
], function(Helpers) {
'use strict';

View File

@ -16,7 +16,7 @@
define([
'intern/dojo/node!leadfoot/helpers/pollUntil',
'../../helpers'
'tests/functional/helpers'
], function(pollUntil) {
'use strict';
function ModalWindow(remote) {

View File

@ -15,7 +15,7 @@
**/
define([
'../../helpers'
'tests/functional/helpers'
], function() {
'use strict';

View File

@ -16,7 +16,7 @@
define([
'tests/functional/pages/modal',
'../../helpers'
'tests/functional/helpers'
], function(ModalWindow) {
'use strict';

View File

@ -15,7 +15,7 @@
**/
define([
'../../helpers'
'tests/functional/helpers'
], function() {
'use strict';

View File

@ -14,7 +14,7 @@
* under the License.
**/
define(['../../helpers'], function() {
define(['tests/functional/helpers'], function() {
'use strict';
function WelcomePage(remote) {
this.remote = remote;

View File

@ -18,7 +18,7 @@ define([
'intern/dojo/node!lodash',
'intern!object',
'intern/chai!assert',
'tests/helpers',
'tests/functional/helpers',
'tests/functional/pages/common',
'tests/functional/pages/cluster',
'tests/functional/pages/dashboard',

View File

@ -18,7 +18,7 @@ define([
'intern/dojo/node!lodash',
'intern!object',
'intern/chai!assert',
'tests/helpers',
'tests/functional/helpers',
'tests/functional/pages/common',
'tests/functional/pages/cluster'
], function(_, registerSuite, assert, helpers, Common, ClusterPage) {

View File

@ -17,7 +17,7 @@
define([
'intern!object',
'intern/chai!assert',
'tests/helpers',
'tests/functional/helpers',
'tests/functional/pages/common',
'tests/functional/pages/cluster',
'tests/functional/pages/settings',

View File

@ -17,7 +17,7 @@
define([
'intern!object',
'intern/chai!assert',
'tests/helpers',
'tests/functional/helpers',
'tests/functional/pages/common'
], function(registerSuite, assert, helpers, Common) {
'use strict';

View File

@ -17,7 +17,7 @@
define([
'intern!object',
'intern/chai!assert',
'tests/helpers',
'tests/functional/helpers',
'tests/functional/pages/login',
'tests/functional/pages/common'
], function(registerSuite, assert, helpers, LoginPage, Common) {

View File

@ -16,7 +16,7 @@
define([
'intern!object',
'tests/helpers',
'tests/functional/helpers',
'tests/functional/pages/interfaces',
'tests/functional/pages/common'
], function(registerSuite, helpers, InterfacesPage, Common) {

View File

@ -20,7 +20,7 @@ define([
'tests/functional/pages/common',
'tests/functional/pages/cluster',
'tests/functional/pages/dashboard',
'tests/helpers'
'tests/functional/helpers'
], function(registerSuite, assert, Common, ClusterPage, DashboardPage) {
'use strict';

View File

@ -21,7 +21,7 @@ define([
'tests/functional/pages/modal',
'tests/functional/pages/common',
'tests/functional/pages/cluster',
'tests/helpers'
'tests/functional/helpers'
], function(registerSuite, assert, NodeComponent, ModalWindow, Common, ClusterPage) {
'use strict';

View File

@ -17,7 +17,7 @@
define([
'intern!object',
'intern/chai!assert',
'tests/helpers',
'tests/functional/helpers',
'tests/functional/pages/login',
'tests/functional/pages/welcome'
], function(registerSuite, assert, helpers, LoginPage, WelcomePage) {

View File

@ -17,7 +17,7 @@
define([
'intern!object',
'intern/chai!assert',
'tests/helpers',
'tests/functional/helpers',
'tests/functional/pages/common',
'tests/functional/pages/modal'
], function(registerSuite, assert, helpers, Common, Modal) {

View File

@ -3,7 +3,6 @@
prefer-arrow-callback: 0
object-shorthand: 0
env:
node: true
mocha: true
globals:
assert: false