ugeneunipro/QSpec

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

QSpec Build Status

Introduction

QSpec is a GUI testing library for Qt desktop applications.

Writing Tests

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()));
}
Running Tests

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.

Requirements

Qt5

Development and contributions

See more info here.

License

This project is available under GNU GPL V2 license.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.