mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 15:29:44 -05:00
Add GUI test for issue #1595 (minus the minimize at startup case).
This commit is contained in:
parent
bf9c1b3205
commit
8646586c1a
@ -71,6 +71,8 @@ void TestGui::initTestCase()
|
|||||||
Config::createTempFileInstance();
|
Config::createTempFileInstance();
|
||||||
// Disable autosave so we can test the modified file indicator
|
// Disable autosave so we can test the modified file indicator
|
||||||
Config::instance()->set("AutoSaveAfterEveryChange", false);
|
Config::instance()->set("AutoSaveAfterEveryChange", false);
|
||||||
|
// Enable the tray icon so we can test hiding/restoring the window
|
||||||
|
Config::instance()->set("GUI/ShowTrayIcon", true);
|
||||||
|
|
||||||
m_mainWindow = new MainWindow();
|
m_mainWindow = new MainWindow();
|
||||||
m_tabWidget = m_mainWindow->findChild<DatabaseTabWidget*>("tabWidget");
|
m_tabWidget = m_mainWindow->findChild<DatabaseTabWidget*>("tabWidget");
|
||||||
@ -1091,6 +1093,29 @@ void TestGui::testDragAndDropKdbxFiles()
|
|||||||
QCOMPARE(m_tabWidget->count(), openedDatabasesCount);
|
QCOMPARE(m_tabWidget->count(), openedDatabasesCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestGui::testTrayRestoreHide()
|
||||||
|
{
|
||||||
|
QSystemTrayIcon *trayIcon = m_mainWindow->findChild<QSystemTrayIcon*>();
|
||||||
|
|
||||||
|
QVERIFY(m_mainWindow->isVisible());
|
||||||
|
|
||||||
|
trayIcon->activated(QSystemTrayIcon::Trigger);
|
||||||
|
Tools::wait(100);
|
||||||
|
QVERIFY(!m_mainWindow->isVisible());
|
||||||
|
|
||||||
|
trayIcon->activated(QSystemTrayIcon::Trigger);
|
||||||
|
Tools::wait(100);
|
||||||
|
QVERIFY(m_mainWindow->isVisible());
|
||||||
|
|
||||||
|
trayIcon->activated(QSystemTrayIcon::Trigger);
|
||||||
|
Tools::wait(100);
|
||||||
|
QVERIFY(!m_mainWindow->isVisible());
|
||||||
|
|
||||||
|
trayIcon->activated(QSystemTrayIcon::Trigger);
|
||||||
|
Tools::wait(100);
|
||||||
|
QVERIFY(m_mainWindow->isVisible());
|
||||||
|
}
|
||||||
|
|
||||||
void TestGui::cleanupTestCase()
|
void TestGui::cleanupTestCase()
|
||||||
{
|
{
|
||||||
delete m_mainWindow;
|
delete m_mainWindow;
|
||||||
|
@ -63,6 +63,7 @@ private slots:
|
|||||||
void testKeePass1Import();
|
void testKeePass1Import();
|
||||||
void testDatabaseLocking();
|
void testDatabaseLocking();
|
||||||
void testDragAndDropKdbxFiles();
|
void testDragAndDropKdbxFiles();
|
||||||
|
void testTrayRestoreHide();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int addCannedEntries();
|
int addCannedEntries();
|
||||||
|
Loading…
Reference in New Issue
Block a user