RTView is a separate process that receives LogObject
s from another process (for example, cardano-node
) and displays them on HTML-page. It can be shown like this:
Process 1 Process 2 Process 3
+--------------+ [LogObject] +-----------------+ web-requests +-------------+
| cardano-node | ------------> | cardano-rt-view | <-------------- | web browser |
+--------------+ +-----------------+ --------------> +-------------+
HTML-page
To test it automatically, we use additional scripts and programs:
sender.sh
- it takesLogObject
s from predefined JSON-file and sends them to RTView (via UNIX-socket).analyzer
- it analyzes RTView UI (complete HTML-page).
It can be shown like this:
Process 1 Process 2
+-----------+ [LogObject] +-----------------+ web-requests +----------+
logObjects.json --> | sender.sh | ------------> | cardano-rt-view | <-------------- | analyzer |
+-----------+ +-----------------+ --------------> +----------+
HTML-page
Please note that analyzer
doesn't analyze RTView UI (complete HTML-page) by itself. Instead, it launches the real web browser and use it to analyze the page automatically, using Selenium standalone server and webdriver
package. It can be shown like this:
+----------+ +-------------+ +---------+ web-commands +-----------------+
| analyzer | ----> | GeckoDriver | ----> | Firefox | -------------> | cardano-rt-view |
+----------+ +-------------+ +---------+ +-----------------+
\
\ +-----------------+
`-------> | Selenium server |
+-----------------+
Please make sure you have these commands in your PATH
:
jq
to minimize predefined JSON-file withLogObject
s.nc
to sendLogObject
s from predefined JSON-file tocardano-rt-view
(via UNIX socket).firefix
to interact with RTView UI (complete HTML-page),geckodriver
to interact with Firefox,java
to launchselenium-server-standalone
.
Please note that you have to provide full path to selenium-server-standalone
file (something like selenium-server-standalone-3.141.59.jar
) to runTest.sh
script (see below). selenium-server-standalone
will be used by webdriver
package. This server can be downloaded here.
Run ./runTest.sh <options> PATH_TO_SELENIUM_SERVER_JAR
script which launches:
cardano-rt-view
process (in the background),sender.sh
script,selenium-server-standalone
process (in the background),analyzer
process.
( can be something like --stack-nix
or --nix
to select the builder)
analyzer
process launches Firefox web browser and sends corresponding web-commands to it. The results returned by analyzer
are the results of the test.
analyzer
checks the visual behavior of RTView UI (complete HTML-page):
- changing view mode (both pane and grid),
- checks if metrics and/or node can be hidden/shown,
- validates the real values of displayed metrics (for comparing them with values from predefined JSON-file with
LogObject
s).