diff --git a/e2e/paths/08_add_credit.spec.js b/e2e/paths/08_add_credit.spec.js index d540fbe61..d3a218327 100644 --- a/e2e/paths/08_add_credit.spec.js +++ b/e2e/paths/08_add_credit.spec.js @@ -2,13 +2,12 @@ import config from '../helpers/config.js'; import createNightmare from '../helpers/nightmare'; import selectors from '../helpers/selectors.js'; import {catchErrors} from '../../services/utils/jasmineHelpers'; -import { fail } from 'assert'; const nightmare = createNightmare(); const moduleAccessViewHashURL = '#!/'; jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; -fdescribe('Add credit path', () => { +describe('Add credit path', () => { describe('warm up', () => { it('should warm up login and fixtures', done => { nightmare @@ -104,7 +103,7 @@ fdescribe('Add credit path', () => { .wait(selectors.globalItems.snackbarIsActive) .getInnerText(selectors.globalItems.snackbarIsActive) .then(result => { - expect(result).toEqual('Data saved'); + expect(result).toEqual('Data saved!'); done(); }) .catch(catchErrors(done)); diff --git a/e2e_tests.js b/e2e_tests.js index 495cc7495..dd1d7a079 100644 --- a/e2e_tests.js +++ b/e2e_tests.js @@ -18,8 +18,8 @@ var SpecReporter = require('jasmine-spec-reporter').SpecReporter; jasmine.loadConfig({ spec_files: [ - './e2e/helpers/extensions.js', - './e2e/**/*[sS]pec.js' + './e2e/**/*[sS]pec.js', + './e2e/helpers/extensions.js' ], helpers: [ '/services/utils/jasmineHelpers.js' diff --git a/gulpfile.js b/gulpfile.js index 2bb1f85b1..0438a8f3c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,4 +1,5 @@ var gulp = require('gulp'); +const jasmine = require('gulp-jasmine'); var gutil = require('gulp-util'); var wrap = require('gulp-wrap'); var concat = require('gulp-concat'); @@ -154,18 +155,19 @@ gulp.task('test', callback => { // e2e tests gulp.task('e2e', callback => { - runSequence('docker', 'runDockerLogs', 'endToEndTests', callback); + runSequence('docker', 'waitForMySQL', 'endToEndTests', callback); }); -gulp.task('runDockerLogs', callback => { +gulp.task('waitForMySQL', callback => { + let maxInterval = 15000; + let interval = 1000; let timer = 0; console.log('Waiting for MySQL init process...'); let waitForLocaldb = setInterval(() => { - if (timer < 15000) { - timer += 1000; + if (timer < maxInterval) { + timer += interval; exec('docker logs --tail 4 dblocal', (err, stdout, stderr) => { if (stdout.includes('MySQL init process done. Ready for start up.')) { - console.log('MySQL init process done.'); clearInterval(waitForLocaldb); callback(err); } @@ -174,14 +176,12 @@ gulp.task('runDockerLogs', callback => { console.log('MySQL connection not established whithin 15 secs!'); clearInterval(waitForLocaldb); } - }, 1000); + }, interval); }); gulp.task('endToEndTests', callback => { - exec('npm run e2e', (err, stdout, stderr) => { - console.log(stdout); - callback(err); - }); + gulp.src('./e2e_tests.js') + .pipe(jasmine({reporter: 'none'})); }); // docker dblocal diff --git a/package.json b/package.json index c89c08933..536a324b6 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "gulp-concat": "^2.6.0", "gulp-extend": "^0.2.0", "gulp-install": "^1.1.0", + "gulp-jasmine": "^3.0.0", "gulp-print": "^2.0.1", "gulp-util": "^3.0.7", "gulp-wrap": "^0.13.0",