QT Testing/en: Unterschied zwischen den Versionen
Alkurz (Diskussion | Beiträge) |
Alkurz (Diskussion | Beiträge) |
||
Zeile 3: | Zeile 3: | ||
https://www.qt.io/download |
https://www.qt.io/download |
||
===Supported |
===Supported Versions=== |
||
Expecco supports testing of Qt applications on Windows and Linux, Qt Quick/QML applications from '''Qt version 5''''. |
Expecco supports testing of Qt applications on Windows and Linux, Qt Quick/QML applications from '''Qt version 5''''. |
||
Zeile 10: | Zeile 10: | ||
An overview of the delivered libraries and their version status can be found [[#ExpeccoTestService library: Delivery in expecco versions|here]]. |
An overview of the delivered libraries and their version status can be found [[#ExpeccoTestService library: Delivery in expecco versions|here]]. |
||
==Testing Qt |
==Testing Qt Programs== |
||
===Test |
===Test Preparations=== |
||
====Integrating the |
====Integrating the ExpeccoTestService Library==== |
||
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 |
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. |
||
Instructions for the respective operating system of the test computer can be found here: |
|||
* [[Qt Inject Windows#Inject expeccoTestService-Library|Qt Inject for Windows]] |
|||
* [[Qt Inject Linux#Inject expeccoTestService-Library|Qt Inject for Linux / macOS]]. |
|||
Alternatively, the ExpeccoTestService library call can be inserted into the source code of the application under test ([[Qt Inject Windows/en#Insert into Source Code (alternative)|Description]]). |
Alternatively, the ExpeccoTestService library call can be inserted into the source code of the application under test ([[Qt Inject Windows/en#Insert into Source Code (alternative)|Description]]). |
||
====Start |
====Start Parameters==== |
||
The ExpeccoTestService library can be set via environment variables: |
The ExpeccoTestService library can be set via environment variables: |
||
Zeile 26: | Zeile 30: | ||
* Log file: <code>ETS_QT_LOG_FILE</code> (default value: c:\Windows\temp\etsQt.log or /tmp/etsQt.log). |
* Log file: <code>ETS_QT_LOG_FILE</code> (default value: c:\Windows\temp\etsQt.log or /tmp/etsQt.log). |
||
* Server port: <code>ETS_QT_PORT_NUMBER</code> (default value: 8866). |
* Server port: <code>ETS_QT_PORT_NUMBER</code> (default value: 8866). |
||
* Timeout preview in ms (only Qt Quick): <code>ETS_TIMEOUT_QUICK_IMAGE</code> (default value: 200) |
|||
====Required Qt |
====Required Qt Libraries at Runtime==== |
||
The ExpeccoTestService library depends on the following Qt libraries: |
The ExpeccoTestService library depends on the following Qt libraries: |
||
Zeile 39: | Zeile 43: | ||
* Qt5Widgets |
* Qt5Widgets |
||
===Connecting with |
===Connecting with Expecco GUI Browser=== |
||
The GUI Browser can be used to connect to the program under test: |
The GUI Browser can be used to connect to the program under test: |
||
Zeile 49: | Zeile 53: | ||
Manual [[Expecco GUI Tests_Extension Reference|GUI Browser]]. |
Manual [[Expecco GUI Tests_Extension Reference|GUI Browser]]. |
||
==Qt Quick/QML |
==Qt Quick/QML Programs== |
||
Qt Quick/QML applications can be tested with the expecco QtLibrary starting with expecco 21.2. |
Qt Quick/QML applications can be tested with the expecco QtLibrary starting with expecco 21.2. |
||
Zeile 55: | Zeile 59: | ||
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. |
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. |
||
⚫ | |||
QWidget actions are applicable to Qt Quick items derived from QQuickItem. |
QWidget actions are applicable to Qt Quick items derived from QQuickItem. |
||
Zeile 63: | Zeile 65: | ||
The different handling is encapsulated by the ExpeccoTestService. Thus, the action and the input and output pins remain the same for both Qt technologies. |
The different handling is encapsulated by the ExpeccoTestService. Thus, the action and the input and output pins remain the same for both Qt technologies. |
||
⚫ | |||
⚫ | |||
⚫ | |||
====Control via Properties==== |
====Control via Properties==== |
||
The basis of all Qt Quick/QML interface elements is the QQuickItem class. Most of its properties can be set via properties. There are many derivations of QQuickItem. Expecco does not provide any special building blocks for this, but the elements can be controlled via their properties. |
|||
{| class="wikitable" |
{| class="wikitable" |
||
Zeile 80: | Zeile 84: | ||
|} |
|} |
||
====Actions for |
====Actions for Selected Element==== |
||
The display of actions for GUI elements in the GUI browser is not complete because Qt Quick/QML does not have predefined elements for each interface element. |
|||
====Not yet implemented==== |
====Not yet implemented==== |
||
Zeile 94: | Zeile 98: | ||
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. |
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. |
||
==ExpeccoTestService |
==ExpeccoTestService Library: Delivery in Expecco Versions== |
||
List of Expecco versions with the latest update of the ''ExpeccoTestService'' library for the different Qt versions and build systems. |
|||
===Windows=== |
===Windows=== |
||
Zeile 131: | Zeile 137: | ||
|} |
|} |
||
===Linux / |
===Linux / macOS=== |
||
{| class="wikitable" |
{| class="wikitable" |
Version vom 6. Dezember 2021, 10:47 Uhr
Inhaltsverzeichnis
Pre-requisites[Bearbeiten]
Qt download[Bearbeiten]
Supported Versions[Bearbeiten]
Expecco supports testing of Qt applications on Windows and Linux, Qt Quick/QML applications from Qt version 5'.
For the different Qt versions, operating systems, development environments (VisualStudio, ...) and computer architectures (32/64 bit) we provide specially generated libraries (dll, so). Some of them are delivered with expecco by default. For other versions we generate the library on request.
An overview of the delivered libraries and their version status can be found here.
Testing Qt Programs[Bearbeiten]
Test Preparations[Bearbeiten]
Integrating the ExpeccoTestService Library[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.
Instructions for the respective operating system of the test computer can be found here:
Alternatively, the ExpeccoTestService library call can be inserted into the source code of the application under test (Description).
Start Parameters[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). - Timeout preview in ms (only Qt Quick):
ETS_TIMEOUT_QUICK_IMAGE
(default value: 200)
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).
Manual GUI Browser.
Qt Quick/QML Programs[Bearbeiten]
Qt Quick/QML applications can be tested with the expecco QtLibrary starting with expecco 21.2.
Qt Quick/QML Actions[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.
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.
The actions, which are also suitable for tests of Qt Quick/QML programmes, are provided with the label / tag qt-quick
. The actions can thus be displayed with a configurable colour (Extras - Settings - Look & Feel - Colours per Label (Tag)).
Qt Quick/QML Peculiarities[Bearbeiten]
Control via Properties[Bearbeiten]
The basis of all Qt Quick/QML interface elements is the QQuickItem class. Most of its properties can be set via properties. There are many derivations of QQuickItem. Expecco does not provide any special building blocks for this, but the elements can be controlled via 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]
The display of actions for GUI elements in the GUI browser is not complete because Qt Quick/QML does not have predefined elements for each interface element.
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.
ExpeccoTestService Library: Delivery in Expecco Versions[Bearbeiten]
List of Expecco versions with the latest update of the ExpeccoTestService library for the different Qt versions and build systems.
Windows[Bearbeiten]
Expecco Version | Qt Version | Architecture | Build System | Directory | Comment |
---|---|---|---|---|---|
2021-2 | 5.15.0 | x64 | vs2019 | vs2019_x64_Qt5.15.0 | QtQuick / QML |
5.15.0 | x86 | vs2019 | vs2019_Qt5.15.0 | ||
5.9.3 | x64 | vs2015 | vs2015_x64_Qt5.9.3 | ||
5.9.1 | x64 | vs2015 | vs2015_x64_Qt5.9.1 | ||
2021-1 | 5.9.3 | x86 | vs2015 | vs2015_x86_Qt5.9.3 | |
2020-1 | 5.8.0 | x86 | vs2013 | vs2013_Qt5.8.0 | |
2019-2 | 5.9.3 | x64 | vs2013 | vs2013_x64_Qt5.9.3 | |
5.9.1 | x64 | vs2013 | vs2013_x64_Qt5.9.1 | ||
2018-2 | 5.4.2 | x86 | vs2010 | vs2010_Qt5.4.2 |
Linux / macOS[Bearbeiten]
Expecco Version | Qt Version | Architecture | Build System | Directory | Comment |
---|---|---|---|---|---|
2021-2 | 5.15.0 | x64 | gcc | gcc_x64_Qt5.15.0 | QtQuick / QML |
2021-1 | 5.12.2 | arm32 | gcc | gcc_arm32_Qt.12.2 | |
5.9.5 | x64 | gcc | gcc_x64_Qt5.9.5 | ||
2020-2 | 5.9.1 | x64 | gcc | gcc_x64_Qt5.9.1 | |
2020-1 | 5.12.3 | x64 | gcc | gcc_x64_Qt5.12.3 |
Back to Qt Plugin Reference