X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=Gruntfile.js;h=6c56772720ea6f1950c6accaaa24a981c3346a0e;hp=4cc9721857c37fdfcc9afad2d93db6d05870c015;hb=63e52b83f16a2bf39def2bb615f4a8494f0b4a29;hpb=a9622fdb035fc84349282545144bce7aa76b6d8b diff --git a/Gruntfile.js b/Gruntfile.js index 4cc9721857..6c56772720 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,6 +4,7 @@ module.exports = function ( grunt ) { var wgServer = process.env.MW_SERVER, wgScriptPath = process.env.MW_SCRIPT_PATH, + WebdriverIOconfigFile, karmaProxy = {}; grunt.loadNpmTasks( 'grunt-banana-checker' ); @@ -13,23 +14,31 @@ module.exports = function ( grunt ) { grunt.loadNpmTasks( 'grunt-jsonlint' ); grunt.loadNpmTasks( 'grunt-karma' ); grunt.loadNpmTasks( 'grunt-stylelint' ); + grunt.loadNpmTasks( 'grunt-webdriver' ); karmaProxy[ wgScriptPath ] = { target: wgServer + wgScriptPath, changeOrigin: true }; + if ( process.env.JENKINS_HOME ) { + WebdriverIOconfigFile = './tests/selenium/wdio.conf.jenkins.js'; + } else { + WebdriverIOconfigFile = './tests/selenium/wdio.conf.js'; + } + grunt.initConfig( { eslint: { all: [ '**/*.js', '!docs/**', - '!tests/**', '!node_modules/**', '!resources/lib/**', '!resources/src/jquery.tipsy/**', '!resources/src/jquery/jquery.farbtastic.js', '!resources/src/mediawiki.libs/**', + // Third-party code of PHPUnit coverage report + '!tests/coverage/**', '!vendor/**', // Explicitly say "**/*.js" here in case of symlinks '!extensions/**/*.js', @@ -58,7 +67,7 @@ module.exports = function ( grunt ) { options: { syntax: 'less' }, - src: '{resources/src/*,mw-config/**}/*.{css,less}' + src: '{resources/src,mw-config}/**/*.{css,less}' }, watch: { files: [ @@ -79,7 +88,7 @@ module.exports = function ( grunt ) { } ], logLevel: 'DEBUG', frameworks: [ 'qunit' ], - reporters: [ 'progress' ], + reporters: [ 'mocha' ], singleRun: true, autoWatch: false, // Some tests in extensions don't yield for more than the default 10s (T89075) @@ -104,7 +113,15 @@ module.exports = function ( grunt ) { return require( 'path' ).join( dest, src.replace( 'resources/', '' ) ); } } + }, + + // Configure WebdriverIO task + webdriver: { + test: { + configFile: WebdriverIOconfigFile + } } + } ); grunt.registerTask( 'assert-mw-env', function () {