remove old e2e packages

This commit is contained in:
Matteo Pagliazzi
2019-09-30 22:32:11 +02:00
parent a8846b17c0
commit c6be804723
6 changed files with 1 additions and 389 deletions
@@ -1,25 +0,0 @@
// A custom Nightwatch assertion.
// the name of the method is the filename.
// can be used in tests like this:
//
// browser.assert.elementCount(selector, count)
//
// for how to write custom assertions see
// http://nightwatchjs.org/guide#writing-custom-assertions
exports.assertion = function (selector, count) {
this.message = `Testing if element <${selector}> has count: ${count}`;
this.expected = count;
this.pass = function (val) {
return val === this.expected;
};
this.value = function (res) {
return res.value;
};
this.command = function (cb) {
return this.api.execute((el) => {
return document.querySelectorAll(el).length;
}, [selector], (res) => {
cb.call(this, res);
});
};
};
-50
View File
@@ -1,50 +0,0 @@
/* eslint-disable camelcase */
require('babel-register');
const config = require('../../../webpack/config');
const chromeDriverPath = require('chromedriver').path;
const seleniumServerPath = require('selenium-server').path;
// http://nightwatchjs.org/guide#settings-file
module.exports = {
src_folders: ['test/client/e2e/specs'],
output_folder: 'test/client/e2e/reports',
custom_assertions_path: ['test/client/e2e/custom-assertions'],
selenium: {
start_process: true,
server_path: seleniumServerPath,
host: '127.0.0.1',
port: 4444,
cli_args: {
'webdriver.chrome.driver': chromeDriverPath,
},
},
test_settings: {
default: {
selenium_port: 4444,
selenium_host: 'localhost',
silent: true,
globals: {
devServerURL: `http://localhost:${process.env.PORT || config.dev.port}`, // eslint-disable-line no-process-env
},
},
chrome: {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
},
},
firefox: {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true,
},
},
},
};
-31
View File
@@ -1,31 +0,0 @@
// 1. start the dev server using production config
process.env.NODE_ENV = 'testing'; // eslint-disable-line no-process-env
const server = require('../../../webpack/dev-server.js');
// 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"
// 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
let opts = process.argv.slice(2);
if (opts.indexOf('--config') === -1) {
opts = opts.concat(['--config', 'test/client/e2e/nightwatch.conf.js']);
}
if (opts.indexOf('--env') === -1) {
opts = opts.concat(['--env', 'chrome']);
}
const spawn = require('cross-spawn');
const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' });
runner.on('exit', function (code) {
server.close();
process.exit(code);
});
runner.on('error', function (err) {
server.close();
throw err;
});
-19
View File
@@ -1,19 +0,0 @@
// For authoring Nightwatch tests, see
// http://nightwatchjs.org/guide#usage
module.exports = {
'default e2e tests' (browser) {
// automatically uses dev Server port from /config.index.js
// default: http://localhost:8080
// see nightwatch.conf.js
const devServer = browser.globals.devServerURL;
browser
.url(devServer)
.waitForElementVisible('#app', 5000)
.assert.elementPresent('.logo')
.assert.containsText('h1', 'Hello Vue!')
.assert.elementCount('p', 3)
.end();
},
};