From 121d54c96a42602fd947ef88dfc922aca6951200 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Mon, 30 May 2022 23:13:24 -0400 Subject: [PATCH] Fix transient errors in GUI tests * Fix saving file errors due to atomic saves on Windows * Fix tests that rely on clicking a list index that is out of view --- tests/gui/TestGui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp index f91d45655..fc3da4ea9 100644 --- a/tests/gui/TestGui.cpp +++ b/tests/gui/TestGui.cpp @@ -109,6 +109,8 @@ void TestGui::init() config()->set(Config::UpdateCheckMessageShown, true); // Disable quick unlock config()->set(Config::Security_QuickUnlock, false); + // Disable atomic saves to prevent transient errors on some platforms + config()->set(Config::UseAtomicSaves, false); // Copy the test database file to the temporary file auto origFilePath = QDir(KEEPASSX_TEST_DATA_DIR).absoluteFilePath("NewDatabase.kdbx"); @@ -1889,5 +1891,6 @@ void TestGui::clickIndex(const QModelIndex& index, Qt::MouseButton button, Qt::KeyboardModifiers stateKey) { + view->scrollTo(index); QTest::mouseClick(view->viewport(), button, stateKey, view->visualRect(index).center()); }