1 # Overview of tests shipped with AFB-Daemon
4 Author: Manuel Bachmann
8 Here are the tests shipped in the source tree:
9 * **afb-client-demo** (command-line WebSockets)
10 * **token-websock.qml** (Qt/QML WebSockets)
11 * ***.html** (HTML5/JS HTTP-REST & WebSockets)
16 ### afb-client-demo (command-line WebSockets)
18 This clients interactively calls plugins APIs from the command line, using the binder [WebSockets](https://en.wikipedia.org/wiki/WebSocket) facility.
20 If _afb-daemon_ has been launched with the following parameters:
22 $ afb-daemon --port=1234 --token=123456 [...]
25 Then run the client with :
27 afb-client-demo ws://localhost:1234/api?token=123456 <plugin> <verb>
30 For instance, to initialize the Audio plugin from the command line :
32 afb-client-demo ws://localhost:1234/api?token=123456 auth connect
33 (copy-paste the "token" field from the response)
34 afb-client-demo ws://localhost:1234/api?token=123456 audio init <TOKEN>
41 ### token-websock.qml (Qt/QML WebSockets)
43 If _afb-daemon_ has been launched with the following parameters:
45 $ afb-daemon --port=1234 --token=123456 [...]
47 and Qt5 is installed, on **Ubuntu 16.04**:
49 $ apt-get install qmlscene qml-module-qtwebsockets qml-module-qtquick-controls
53 $ dnf install qt5-qtdeclarative-devel qt5-qtwebsockets-devel qt5-qtquickcontrols
56 Then run the client with :
58 qmlscene test/token-websock.qml
60 and interactively press the buttons, "Connect", "Refresh", "Logout".
65 ### *.html (HTML5/JS HTTP-REST & WebSockets)
67 If _afb-daemon_ has been launched with the following parameters:
69 $ afb-daemon --port=1234 --rootdir=$PWD/test [...]
71 _("$PWD/test_" being the "test" subdirectory of the source tree)_
74 Then open your preferred Web browser, connect to the following URL:
78 and interactively run the various tests.