Name: QSpec
Owner: ugeneunipro
Description: null
Created: 2016-01-13 10:58:57.0
Updated: 2017-08-09 16:22:14.0
Pushed: 2017-12-14 07:14:29.0
Homepage: null
Size: 310
Language: C++
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
QSpec
is a GUI testing library for Qt desktop applications.
You need to create declarations for your tests like the following:
lude <core/GUITest.h>
g namespace HI;
ine GUI_TEST_SUITE "My_base_tests"
TEST_CLASS_DECLARATION(Test1)
TEST_CLASS_DECLARATION(Test2)
ef GUI_TEST_SUITE
Also you need to create definitions of the tests:
_CLASS_DEFINITION(Test1){
//body of test
_CLASS_DEFINITION(Test2){
//body of test
After this you need to implement GUITestsLauncher
interface:
lude <core/GUITestsLauncher.h>
g namespace HI;
s MyGUITestsLauncher: public GUITestsLauncher
ic:
MyGUITestsLauncher();
ITestsLauncher::MyGUITestsLauncher(): GUITestsLauncher()
guiTestBase.registerTest(new Test1());
guiTestBase.registerTest(new Test2());
In the main function of your application you need to add something like this:
QString runGuiTest = qgetenv("HI_GUI_TEST");
if (!runGuiTest.isEmpty()) {
MyGUITestsLauncher* tests = new MyGUITestsLauncher();
tests->connect(&myMainWindow,SIGNAL(si_applicationStarted()),tests,SLOT(sl_runTest()));
}
A single test can be run just using 'HI_GUI_TEST' environment variable.
First set the variable.
For Unix systems:
rt HI_GUI_TEST=<suite_name>:<test_name>
For Windows systems:
HI_GUI_TEST=<suite_name>:<test_name>
Then run the application.
Qt5
See more info here.
This project is available under GNU GPL V2 license.