Add tests documentation, fix typo
authorManuel Bachmann <manuel.bachmann@iot.bzh>
Mon, 30 May 2016 12:56:38 +0000 (14:56 +0200)
committerManuel Bachmann <manuel.bachmann@iot.bzh>
Mon, 30 May 2016 12:58:06 +0000 (14:58 +0200)
Document the tests in "test/".
Fix typo in plugins documentation.

Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
doc/afb-plugins-overview.md
doc/afb-tests-overview.md [new file with mode: 0644]

index 7e351b6..18b67b1 100644 (file)
@@ -1,6 +1,6 @@
 # Overview of plugins shipped with AFB-Daemon
     Version: 1
-    Date:    30 mai 2016
+    Date:    30 May 2016
     Author:  Manuel Bachmann
 
 
diff --git a/doc/afb-tests-overview.md b/doc/afb-tests-overview.md
new file mode 100644 (file)
index 0000000..a4632d4
--- /dev/null
@@ -0,0 +1,78 @@
+# Overview of tests shipped with AFB-Daemon
+    Version: 1
+    Date:    30 May 2016
+    Author:  Manuel Bachmann
+
+
+## List of tests
+  Here are the tests shipped in the source tree:
+ * **afb-client-demo** (command-line WebSockets)
+ * **token-websock.qml** (Qt/QML WebSockets)
+ * ***.html** (HTML5/JS HTTP-REST & WebSockets)
+
+
+## Detail of tests
+
+### afb-client-demo (command-line WebSockets)
+
+This clients interactively calls plugins APIs from the command line, using the binder [WebSockets](https://en.wikipedia.org/wiki/WebSocket) facility.
+
+If _afb-daemon_ has been launched with the following parameters:
+```
+$ afb-daemon --port=1234 --token=123456 [...]
+```
+
+Then run the client with :
+```
+afb-client-demo ws://localhost:1234/api?token=123456 <plugin> <verb>
+```
+
+For instance, to initialize the Audio plugin from the command line :
+```
+afb-client-demo ws://localhost:1234/api?token=123456 auth connect
+(copy-paste the "token" field from the response)
+afb-client-demo ws://localhost:1234/api?token=123456 audio init <TOKEN>
+```
+
+<br />
+
+
+
+### token-websock.qml (Qt/QML WebSockets)
+
+If _afb-daemon_ has been launched with the following parameters:
+```
+$ afb-daemon --port=1234 --token=123456 [...]
+```
+and Qt5 is installed, on **Ubuntu 16.04**:
+```
+$ apt-get install qmlscene qml-module-qtwebsockets qml-module-qtquick-controls
+```
+or on **Fedora 23** :
+```
+$ dnf install qt5-qtdeclarative-devel qt5-qtwebsockets-devel qt5-qtquickcontrols
+```
+
+Then run the client with :
+```
+qmlscene test/token-websock.qml
+```
+and interactively press the buttons, "Connect", "Refresh", "Logout".
+
+<br />
+
+
+### *.html (HTML5/JS HTTP-REST & WebSockets)
+
+If _afb-daemon_ has been launched with the following parameters:
+```
+$ afb-daemon --port=1234 --rootdir=$PWD/test [...]
+```
+_("$PWD/test_" being the "test" subdirectory of the source tree)_
+
+
+Then open your preferred Web browser, connect to the following URL:
+```
+http://localhost:1234
+```
+and interactively run the various tests.