smoke e2e tests plus gulp tasks
This commit is contained in:
parent
4ffaa1b177
commit
91f90a930c
|
@ -0,0 +1,42 @@
|
||||||
|
import selectors from '../helpers/selectors';
|
||||||
|
import createNightmare from '../helpers/helpers';
|
||||||
|
|
||||||
|
describe('create client path', () => {
|
||||||
|
let nightmare = createNightmare();
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
return nightmare
|
||||||
|
.waitForLogin('developer');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should access to the clients index by clicking the clients button', () => {
|
||||||
|
return nightmare
|
||||||
|
.click(selectors.moduleAccessView.clientsSectionButton)
|
||||||
|
.wait(selectors.clientsIndex.createClientButton)
|
||||||
|
.parsedUrl()
|
||||||
|
.then(url => {
|
||||||
|
expect(url.hash).toEqual('#!/clients');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should access to the create client view by clicking the create-client floating button', () => {
|
||||||
|
return nightmare
|
||||||
|
.click(selectors.clientsIndex.createClientButton)
|
||||||
|
.wait(selectors.createClientView.createButton)
|
||||||
|
.parsedUrl()
|
||||||
|
.then(url => {
|
||||||
|
expect(url.hash).toEqual('#!/create');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should cancel the client creation to go back to clients index', () => {
|
||||||
|
return nightmare
|
||||||
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||||
|
.waitToClick(selectors.globalItems.clientsButton)
|
||||||
|
.wait(selectors.clientsIndex.createClientButton)
|
||||||
|
.parsedUrl()
|
||||||
|
.then(url => {
|
||||||
|
expect(url.hash).toEqual('#!/clients');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
12
gulpfile.js
12
gulpfile.js
|
@ -67,6 +67,10 @@ gulp.task('e2e', ['docker-rebuild'], async () => {
|
||||||
await runSequenceP('e2e-only');
|
await runSequenceP('e2e-only');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('smokes', ['docker-rebuild'], async () => {
|
||||||
|
await runSequenceP('smokes-only');
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs the e2e tests.
|
* Runs the e2e tests.
|
||||||
*/
|
*/
|
||||||
|
@ -76,6 +80,12 @@ gulp.task('e2e-only', () => {
|
||||||
.pipe(jasmine({reporter: 'none'}));
|
.pipe(jasmine({reporter: 'none'}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('smokes-only', () => {
|
||||||
|
const jasmine = require('gulp-jasmine');
|
||||||
|
return gulp.src('./smokes_tests.js')
|
||||||
|
.pipe(jasmine({reporter: 'none'}));
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs the backend tests.
|
* Runs the backend tests.
|
||||||
*/
|
*/
|
||||||
|
@ -391,7 +401,7 @@ gulp.task('watch', function() {
|
||||||
* Rebuilds the docker and it's image, if these already exist, destroys and
|
* Rebuilds the docker and it's image, if these already exist, destroys and
|
||||||
* rebuilds them.
|
* rebuilds them.
|
||||||
*/
|
*/
|
||||||
gulp.task('docker-rebuild', async () => {
|
gulp.task('docker', async () => {
|
||||||
try {
|
try {
|
||||||
await execP('docker rm -f dblocal');
|
await execP('docker rm -f dblocal');
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
require('babel-core/register')({presets: ['es2015']});
|
||||||
|
|
||||||
|
process.on('warning', warning => {
|
||||||
|
console.log(warning.name);
|
||||||
|
console.log(warning.message);
|
||||||
|
console.log(warning.stack);
|
||||||
|
});
|
||||||
|
|
||||||
|
var verbose = false;
|
||||||
|
|
||||||
|
if (process.argv[2] === '--v') {
|
||||||
|
verbose = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var Jasmine = require('jasmine');
|
||||||
|
var jasmine = new Jasmine();
|
||||||
|
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
||||||
|
|
||||||
|
jasmine.loadConfig({
|
||||||
|
spec_files: [
|
||||||
|
'./e2e/smokes/**/*[sS]pec.js',
|
||||||
|
'./e2e/helpers/extensions.js'
|
||||||
|
],
|
||||||
|
helpers: [
|
||||||
|
'/services/utils/jasmineHelpers.js'
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
jasmine.addReporter(new SpecReporter({
|
||||||
|
spec: {
|
||||||
|
// displayStacktrace: 'summary',
|
||||||
|
displaySuccessful: verbose,
|
||||||
|
displayFailedSpec: true,
|
||||||
|
displaySpecDuration: true
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
jasmine.execute();
|
Loading…
Reference in New Issue