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 gettext = require('gulp-angular-gettext')
|
||||||
var jade = require('gulp-jade')
|
var jade = require('gulp-jade')
|
||||||
var clean = require('gulp-clean')
|
var clean = require('gulp-clean')
|
||||||
|
var protractor = require("gulp-protractor")
|
||||||
|
|
||||||
|
|
||||||
gulp.task('jshint', function () {
|
gulp.task('jshint', function () {
|
||||||
return gulp.src([
|
return gulp.src([
|
||||||
'lib/**/*.js'
|
'lib/**/*.js'
|
||||||
, 'res/app/**/*.js'
|
, 'res/app/**/*.js'
|
||||||
, 'res/auth-ldap/**/*.js'
|
, 'res/auth-ldap/**/*.js'
|
||||||
, 'res/auth-mock/**/*.js'
|
, 'res/auth-mock/**/*.js'
|
||||||
, '*.js'
|
, '*.js'
|
||||||
])
|
])
|
||||||
.pipe(jshint())
|
.pipe(jshint())
|
||||||
.pipe(jshint.reporter('jshint-stylish'))
|
.pipe(jshint.reporter('jshint-stylish'))
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('jsonlint', function () {
|
gulp.task('jsonlint', function () {
|
||||||
return gulp.src([
|
return gulp.src([
|
||||||
'.jshintrc'
|
'.jshintrc'
|
||||||
, 'res/.jshintrc'
|
, 'res/.jshintrc'
|
||||||
, '.bowerrc'
|
, '.bowerrc'
|
||||||
, '.yo-rc.json'
|
, '.yo-rc.json'
|
||||||
, '*.json'
|
, '*.json'
|
||||||
])
|
])
|
||||||
.pipe(jsonlint())
|
.pipe(jsonlint())
|
||||||
.pipe(jsonlint.reporter())
|
.pipe(jsonlint.reporter())
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('lint', ['jshint', 'jsonlint'])
|
gulp.task('lint', ['jshint', 'jsonlint'])
|
||||||
gulp.task('test', ['lint'])
|
gulp.task('test', ['lint', 'protractor'])
|
||||||
gulp.task('build', ['translate', 'webpack:build'])
|
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
|
// For production
|
||||||
gulp.task("webpack:build", function (callback) {
|
gulp.task("webpack:build", function (callback) {
|
||||||
var myConfig = Object.create(webpackConfig)
|
var myConfig = Object.create(webpackConfig)
|
||||||
|
@ -68,19 +84,19 @@ gulp.task('translate', ['jade', 'translate:extract', 'translate:compile'])
|
||||||
|
|
||||||
gulp.task('jade', function () {
|
gulp.task('jade', function () {
|
||||||
return gulp.src([
|
return gulp.src([
|
||||||
'./res/**/*.jade'
|
'./res/**/*.jade'
|
||||||
, '!./res/bower_components/**'
|
, '!./res/bower_components/**'
|
||||||
])
|
])
|
||||||
.pipe(jade())
|
.pipe(jade())
|
||||||
.pipe(gulp.dest('./tmp/html/'))
|
.pipe(gulp.dest('./tmp/html/'))
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('translate:extract', function () {
|
gulp.task('translate:extract', function () {
|
||||||
return gulp.src([
|
return gulp.src([
|
||||||
'./tmp/html/**/*.html'
|
'./tmp/html/**/*.html'
|
||||||
, './res/**/*.js'
|
, './res/**/*.js'
|
||||||
, '!./res/bower_components/**'
|
, '!./res/bower_components/**'
|
||||||
])
|
])
|
||||||
.pipe(gettext.extract('stf.pot'))
|
.pipe(gettext.extract('stf.pot'))
|
||||||
.pipe(gulp.dest('./res/common/lang/po/'))
|
.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')
|
meta(name='viewport', content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui')
|
||||||
include partials/styles
|
include partials/styles
|
||||||
body(ng-cloak).forofour.bg-danger
|
body(ng-cloak).forofour.bg-danger
|
||||||
script(src='/static/bower_components/stf-analytics/analytics.js')
|
|
||||||
div(ng-view)
|
div(ng-view)
|
||||||
.forofour-container
|
.forofour-container
|
||||||
h1
|
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/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/se7en-font.css')
|
||||||
link(rel='stylesheet', href='/static/bower_components/se7en-bootstrap-3/build/stylesheets/style.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