Baseline tests: wait longer before taking a screen snapshot

The recorded images frequently show traces of a fading-out command
prompt window that is opened by the test execution. We evidently have
to wait longer for all window-level effects are finished.

Pick-to: 6.5
Change-Id: I50db54ff33bf4bb1ef7c480a4aede1d5de1618c3
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Volker Hilsheimer 2023-04-20 09:21:27 +02:00
parent fed79b873e
commit b3424c7027

View File

@ -124,8 +124,9 @@ QImage QWidgetBaselineTest::takeSnapshot()
*/
QImage QWidgetBaselineTest::takeScreenSnapshot(const QRect& windowRect)
{
// make sure all effects are done
QTest::qWait(250);
// make sure all effects are done - wait longer here because entire
// windows might be fading in and out.
QTest::qWait(750);
return window->screen()->grabWindow(0, windowRect.x(), windowRect.y(),
windowRect.width(), windowRect.height()).toImage();
}