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 626f8cf188cf3d8feea99e96961b70aabeaaba77 Author: Sandro Boehme <[email protected]> AuthorDate: Tue Mar 31 20:34:23 2015 +0000 SLING-4462 Resource Editor: Extracted the 'e2eTestSpecFolder' in the Gruntfile.js, replaced the dummy e2e test with a test for the Resource Editor page, added watch:all and watch:e2e git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1670471 13f79535-47bb-0310-9956-ffa450edef68 --- README | 3 ++- frontend/Gruntfile.js | 29 +++++++++++++++++++--- .../SLING-INF/libs/sling/resource-editor/html.jsp | 1 + src/test/javascript/e2e/spec/e2e_spec.js | 16 ++++++------ 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/README b/README index f8592ab..dc9b33c 100644 --- a/README +++ b/README @@ -10,8 +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 have the less sources automatically compiled on change call `./grunt watch:less` in the frontend directory. Press Ctrl-Z to stop watching. 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 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 call `./grunt watch:all` in the frontend directory and also press Ctrl-Z to stop watching. diff --git a/frontend/Gruntfile.js b/frontend/Gruntfile.js index 0ca99f4..7348b0e 100644 --- a/frontend/Gruntfile.js +++ b/frontend/Gruntfile.js @@ -1,6 +1,9 @@ module.exports = function(grunt) { - + var staticContentFolder = '../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content'; + var jspFolder = '../src/main/resources/SLING-INF/libs/sling/resource-editor'; + var e2eTestSpecFolder = '../src/test/javascript/e2e/spec/**/*spec.js'; + //console.log(grunt.option('host')); grunt.initConfig({ env : { @@ -25,6 +28,22 @@ module.exports = function(grunt) { less : { files : '../src/main/less/**/*.less', tasks : [ 'less' ], + }, + all : { + files : ['../src/main/less/**/*.less', + '../src/test/javascript/**/*spec.js', + staticContentFolder+'/js/**/*.js', + jspFolder+'/*.*' + ], + tasks : [ 'desktop_build' ], + }, + e2e : { + files : ['../src/main/less/**/*.less', + '../src/test/javascript/**/*spec.js', + staticContentFolder+'/js/**/*.js', + jspFolder+'/*.*' + ], + tasks : [ 'webdriver:chrome', 'webdriver:firefox' ], } }, _comment:'The google web fonts could be downloaded and copied via grunt-goog-webfont-dl. But goog-webfont-dl directly points to the global #!/usr/bin/env node and not to the local one.', @@ -96,9 +115,11 @@ module.exports = function(grunt) { }, webdriver: { options: { + host: 'localhost', + port: 8080 }, chrome: { - tests: ['../src/test/javascript/e2e/spec/**/*spec.js'], + tests: [e2eTestSpecFolder], options: { // overwrite default settings desiredCapabilities: { @@ -107,7 +128,7 @@ module.exports = function(grunt) { } }, firefox: { - tests: ['../src/test/javascript/e2e/spec/**/*spec.js'], + tests: [e2eTestSpecFolder], options: { // overwrite default settings desiredCapabilities: { @@ -115,7 +136,7 @@ module.exports = function(grunt) { } } } - } + } }) // These plugins provide necessary tasks. diff --git a/src/main/resources/SLING-INF/libs/sling/resource-editor/html.jsp b/src/main/resources/SLING-INF/libs/sling/resource-editor/html.jsp index 4596119..f5ed1d6 100644 --- a/src/main/resources/SLING-INF/libs/sling/resource-editor/html.jsp +++ b/src/main/resources/SLING-INF/libs/sling/resource-editor/html.jsp @@ -11,6 +11,7 @@ <sling:defineObjects /> <html lang="en"> <head> +<title>Apache Sling Resource Editor</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> diff --git a/src/test/javascript/e2e/spec/e2e_spec.js b/src/test/javascript/e2e/spec/e2e_spec.js index 0513734..87eafda 100644 --- a/src/test/javascript/e2e/spec/e2e_spec.js +++ b/src/test/javascript/e2e/spec/e2e_spec.js @@ -3,12 +3,12 @@ var assert = require('assert'); describe('The Apache Sling Resource Editor', function() { - it('should have a title', function(done) { - browser - .url('http://juliemr.github.io/protractor-demo/') - .getTitle(function(err,title) { - assert(title.indexOf('Super Calculator') !== -1); - }) - .call(done); - }); + it('should have a title', function(done) { + browser + .url('http://localhost:8080/reseditor/.html') + .getTitle(function(err,title) { + assert(title.indexOf('Apache Sling Resource Editor') !== -1); + }) + .call(done); + }); }); \ No newline at end of file -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
