update: vuejs-templates/webpack to v1.3.1
This commit is contained in:
+21
-6
@@ -1,16 +1,31 @@
|
||||
// 1. start the dev server using production config
|
||||
process.env.NODE_ENV = 'testing'
|
||||
var server = require('../../build/dev-server.js')
|
||||
|
||||
server.ready.then(() => {
|
||||
const webpack = require('webpack')
|
||||
const DevServer = require('webpack-dev-server')
|
||||
|
||||
const webpackConfig = require('../../build/webpack.prod.conf')
|
||||
const devConfigPromise = require('../../build/webpack.dev.conf')
|
||||
|
||||
let server
|
||||
|
||||
devConfigPromise.then(devConfig => {
|
||||
const devServerOptions = devConfig.devServer
|
||||
const compiler = webpack(webpackConfig)
|
||||
server = new DevServer(compiler, devServerOptions)
|
||||
const port = devServerOptions.port
|
||||
const host = devServerOptions.host
|
||||
return server.listen(port, host)
|
||||
})
|
||||
.then(() => {
|
||||
// 2. run the nightwatch test suite against it
|
||||
// to run in additional browsers:
|
||||
// 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings"
|
||||
// 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
|
||||
// 2. add it to the --env flag below
|
||||
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
|
||||
// For more information on Nightwatch's config file, see
|
||||
// http://nightwatchjs.org/guide#settings-file
|
||||
var opts = process.argv.slice(2)
|
||||
let opts = process.argv.slice(2)
|
||||
if (opts.indexOf('--config') === -1) {
|
||||
opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
|
||||
}
|
||||
@@ -18,8 +33,8 @@ server.ready.then(() => {
|
||||
opts = opts.concat(['--env', 'chrome'])
|
||||
}
|
||||
|
||||
var spawn = require('cross-spawn')
|
||||
var runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
|
||||
const spawn = require('cross-spawn')
|
||||
const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
|
||||
|
||||
runner.on('exit', function (code) {
|
||||
server.close()
|
||||
|
||||
+31
-34
@@ -3,12 +3,12 @@
|
||||
|
||||
module.exports = {
|
||||
|
||||
before : function(browser) {
|
||||
console.log('Setting up...');
|
||||
before: function (browser) {
|
||||
console.log('Setting up...')
|
||||
},
|
||||
|
||||
after : function(browser) {
|
||||
console.log('Closing down...');
|
||||
after: function (browser) {
|
||||
console.log('Closing down...')
|
||||
},
|
||||
|
||||
'CoreUI Vue e2e tests': function (browser) {
|
||||
@@ -16,12 +16,9 @@ module.exports = {
|
||||
// default: http://localhost:8080
|
||||
// see nightwatch.conf.js
|
||||
|
||||
const devServer = browser.globals.devServerURL;
|
||||
const devServer = browser.globals.devServerURL
|
||||
|
||||
browser
|
||||
.url(devServer)
|
||||
.pause(500)
|
||||
.expect.element('body').to.be.present;
|
||||
browser.url(devServer).pause(500).expect.element('body').to.be.present
|
||||
|
||||
browser.waitForElementVisible('.app > .app', 3000)
|
||||
.assert.elementPresent('.app-header')
|
||||
@@ -36,47 +33,47 @@ module.exports = {
|
||||
.assert.containsText('.app-footer > span.ml-auto', 'Powered by')
|
||||
.assert.elementCount('button', 18)
|
||||
.resizeWindow(1024, 800)
|
||||
.pause(500);
|
||||
.pause(500)
|
||||
|
||||
browser.click('body > div > header > button.navbar-toggler.aside-menu-toggler.d-md-down-none', function(response) {
|
||||
this.assert.ok(browser === this, 'Check if the context is right.');
|
||||
this.assert.cssClassNotPresent('body', 'aside-menu-hidden');
|
||||
});
|
||||
browser.click('body > div > header > button.navbar-toggler.aside-menu-toggler.d-md-down-none', function (response) {
|
||||
this.assert.ok(browser === this, 'Check if the context is right.')
|
||||
this.assert.cssClassNotPresent('body', 'aside-menu-hidden')
|
||||
})
|
||||
|
||||
browser.pause(500);
|
||||
browser.pause(500)
|
||||
|
||||
browser.click('body > div > header > button.navbar-toggler.aside-menu-toggler.d-md-down-none', function(response) {
|
||||
this.assert.cssClassPresent('body', 'aside-menu-hidden');
|
||||
});
|
||||
browser.click('body > div > header > button.navbar-toggler.aside-menu-toggler.d-md-down-none', function (response) {
|
||||
this.assert.cssClassPresent('body', 'aside-menu-hidden')
|
||||
})
|
||||
|
||||
browser.pause(500);
|
||||
browser.pause(500)
|
||||
|
||||
browser
|
||||
.useXpath()
|
||||
.click('/html/body/div/header/button[2]', function(response) {
|
||||
this.assert.cssClassPresent('/html/body', 'sidebar-hidden');
|
||||
});
|
||||
.click('/html/body/div/header/button[2]', function (response) {
|
||||
this.assert.cssClassPresent('/html/body', 'sidebar-hidden')
|
||||
})
|
||||
|
||||
browser
|
||||
.pause(500)
|
||||
.click('/html/body/div/header/button[2]', function(response) {
|
||||
this.assert.cssClassNotPresent('/html/body', 'sidebar-hidden');
|
||||
});
|
||||
.click('/html/body/div/header/button[2]', function (response) {
|
||||
this.assert.cssClassNotPresent('/html/body', 'sidebar-hidden')
|
||||
})
|
||||
|
||||
browser
|
||||
.pause(500)
|
||||
.click('/html/body/div/div/div/button', function(response) {
|
||||
this.assert.cssClassPresent('/html/body', 'sidebar-minimized');
|
||||
this.assert.cssClassPresent('/html/body', 'brand-minimized');
|
||||
.click('/html/body/div/div/div/button', function (response) {
|
||||
this.assert.cssClassPresent('/html/body', 'sidebar-minimized')
|
||||
this.assert.cssClassPresent('/html/body', 'brand-minimized')
|
||||
})
|
||||
.pause(500)
|
||||
.click('/html/body/div/div/div/button', function(response) {
|
||||
this.assert.cssClassNotPresent('/html/body', 'sidebar-minimized');
|
||||
this.assert.cssClassNotPresent('/html/body', 'brand-minimized');
|
||||
});
|
||||
.click('/html/body/div/div/div/button', function (response) {
|
||||
this.assert.cssClassNotPresent('/html/body', 'sidebar-minimized')
|
||||
this.assert.cssClassNotPresent('/html/body', 'brand-minimized')
|
||||
})
|
||||
|
||||
browser
|
||||
.pause(3000)
|
||||
.end();
|
||||
.end()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
var webpackConfig = require('../../build/webpack.test.conf')
|
||||
|
||||
module.exports = function (config) {
|
||||
module.exports = function karmaConfig (config) {
|
||||
config.set({
|
||||
// to run in additional browsers:
|
||||
// 1. install corresponding karma launcher
|
||||
|
||||
Reference in New Issue
Block a user