QT Testing/en
Inhaltsverzeichnis
Pre-requisites[Bearbeiten]
QT download[Bearbeiten]
Supported versions[Bearbeiten]
Expecco supports testing of QT applications on Windows and Linux created with QT version 5.
For the different QT versions, development environments (VisualStudio, ...) and computer architecture (32/64 bit) we provide specially created libraries (dll, so). Some of them are delivered with expecco by default. For other versions we generate the library on request.
Testing QT programs[Bearbeiten]
Test preparations[Bearbeiten]
To test a QT program with expecco, the library expeccoTestService.[dll/so] delivered by us is included in the program to be tested. This is done via a batch or shell script without intervention in the source code of the program to be tested (Description).
Alternatively, the ExpeccoTestService library call can be inserted into the source code of the application under test (Description).
Start parameter[Bearbeiten]
The ExpeccoTestService library can be set via environment variables:
- Log level:
ETS_QT_LOG_LEVEL
(default value: 0, for logging: 2). - Log file:
ETS_QT_LOG_FILE
(default value: c:\Windows\temp\etsQt.log or /tmp/etsQt.log). - Server port:
ETS_QT_PORT_NUMBER
(default value: 8866).
Required QT libraries at runtime[Bearbeiten]
The ExpeccoTestService library depends on the following QT libraries:
- Qt5Core
- Qt5Gui
- Qt5Network
- Qt5QmlModels
- Qt5Qml
- Qt5Quick
- Qt5Widgets
Connecting with expecco GUI Browser[Bearbeiten]
The GUI Browser can be used to connect to the program under test:
Connect
- Qt
.
In the following dialog, enter the network address of the computer running the application and the port for the connection (8866 by default).
Testing QT-Quick/QML programs[Bearbeiten]
QT-QML applications can be tested with the expecco QTLibrary starting with expecco 21.2.
QT-Quick/QML-Aktionen[Bearbeiten]
For testing QT-Quick/QML programs almost all actions of the QTLibrary can be used, which are defined for testing QT programs based on QWidget / QApplication.
These actions for QML testing are labeled / tagged qt-quick
. To make this clear on the blocks, they can be displayed with a configurable color (Extras - Settings - Look & Feel - Colors per label (tag)).
QWidget actions are applicable to QT Quick items derived from QQuickItem. QQuickItemView actions are applicable to Qt-Quick list items.
The different handling is encapsulated by the ExpeccoTestService. Thus, the action and the input and output pins remain the same for both QT technologies.
QT-Quick/QML peculiarities[Bearbeiten]
Control via Properties[Bearbeiten]
Basis of all QT-Quick/QML interface elements is QQuickItem. Via Properties most of the properties can be set. From QQuickItem there is a multiplicity of derivations. Expecco for it no special building blocks represent, the elements are however controllable over their properties.
QT-Quick element | property | Comment |
---|---|---|
Tumbler | currentIndex | |
Switch | checked | Suitable actions:QCheckButton::GetState QCheckButton::SetState = %2
|
will be continued |
Actions for selected element[Bearbeiten]
Display actions for GUI elements is not comprehensive because QT-Quick/QML has no predefined elements.
Not yet implemented[Bearbeiten]
- TreeView
- Menu
- Selection of cells - so far only one row can be selected
Qt Known Problems[Bearbeiten]
QApplication::ShortCutEvent[Bearbeiten]
Due to internal changes in QT version 5, the module no longer works. A workaround is to send the key events separately, as shown in the example in the Test/Demo tab of the action.
Back to Qt Plugin Reference