I'm trying to setup up e2e tests with it running a second dummy server meant to simulate sending an email when a user signs up to the service. However it seems to start up fine but then starts testing with protractor against the wrong server. I've attached the code below if there's anything else needed to make this question clearer please let me know.
express: {
// options: {
// port: process.env.PORT || 9000
// },
dev: {
options: {
script: '<%= yeoman.server %>',
port: process.env.PORT || 9000,
debug: true
}
},
prod: {
options: {
script: '<%= yeoman.dist %>/<%= yeoman.server %>'
}
},
test: {
options: {
port: 9001,
script: '../turing-test/app.js'
}
}
and for the startup order:
grunt.registerTask('test', function (target, option) {
if (target === 'server') {
return grunt.task.run([
'env:all',
'env:test',
'mochaTest:unit',
'mochaTest:integration'
])
} else if (target === 'client') {
return grunt.task.run([
'env:all',
'env:test',
'ngconstant', // required to setup constants
'karma:unit'
])
} else if (target === 'e2e') {
if (option === 'prod') {
return grunt.task.run([
'build',
'env:all',
'env:prod',
// 'express:test',
'express:prod'
])
} else {
return grunt.task.run([
'clean:server',
'env:all',
'env:test',
'concurrent:pre',
'concurrent:test',
'injector',
'wiredep:client',
'postcss',
'express:test',
'express:dev',
'execute:setupDB',
'protractor'
])
}
} else if (target === 'coverage') {
if (option === 'unit') {
return grunt.task.run([
'env:all',
'env:test',
'mocha_istanbul:unit'
])
} else if (option === 'integration') {
return grunt.task.run([
'env:all',
'env:test',
'mocha_istanbul:integration'
])
} else if (option === 'check') {
return grunt.task.run([
'istanbul_check_coverage'
])
} else {
return grunt.task.run([
'env:all',
'env:test',
'mocha_istanbul',
'istanbul_check_coverage'
])
}
} else if (target === 'all') {
grunt.task.run([
'test:server',
'test:client',
'test:e2e'
])
} else {
grunt.task.run([
'test:server',
'test:client'
])
}
})
The weird thing is if just e2e runs then it passes and tests against the correct port but as soon as all is ran it fails
Aucun commentaire:
Enregistrer un commentaire