Author: sboehme
Date: Tue Mar 31 20:34:23 2015
New Revision: 1670471

URL: http://svn.apache.org/r1670471
Log:
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

Modified:
    sling/trunk/contrib/explorers/resourceeditor/README
    sling/trunk/contrib/explorers/resourceeditor/frontend/Gruntfile.js
    
sling/trunk/contrib/explorers/resourceeditor/src/main/resources/SLING-INF/libs/sling/resource-editor/html.jsp
    
sling/trunk/contrib/explorers/resourceeditor/src/test/javascript/e2e/spec/e2e_spec.js

Modified: sling/trunk/contrib/explorers/resourceeditor/README
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/explorers/resourceeditor/README?rev=1670471&r1=1670470&r2=1670471&view=diff
==============================================================================
--- sling/trunk/contrib/explorers/resourceeditor/README (original)
+++ sling/trunk/contrib/explorers/resourceeditor/README Tue Mar 31 20:34:23 2015
@@ -10,8 +10,9 @@ o After that you find the web applicatio
 ++ 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. 
 
 
 

Modified: sling/trunk/contrib/explorers/resourceeditor/frontend/Gruntfile.js
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/explorers/resourceeditor/frontend/Gruntfile.js?rev=1670471&r1=1670470&r2=1670471&view=diff
==============================================================================
--- sling/trunk/contrib/explorers/resourceeditor/frontend/Gruntfile.js 
(original)
+++ sling/trunk/contrib/explorers/resourceeditor/frontend/Gruntfile.js Tue Mar 
31 20:34:23 2015
@@ -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.

Modified: 
sling/trunk/contrib/explorers/resourceeditor/src/main/resources/SLING-INF/libs/sling/resource-editor/html.jsp
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/explorers/resourceeditor/src/main/resources/SLING-INF/libs/sling/resource-editor/html.jsp?rev=1670471&r1=1670470&r2=1670471&view=diff
==============================================================================
--- 
sling/trunk/contrib/explorers/resourceeditor/src/main/resources/SLING-INF/libs/sling/resource-editor/html.jsp
 (original)
+++ 
sling/trunk/contrib/explorers/resourceeditor/src/main/resources/SLING-INF/libs/sling/resource-editor/html.jsp
 Tue Mar 31 20:34:23 2015
@@ -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">
 

Modified: 
sling/trunk/contrib/explorers/resourceeditor/src/test/javascript/e2e/spec/e2e_spec.js
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/explorers/resourceeditor/src/test/javascript/e2e/spec/e2e_spec.js?rev=1670471&r1=1670470&r2=1670471&view=diff
==============================================================================
--- 
sling/trunk/contrib/explorers/resourceeditor/src/test/javascript/e2e/spec/e2e_spec.js
 (original)
+++ 
sling/trunk/contrib/explorers/resourceeditor/src/test/javascript/e2e/spec/e2e_spec.js
 Tue Mar 31 20:34:23 2015
@@ -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


Reply via email to