Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/mkws
authorMike Taylor <mike@indexdata.com>
Fri, 17 Oct 2014 09:26:38 +0000 (10:26 +0100)
committerMike Taylor <mike@indexdata.com>
Fri, 17 Oct 2014 09:26:38 +0000 (10:26 +0100)
test/Makefile
test/README.txt

index c0333fa..5705e4d 100644 (file)
@@ -5,7 +5,7 @@ MIKE = PATH=$$PATH:/usr/local/lib/node-v0.10.24-linux-x64/bin
 
 APACHE_PORT:= $(shell echo $${APACHE_PORT-4040})
 
-#PHANTOMJS_URL=https://mkws-dev.indexdata.com/jasmine-popup.html       
+#PHANTOMJS_URL=https://mkws-dev.indexdata.com/jasmine-popup.html
 PHANTOMJS_PATH=jasmine-local-popup.html
 PHANTOMJS_URL=http://localhost:${APACHE_PORT}/${PHANTOMJS_PATH}
 PHANTOMJS_TIMEOUT=18
@@ -23,7 +23,7 @@ APACHE_PORT ?= 4040
 all: check
 
 clean:
-       rm -f mkws-error.png mkws-error.html 
+       rm -f mkws-error.png mkws-error.html
        rm -f images/*.png
        ${MAKE} -C./widgets $@
 
@@ -43,7 +43,11 @@ mkws-complete-syntax-check:
        ${MAKE} -C../src ../tools/htdocs/mkws-complete.min.js
 
 check check-js: mkws-complete-syntax-check
-       @if [ ! -e node_modules ]; then echo "please run first: make node-modules"; exit 1; fi 
+       @if [ ! -e node_modules ]; then \
+           echo "==> please run first: make node-modules"; \
+           echo ""; \
+           exit 1; \
+       fi
        ${JASMINE_NODE} --noColor --captureExceptions --forceexit ./spec
 
 test: check
@@ -51,7 +55,7 @@ test: check
 terse:
        $(MIKE) jasmine-node --noColor --captureExceptions --forceexit spec
 
-phantomjs p: apache-stop apache-start _phantomjs 
+phantomjs p: check-js apache-stop apache-start _phantomjs
        ${MAKE} apache-stop
 
 _phantomjs:
@@ -101,7 +105,7 @@ apache-start:
        bin/apache-template-update
        ${APACHE_HTTPD} -f `pwd`/${TMP_DIR}/jasmine-dev-${APACHE_PORT}.conf
 
-APACHE_PID_FILE=${TMP_DIR}/mkws-jasmine-${APACHE_PORT}.pid 
+APACHE_PID_FILE=${TMP_DIR}/mkws-jasmine-${APACHE_PORT}.pid
 apache-stop:
        @-if [ -e ${APACHE_PID_FILE} ]; then \
           kill `cat ${APACHE_PID_FILE}`; \
@@ -128,4 +132,3 @@ help:
        @echo "make APACHE_PORT=5050 apache-start"
        @echo "make phantomjs-all"
        @echo ""
-
index 3d30b7e..221a4a4 100644 (file)
@@ -1,15 +1,36 @@
 Jasmine / jasmine-node test frame works
----------------------------------------
+=============================================
 
 This directory contains the MasterKey Widget Set (MKWS) Test framework.
 
-To install (some) prerequisites, run:
 
+Installation
+-------------------------------------
+1. install node.js, see http://nodejs.org/
+
+# debian7
 $ sudo apt-get install npm
-$ sudo npm install -g
+
+# centos6
+$ sudo yum install npm
+
+
+The nodejs modules are configured in ./package.json
+You can install them manually with
+$ make node-modules
+
+if you want. The top level makefile in ./mkws/Makefile takes care to
+checkout and update the modules automatically.
+
+
+Testing
+---------------------------------------
+
 
 To run the tests, run:
 
+1. basic javscript tests
+
 $ make check
 jasmine-node ./spec
 .......................................
@@ -18,22 +39,30 @@ Finished in 2.024 seconds
 39 tests, 194 assertions, 0 failures, 0 skipped
 
 
+2. Testing the Widgets in a headless browser with Jasmine
+
 $ make phantomjs
 [ headless jasmine test with console.log() messages
 
-$ DEBUG=1 make phantomjs PHANTOM_URL=https://mkws-dev.indexdata.com/jasmine-popup.html
+$ DEBUG=1 make phantomjs PHANTOM_URL=https://example.indexdata.com/jasmine-popup.html
 [ less debug noise ]
 
+
 To get a basic help, run:
 $ make help
 
 
 File system hierarchy
 --------------------------------------
-./spec         contains *spec.js files
+./spec         contains *spec.js files for phantomjs
+./spec-dev     development *spec.js files
 ./js           jasmine runtime JS lib
 ./phantom      scripts for phantomjs tests
-
+./bin          helper scripts
+./etc          configuration files
+./logs         apache access and error log files
+./widgets      screenshots for MKWS widgets
+./images       screenshots for testing
 
 Documentation
 ---------------------------------------
@@ -42,12 +71,6 @@ https://github.com/pivotal/jasmine
 http://phantomjs.org/
 
 
-Installation
--------------------------------------
-1. install node.js, see http://nodejs.org/
-2. install node modules with npm: 
-$ make node-modules
-
 --
 Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com
-Feb 2014, Wolfram
+Oct 2014, Wolfram