https://github.com/dushistov/qt_monkey
Tool for testing Qt based applications
https://github.com/dushistov/qt_monkey
qt qt4 qt5 test-automation testing testing-tools
Last synced: 2 months ago
JSON representation
Tool for testing Qt based applications
- Host: GitHub
- URL: https://github.com/dushistov/qt_monkey
- Owner: Dushistov
- License: bsd-3-clause
- Created: 2016-04-20T21:26:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-12-12T06:48:04.000Z (almost 6 years ago)
- Last Synced: 2025-06-04T07:51:48.384Z (5 months ago)
- Topics: qt, qt4, qt5, test-automation, testing, testing-tools
- Language: C++
- Homepage:
- Size: 540 KB
- Stars: 48
- Watchers: 13
- Forks: 17
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Qt Monkey [](https://travis-ci.org/Dushistov/qt_monkey) [](https://ci.appveyor.com/project/Dushistov/qt-monkey) [](https://github.com/Dushistov/qt_monkey/blob/master/LICENSE)
## Introduction
Qt Monkey is a tool to automate testing of Qt-based applications (widgets only).
It automates creation/modification and running of the tests.
Tests are written in Javascript (Qt supported dialect).
To write your tests, simply run your application (instrumented by Qt Monkey) and click
on widget, input text, etc. As a result, a script in Javascript will be generated
(see https://github.com/Dushistov/qt_monkey/blob/master/tests/test1.js for example).
[]
After that you can add suitable asserts and run this script via command line or GUI tool.
[]
## Requirements
Qt Monkey requires compiler with C++11 support and Qt 4.x or Qt 5.x.
## How to use
First, download and build Qt Monkey:
```sh
git clone --recursive https://github.com/Dushistov/qt_monkey.git
cd qt_monkey
cmake -DQT_VARIANT="qt5" .
cmake --build .
```
Also you can use -DQT_VARIANT="qt4" for building with Qt 4.x.
Then, integrate Qt Monkey agent into your application:
1. Make sure that you link your application with qtmonkey_agent library
2. Create object of class `qt_monkey_agent::Agent` in the main thread of your application:
```C++
qt_monkey_agent::Agent agent;
```
That's all. Now you can run qtmonkey_gui application
and record or run your own scripts. See https://github.com/Dushistov/qt_monkey/blob/master/tests/test_app/main.cpp
for the more complex usage example.
## Internals
Qt Monkey consists of three parts: Qt Monkey's agent library (qtmonkey_agent),
qtmonkey_app (tool that run test application and cooperates with agent) and qtmonkey_gui.
qtmonkey_app and qtmonkey_gui use json as their preferred data marshalling language
and communicate via stdin/stdout streams. Therefore you can easily replace qtmonkey_gui
with a plugin for your favorite IDE.