6bb1b8a9bc4a37543ce1d7d3c0d3f37af663bbe2
[src/app-framework-binder.git] / doc / afb-tests-overview.md
1 Overview of tests shipped with AFB-Daemon
2 =========================================
3     Version: 1
4     Date:    09 juin 2016
5     Author:  Manuel Bachmann
6
7
8 List of tests
9 -------------
10
11 Here are the tests shipped in the source tree:
12
13 * **afb-client-demo** (command-line WebSockets)
14
15 * **token-websock.qml** (Qt/QML WebSockets)
16
17 * ***.html** (HTML5/JS HTTP-REST & WebSockets)
18
19
20 Detail of tests
21 ---------------
22
23 ### afb-client-demo (command-line WebSockets)
24
25 This clients interactively calls plugins APIs from the command line, using the binder
26 [WebSockets](https://en.wikipedia.org/wiki/WebSocket) facility.
27
28 If _afb-daemon_ has been launched with the following parameters:
29
30
31     $ afb-daemon --port=1234 --token=123456 [...]
32
33
34 Then run the client with :
35
36     afb-client-demo ws://localhost:1234/api?token=123456 [<api> <verb> [<json-data>]]
37
38 For instance, to initialize the Audio plugin from the command line :
39
40     afb-client-demo ws://localhost:1234/api?token=123456
41
42 The command doesn't return. You should type requests of type <api> <verb> [<json-data>].
43 So, try:
44
45     auth connect
46     hello pingjson true
47
48 <br />
49
50
51
52 ### token-websock.qml (Qt/QML WebSockets)
53
54 If _afb-daemon_ has been launched with the following parameters:
55
56     $ afb-daemon --port=1234 --token=123456 [...]
57
58 and Qt5 is installed.
59
60 For installing Qt5 on **Ubuntu 16.04**:
61
62     $ apt-get install qmlscene qml-module-qtwebsockets qml-module-qtquick-controls
63
64 For installing Qt5 on **Fedora 23** :
65
66     $ dnf install qt5-qtdeclarative-devel qt5-qtwebsockets-devel qt5-qtquickcontrols
67
68
69 Then run the client with :
70
71     qmlscene test/token-websock.qml
72
73 and interactively press the buttons, "Connect", "Refresh", "Logout".
74
75 <br />
76
77
78 ### *.html (HTML5/JS HTTP-REST & WebSockets)
79
80 If _afb-daemon_ has been launched with the following parameters:
81
82     $ afb-daemon --port=1234 --rootdir=$PWD/test [...]
83
84 _("$PWD/test_" being the "test" subdirectory of the source tree)_
85
86
87 Then open your preferred Web browser, connect to the following URL:
88
89     http://localhost:1234
90
91 and interactively run the various tests.
92