Commit 4342cfe5 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(tests): wait 100ms when main window is focused

parent ca7c145d
...@@ -34,14 +34,17 @@ ...@@ -34,14 +34,17 @@
QVERIFY(virtualWindowContent); \ QVERIFY(virtualWindowContent); \
QVERIFY(!strncmp(virtualWindowContent->metaObject()->className(), TYPE, sizeof TYPE - 1)); \ QVERIFY(!strncmp(virtualWindowContent->metaObject()->className(), TYPE, sizeof TYPE - 1)); \
QCOMPARE(virtualWindowContent->objectName(), QStringLiteral(NAME)); \ QCOMPARE(virtualWindowContent->objectName(), QStringLiteral(NAME)); \
} while (0) } while (0);
#define INIT_GUI_TEST() \ #define INIT_GUI_TEST() \
QQuickWindow * mainWindow = App::getInstance()->getMainWindow(); \ do { \
App::smartShowWindow(mainWindow); \ QQuickWindow *mainWindow = App::getInstance()->getMainWindow(); \
QQuickItem *contentLoader = mainWindow->findChild<QQuickItem *>("__contentLoader"); \ App::smartShowWindow(mainWindow); \
QVERIFY(contentLoader); \ QTest::qWait(100); \
QTest::mouseClick(mainWindow, Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(110, 100)); QQuickItem *contentLoader = mainWindow->findChild<QQuickItem *>("__contentLoader"); \
QVERIFY(contentLoader); \
QTest::mouseClick(mainWindow, Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(110, 100)); \
} while (0);
namespace TestUtils { namespace TestUtils {
void executeKeySequence (QQuickWindow *window, QKeySequence sequence); void executeKeySequence (QQuickWindow *window, QKeySequence sequence);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment