mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Add KeePass1 import GUI test.
This commit is contained in:
parent
baa5a74ba0
commit
dedce07530
@ -217,6 +217,26 @@ void TestGui::testSearch()
|
||||
QCOMPARE(entryView->model()->rowCount(), 1);
|
||||
}
|
||||
|
||||
void TestGui::testKeePass1Import()
|
||||
{
|
||||
QAction* actionImportKeePass1 = m_mainWindow->findChild<QAction*>("actionImportKeePass1");
|
||||
fileDialog()->setNextFileName(QString(KEEPASSX_TEST_DATA_DIR).append("/basic.kdb"));
|
||||
actionImportKeePass1->trigger();
|
||||
QTest::qWait(20);
|
||||
|
||||
QWidget* keepass1OpenWidget = m_mainWindow->findChild<QWidget*>("keepass1OpenWidget");
|
||||
QLineEdit* editPassword = keepass1OpenWidget->findChild<QLineEdit*>("editPassword");
|
||||
QVERIFY(editPassword);
|
||||
|
||||
QTest::keyClicks(editPassword, "masterpw");
|
||||
QTest::keyClick(editPassword, Qt::Key_Enter);
|
||||
QTest::qWait(20);
|
||||
|
||||
QTabWidget* tabWidget = m_mainWindow->findChild<QTabWidget*>("tabWidget");
|
||||
QCOMPARE(tabWidget->count(), 2);
|
||||
QCOMPARE(tabWidget->tabText(tabWidget->currentIndex()), QString("basic [New database]*"));
|
||||
}
|
||||
|
||||
void TestGui::cleanupTestCase()
|
||||
{
|
||||
delete m_mainWindow;
|
||||
|
@ -33,6 +33,7 @@ private Q_SLOTS:
|
||||
void testEditEntry();
|
||||
void testAddEntry();
|
||||
void testSearch();
|
||||
void testKeePass1Import();
|
||||
void cleanupTestCase();
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user