X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=Gruntfile.js;h=1ecc2c032fab3e0d7dab7c429c4ff882a31f8741;hb=ac817da014643ac06453f1417d41366892da892c;hp=55b7932f002b1e4bfab0e935457d9751094ff39b;hpb=dcdb8e463e3b2be121c61c91df13ea36d270a602;p=lhc%2Fweb%2Fwiklou.git diff --git a/Gruntfile.js b/Gruntfile.js index 55b7932f00..1ecc2c032f 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,20 +14,31 @@ module.exports = function ( grunt ) { grunt.loadNpmTasks( 'grunt-jsonlint' ); grunt.loadNpmTasks( 'grunt-karma' ); grunt.loadNpmTasks( 'grunt-stylelint' ); + grunt.loadNpmTasks( 'grunt-webdriver' ); - karmaProxy[ wgScriptPath ] = wgServer + wgScriptPath; + 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', @@ -55,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: [ @@ -85,6 +97,9 @@ module.exports = function ( grunt ) { main: { browsers: [ 'Chrome' ] }, + chromium: { + browsers: [ 'Chromium' ] + }, more: { browsers: [ 'Chrome', 'Firefox' ] } @@ -98,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 () {