mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Added gulp protractor task.
This commit is contained in:
parent
2ca3619057
commit
a9e2268b18
5 changed files with 34 additions and 16 deletions
34
gulpfile.js
34
gulpfile.js
|
@ -8,35 +8,51 @@ var webpackConfig = require('./webpack.config.js')
|
|||
var gettext = require('gulp-angular-gettext')
|
||||
var jade = require('gulp-jade')
|
||||
var clean = require('gulp-clean')
|
||||
var protractor = require("gulp-protractor")
|
||||
|
||||
|
||||
gulp.task('jshint', function () {
|
||||
return gulp.src([
|
||||
'lib/**/*.js'
|
||||
'lib/**/*.js'
|
||||
, 'res/app/**/*.js'
|
||||
, 'res/auth-ldap/**/*.js'
|
||||
, 'res/auth-mock/**/*.js'
|
||||
, '*.js'
|
||||
])
|
||||
])
|
||||
.pipe(jshint())
|
||||
.pipe(jshint.reporter('jshint-stylish'))
|
||||
})
|
||||
|
||||
gulp.task('jsonlint', function () {
|
||||
return gulp.src([
|
||||
'.jshintrc'
|
||||
'.jshintrc'
|
||||
, 'res/.jshintrc'
|
||||
, '.bowerrc'
|
||||
, '.yo-rc.json'
|
||||
, '*.json'
|
||||
])
|
||||
])
|
||||
.pipe(jsonlint())
|
||||
.pipe(jsonlint.reporter())
|
||||
})
|
||||
|
||||
gulp.task('lint', ['jshint', 'jsonlint'])
|
||||
gulp.task('test', ['lint'])
|
||||
gulp.task('test', ['lint', 'protractor'])
|
||||
gulp.task('build', ['translate', 'webpack:build'])
|
||||
|
||||
gulp.task('webdriver_update', protractor.webdriver_update)
|
||||
gulp.task('webdriver_standalone', protractor.webdriver_standalone)
|
||||
|
||||
gulp.task('protractor', ['webdriver_update'], function (callback) {
|
||||
gulp.src(["./res/test/**/*.js"])
|
||||
.pipe(protractor.protractor({
|
||||
configFile: './res/test/protractor.conf.js'
|
||||
}))
|
||||
.on('error', function (e) {
|
||||
console.log(e)
|
||||
}).on('end', callback)
|
||||
})
|
||||
|
||||
|
||||
// For production
|
||||
gulp.task("webpack:build", function (callback) {
|
||||
var myConfig = Object.create(webpackConfig)
|
||||
|
@ -68,19 +84,19 @@ gulp.task('translate', ['jade', 'translate:extract', 'translate:compile'])
|
|||
|
||||
gulp.task('jade', function () {
|
||||
return gulp.src([
|
||||
'./res/**/*.jade'
|
||||
'./res/**/*.jade'
|
||||
, '!./res/bower_components/**'
|
||||
])
|
||||
])
|
||||
.pipe(jade())
|
||||
.pipe(gulp.dest('./tmp/html/'))
|
||||
})
|
||||
|
||||
gulp.task('translate:extract', function () {
|
||||
return gulp.src([
|
||||
'./tmp/html/**/*.html'
|
||||
'./tmp/html/**/*.html'
|
||||
, './res/**/*.js'
|
||||
, '!./res/bower_components/**'
|
||||
])
|
||||
])
|
||||
.pipe(gettext.extract('stf.pot'))
|
||||
.pipe(gulp.dest('./res/common/lang/po/'))
|
||||
})
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
// Reference: https://github.com/angular/protractor/blob/master/referenceConf.js
|
||||
|
||||
exports.config = {
|
||||
specs: ['res/test/e2e/*spec.js']
|
||||
}
|
|
@ -6,7 +6,6 @@ html
|
|||
meta(name='viewport', content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui')
|
||||
include partials/styles
|
||||
body(ng-cloak).forofour.bg-danger
|
||||
script(src='/static/bower_components/stf-analytics/analytics.js')
|
||||
div(ng-view)
|
||||
.forofour-container
|
||||
h1
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
link(href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700', media='all', rel='stylesheet', type='text/css')
|
||||
link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/stylesheets/bootstrap.min.css')
|
||||
link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/stylesheets/se7en-font.css')
|
||||
link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/stylesheets/style.css')
|
||||
|
|
9
res/test/protractor.conf.js
Normal file
9
res/test/protractor.conf.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
// Reference: https://github.com/angular/protractor/blob/master/referenceConf.js
|
||||
|
||||
exports.config = {
|
||||
specs: ['res/test/e2e/*spec.js'],
|
||||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 30000
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue