Thank you for your replay.
It was very helpful. But I still have some problems:
1)
list1.addDelay(3000);
list1.
addMouseMove(QPoint(10,
10));
list1.addDelay(1000);
list1.
addMousePress(Qt
::LeftButton,
0,
QPoint(10,
10));
list1.simulate(mw.ui->search_btn);
QTestEventList list1;
list1.addDelay(3000);
list1.addMouseMove(QPoint(10,10));
list1.addDelay(1000);
list1.addMousePress(Qt::LeftButton,0,QPoint(10,10));
list1.simulate(mw.ui->search_btn);
To copy to clipboard, switch view to plain text mode
coursor move to proper position, mark the button but action( open new dialog) is not executed
2)
QTest
::mouseMove(mw.
ui->tableView
->viewport
(),
QPoint(20,
10));
QTest
::mouseClick(mw.
ui->tableView
->viewport
(),Qt
::LeftButton,
0,
QPoint(20,
10));
//works fine
QTest
::mouseMove(mw.
ui->tableView
->viewport
(),
QPoint(20,
10));
QTest
::mouseClick(mw.
ui->tableView
->viewport
(),Qt
::RightButton,
0,
QPoint(20,
10));
//should open context menu but only mark one field in view
QTest::mouseMove(mw.ui->tableView->viewport(),QPoint(20,10));
QTest::mouseClick(mw.ui->tableView->viewport(),Qt::LeftButton,0,QPoint(20,10)); //works fine
QTest::mouseMove(mw.ui->tableView->viewport(),QPoint(20,10));
QTest::mouseClick(mw.ui->tableView->viewport(),Qt::RightButton,0,QPoint(20,10)); //should open context menu but only mark one field in view
To copy to clipboard, switch view to plain text mode
3) on button search_btn should open new dialog - how i can check if it hapens?
i've tried: QApplication::activeWindow()->windowTitle();
but while it is present, program goes to dialog and I need to manually exit from dialog to continue
4) where can I find some more info about GUI testing using Qt tests
Bookmarks