This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resource-editor.git
commit 6ac671e9d300d6e9e590c0e3c26c9788f4ade374 Author: Sandro Boehme <[email protected]> AuthorDate: Wed Nov 9 15:12:24 2016 +0000 SLING-6252 Resource Editor :: Fixed frontend build git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1768982 13f79535-47bb-0310-9956-ffa450edef68 --- README | 9 +------- frontend/Gruntfile.js | 31 +++++++++---------------- frontend/karma.conf.ci.js | 19 ++++++++++++++++ frontend/npm | 2 +- frontend/package.json | 39 ++++++++++++++++++-------------- frontend/wdio.conf.js | 3 +++ pom.xml | 19 +++++++++++++--- src/test/javascript/e2e/spec/e2e_spec.js | 4 ++-- 8 files changed, 75 insertions(+), 51 deletions(-) diff --git a/README b/README index 43aad15..0762455 100644 --- a/README +++ b/README @@ -10,16 +10,9 @@ o After that you find the web application at "/reseditor/.html" on your server. ++ Development with the Sling Resource Editor ++ o Use `mvn install sling:install` to deploy changes of Java classes o To have frontend changes automatically deployed call `mvn install -P autoInstallBundle -Dsling.mountByFS=true` -o To run the build on your local machine call './grunt desktop_build' within the frontend directory. It includes end to end tests with firefox and chrome. +o To run the build on your local machine call './grunt desktop_build' within the frontend directory. It includes tests with firefox and chrome. o To have the less sources automatically compiled on change call `./grunt watch:less` in the frontend directory. Press Ctrl-Z to stop watching. o To have the 'desktop_build' target triggered on changes in the frontend tests, less sources, JavaScript files and JSP sources use `./grunt watch:all` in the frontend directory and also press Ctrl-Z to stop watching. -o To get the end to end tests triggered by changes use './grunt watch:e2e' in the frontend directory and also press Ctrl-Z to stop watching. o If you don't use 'localhost' as server and '8080' as port you can specify your values by using the environment variables 'SLING_SERVER' 'SLING_PORT'. -++ Debugging the the end to end tests ++ -o You can still use 'console.log()' and JSON.stringify(display) to inspect JSON values of a test spec. -o You can use 'client.pause([milliseconds]);' in your test spec to pause and also inspect the browser status. -o To set breakpoints in a test spec you can use a JavaScript IDE like 'Webstorm' - - Enjoy! \ No newline at end of file diff --git a/frontend/Gruntfile.js b/frontend/Gruntfile.js index f4bf0a4..079e745 100644 --- a/frontend/Gruntfile.js +++ b/frontend/Gruntfile.js @@ -126,20 +126,7 @@ module.exports = function(grunt) { }, karma: { options: { - runnerPort: 9999, - singleRun: true, - browsers: ['Chrome', 'Firefox', 'PhantomJS'], - reporters: ["spec"], - specReporter: {maxLogLines: 5}, - plugins : ['karma-jasmine', 'karma-phantomjs-launcher', 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-ie-launcher', - 'karma-spec-reporter'], - frameworks: ['jasmine'], - files: [ - staticContentFolder+'/generated/3rd_party/js/jquery.min.js', - staticContentFolder+'/generated/3rd_party/js/**/*.js', - staticContentFolder+'/js/**/*.js', - '../src/test/javascript/spec/*spec.js' - ] + configFile: 'karma.conf.ci.js', }, desktop_build: { singleRun: true, @@ -158,8 +145,9 @@ module.exports = function(grunt) { options: { }, chrome: { - tests: [e2eTestSpecFolder], options: { + configFile: 'wdio.conf.js', + specs: [e2eTestSpecFolder], // overwrite default settings desiredCapabilities: { browserName: 'chrome' @@ -167,13 +155,15 @@ module.exports = function(grunt) { } }, firefox: { - tests: [e2eTestSpecFolder], options: { + configFile: 'wdio.conf.js', + specs: [e2eTestSpecFolder], // overwrite default settings desiredCapabilities: { browserName: 'firefox' - } - } + }, + debug: true + }, } } }) @@ -182,10 +172,11 @@ module.exports = function(grunt) { require('load-grunt-tasks')(grunt, { scope: 'devDependencies' }); grunt.registerTask('setup', ['env:build']); - grunt.registerTask('build', ['setup', 'less', 'copy', 'karma:build']); +// grunt.registerTask('build', ['setup', 'less', 'copy', 'karma:build']); + grunt.registerTask('build', ['setup', 'less', 'copy']); grunt.registerTask('default', ['build']); - grunt.registerTask('desktop_build', ['setup', 'less', 'copy', 'karma:desktop_build', 'webdriver:chrome', 'webdriver:firefox']); + grunt.registerTask('desktop_build', ['setup', 'less', 'copy', 'karma:desktop_build'/* doesn't seem to work right now, 'webdriver:chrome', 'webdriver:firefox'*/]); }; \ No newline at end of file diff --git a/frontend/karma.conf.ci.js b/frontend/karma.conf.ci.js new file mode 100644 index 0000000..cb6f5e1 --- /dev/null +++ b/frontend/karma.conf.ci.js @@ -0,0 +1,19 @@ +var staticContentFolder = '../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content'; +module.exports = function(config) { + config.set({ + runnerPort: 9999, + singleRun: true, + browsers: ['Chrome', 'Firefox', 'PhantomJS'], + reporters: ["spec"], + specReporter: {maxLogLines: 5}, + plugins : ['karma-jasmine', 'karma-phantomjs-launcher', 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-ie-launcher', + 'karma-spec-reporter'], + frameworks: ['jasmine'], + files: [ + staticContentFolder+'/generated/3rd_party/js/jquery.min.js', + staticContentFolder+'/generated/3rd_party/js/**/*.js', + staticContentFolder+'/js/**/*.js', + '../src/test/javascript/spec/*spec.js' + ] + }); +}; \ No newline at end of file diff --git a/frontend/npm b/frontend/npm index e52f477..e283516 100755 --- a/frontend/npm +++ b/frontend/npm @@ -1,2 +1,2 @@ #!/bin/sh -"node/node" "node/npm/bin/npm-cli.js" "$@" +"node/node" "./node/node_modules/npm/bin/npm-cli.js" "$@" diff --git a/frontend/package.json b/frontend/package.json index 1ed44a2..d56bb88 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,24 +15,29 @@ "bootstrap-notify": "3.0.0" }, "devDependencies": { - "grunt": "0.4.5", - "load-grunt-tasks": "2.0.0", - "grunt-cli": "0.1.13", + "grunt": "0.4.x", + "load-grunt-tasks": "3.5.2", + "grunt-cli": "1.2.0", "grunt-env": "0.4.4", - "grunt-contrib-less": "1.0.0", - "grunt-contrib-copy": "0.8.0", - "grunt-contrib-watch": "0.6.1", - "grunt-karma": "0.10.1", - "karma-jasmine": "0.3.5", - "karma-spec-reporter": "0.0.19", - "karma-phantomjs-launcher": "~0.1.4", - "karma-chrome-launcher": "0.1.7", - "karma-firefox-launcher": "0.1.4", - "karma-ie-launcher": "0.1.5", - "webdriver-manager": "3.0.0", - "grunt-webdriver": "0.4.8", - "nlf": "1.1.0", - "grunt-node-inspector": "0.2.0" + "grunt-contrib-less": "1.4.0", + "grunt-contrib-copy": "1.0.0", + "grunt-contrib-watch": "1.0.0", + "grunt-karma": "2.0.0", + "jasmine-core": "2.5.2", + "karma": "1.3.0", + "karma-jasmine": "1.0.2", + "karma-spec-reporter": "0.0.26", + "phantomjs-prebuilt": "2.1.13", + "karma-phantomjs-launcher": "1.0.0", + "karma-chrome-launcher": "2.0.0", + "karma-firefox-launcher": "1.0.0", + "karma-ie-launcher": "1.0.0", + "webdriverio": "4.3.0", + "webdriver-manager": "10.2.6", + "wdio-jasmine-framework": "0.2.15", + "grunt-webdriver": "2.0.2", + "nlf": "1.4.2", + "grunt-node-inspector": "0.4.2" }, "scripts": { "postinstall": "node_modules/.bin/webdriver-manager update --standalone" diff --git a/frontend/wdio.conf.js b/frontend/wdio.conf.js new file mode 100644 index 0000000..a242c4f --- /dev/null +++ b/frontend/wdio.conf.js @@ -0,0 +1,3 @@ +exports.config = { + framework: 'jasmine' +}; \ No newline at end of file diff --git a/pom.xml b/pom.xml index 647e620..5853a56 100644 --- a/pom.xml +++ b/pom.xml @@ -93,7 +93,7 @@ <plugin> <groupId>com.github.eirslett</groupId> <artifactId>frontend-maven-plugin</artifactId> - <version>0.0.24</version> + <version>1.2</version> <configuration> <workingDirectory>frontend</workingDirectory> </configuration> @@ -101,8 +101,8 @@ <execution> <goals> <goal>install-node-and-npm</goal> </goals> <configuration> - <nodeVersion>v0.12.1</nodeVersion> - <npmVersion>1.4.9</npmVersion> + <nodeVersion>v6.9.1</nodeVersion> + <npmVersion>3.10.8</npmVersion> </configuration> </execution> <execution> @@ -113,6 +113,19 @@ <id>grunt build</id> <goals> <goal>grunt</goal> </goals> </execution> + <execution> + <id>javascript tests</id> + <goals> <goal>karma</goal> </goals> + + <!-- optional: the default phase is "test". Some developers + choose to run karma in the "integration-test" phase. --> +<!-- <phase>install</phase> --> + + <configuration> + <!-- optional: the default is "karma.conf.js" in your working directory --> + <karmaConfPath>karma.conf.ci.js</karmaConfPath> + </configuration> + </execution> </executions> </plugin> <plugin> diff --git a/src/test/javascript/e2e/spec/e2e_spec.js b/src/test/javascript/e2e/spec/e2e_spec.js index 2d1781a..9b15f0f 100644 --- a/src/test/javascript/e2e/spec/e2e_spec.js +++ b/src/test/javascript/e2e/spec/e2e_spec.js @@ -211,7 +211,7 @@ describe('A user of the Apache Sling Resource Editor', function() { }); }); - describe('can add a', function(done){ + describe('can add a', function(){ it('String property', function(done) { addProperty("String", "textarea"); client.call(done); @@ -349,7 +349,7 @@ describe('A user of the Apache Sling Resource Editor', function() { // specs ("it" functions) are always executed before describe blocks // that's why this spec is wrapped within a describe block as // it has to be executed last - describe('can delete the (test) node', function(done){ + describe('can delete the (test) node', function(){ it('with the icon', function(done) { client = client.url(homeURL); client.waitForExist('#last-element', function(err) { -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
