This commit is contained in:
parent
cdee2d21e2
commit
8aed4013e1
|
@ -53,6 +53,7 @@ let actions = {
|
|||
if (currentUser === userName) {
|
||||
return this.waitToClick('vn-topbar a[ui-sref="home"]')
|
||||
.waitForURL('#!/')
|
||||
.changeLanguageToEnglish()
|
||||
.then(done)
|
||||
.catch(done);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* eslint no-console: 0 */
|
||||
import Nightmare from 'nightmare';
|
||||
const Nightmare = require('nightmare');
|
||||
|
||||
let nightmare;
|
||||
|
||||
export default function createNightmare(width = 1280, height = 720) {
|
||||
module.exports = function createNightmare(width = 1280, height = 720) {
|
||||
if (nightmare)
|
||||
return nightmare;
|
||||
|
||||
|
@ -24,6 +24,4 @@ export default function createNightmare(width = 1280, height = 720) {
|
|||
|
||||
nightmare.header('Accept-Language', 'en');
|
||||
return nightmare;
|
||||
}
|
||||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||
};
|
||||
|
|
36
e2e/tests.js
36
e2e/tests.js
|
@ -1,36 +0,0 @@
|
|||
require('@babel/register')({presets: ['@babel/preset-env']});
|
||||
require('@babel/polyfill');
|
||||
|
||||
process.on('warning', warning => {
|
||||
console.log(warning.name);
|
||||
console.log(warning.message);
|
||||
console.log(warning.stack);
|
||||
});
|
||||
|
||||
let verbose = false;
|
||||
|
||||
if (process.argv[2] === '--v')
|
||||
verbose = true;
|
||||
|
||||
let Jasmine = require('jasmine');
|
||||
let jasmine = new Jasmine();
|
||||
let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
||||
|
||||
jasmine.loadConfig({
|
||||
spec_files: [
|
||||
`${__dirname}/**/*[sS]pec.js`,
|
||||
`${__dirname}/helpers/extensions.js`
|
||||
],
|
||||
helpers: []
|
||||
});
|
||||
|
||||
jasmine.addReporter(new SpecReporter({
|
||||
spec: {
|
||||
// displayStacktrace: 'summary',
|
||||
displaySuccessful: verbose,
|
||||
displayFailedSpec: true,
|
||||
displaySpecDuration: true
|
||||
}
|
||||
}));
|
||||
|
||||
jasmine.execute();
|
33
gulpfile.js
33
gulpfile.js
|
@ -21,6 +21,7 @@ let backSources = [
|
|||
'!node_modules',
|
||||
'loopback',
|
||||
'modules/*/back/**',
|
||||
'modules/*/back/*',
|
||||
'back',
|
||||
'print'
|
||||
];
|
||||
|
@ -50,7 +51,6 @@ function backWatch(done) {
|
|||
|
||||
nodemon({
|
||||
exec: commands.join(' && '),
|
||||
ext: 'js html css',
|
||||
args: ['backOnly'],
|
||||
watch: backSources,
|
||||
done: done
|
||||
|
@ -112,13 +112,40 @@ backTest.description = `Watches for changes in modules to execute backTest task`
|
|||
// End to end tests
|
||||
|
||||
function e2eOnly() {
|
||||
require('@babel/register')({presets: ['@babel/preset-env']});
|
||||
require('@babel/polyfill');
|
||||
|
||||
const jasmine = require('gulp-jasmine');
|
||||
const SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
||||
const createNightmare = require('./e2e/helpers/nightmare');
|
||||
|
||||
if (argv.show || argv.s)
|
||||
process.env.E2E_SHOW = true;
|
||||
|
||||
return gulp.src('./e2e/tests.js')
|
||||
.pipe(jasmine({reporter: 'none'}));
|
||||
const specFiles = [
|
||||
`${__dirname}/e2e/paths/**/*[sS]pec.js`,
|
||||
`${__dirname}/e2e/helpers/extensions.js`
|
||||
];
|
||||
|
||||
return gulp.src(specFiles).pipe(jasmine({
|
||||
errorOnFail: false,
|
||||
timeout: 10000,
|
||||
reporter: [
|
||||
new SpecReporter({
|
||||
spec: {
|
||||
displayStacktrace: 'summary',
|
||||
displaySuccessful: true,
|
||||
displayFailedSpec: true,
|
||||
displaySpecDuration: true,
|
||||
}
|
||||
})
|
||||
]
|
||||
})
|
||||
.on('jasmineDone', function() {
|
||||
const nightmare = createNightmare();
|
||||
|
||||
nightmare.end(() => {});
|
||||
}));
|
||||
}
|
||||
e2eOnly.description = `Runs the e2e tests only`;
|
||||
|
||||
|
|
|
@ -31,5 +31,8 @@
|
|||
"Worker cannot be blank": "Worker cannot be blank",
|
||||
"You must delete the claim id %d first": "You must delete the claim id %d first",
|
||||
"You don't have enough privileges": "You don't have enough privileges",
|
||||
"Tag value cannot be blank": "Tag value cannot be blank"
|
||||
"Tag value cannot be blank": "Tag value cannot be blank",
|
||||
"A client with that Web User name already exists": "A client with that Web User name already exists",
|
||||
"The warehouse can't be repeated": "The warehouse can't be repeated",
|
||||
"Barcode must be unique": "Barcode must be unique"
|
||||
}
|
Loading…
Reference in New Issue