Add GUI test for changing the database transform rounds.

Refs #34
This commit is contained in:
Felix Geyer 2012-07-17 10:35:17 +02:00
parent 66422437d3
commit f767a098d6
3 changed files with 22 additions and 0 deletions

View File

@ -115,6 +115,7 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
headlineLabelFont.setPointSize(headlineLabelFont.pointSize() + 2);
m_changeMasterKeyWidget->headlineLabel()->setFont(headlineLabelFont);
m_databaseSettingsWidget = new DatabaseSettingsWidget();
m_databaseSettingsWidget->setObjectName("databaseSettingsWidget");
m_databaseOpenWidget = new DatabaseOpenWidget();
m_databaseOpenWidget->setObjectName("databaseOpenWidget");
m_keepass1OpenWidget = new KeePass1OpenWidget();

View File

@ -23,6 +23,7 @@
#include <QtGui/QDialogButtonBox>
#include <QtGui/QLineEdit>
#include <QtGui/QPushButton>
#include <QtGui/QSpinBox>
#include <QtGui/QToolBar>
#include <QtGui/QToolButton>
@ -252,6 +253,25 @@ void TestGui::testSave()
QVERIFY(checkDatabase());
}
void TestGui::testDatabaseSettings()
{
QAction* actionChangeDatabaseSettings = m_mainWindow->findChild<QAction*>("actionChangeDatabaseSettings");
actionChangeDatabaseSettings->trigger();
QWidget* dbSettingsWidget = m_dbWidget->findChild<QWidget*>("databaseSettingsWidget");
QSpinBox* transformRoundsSpinBox = dbSettingsWidget->findChild<QSpinBox*>("transformRoundsSpinBox");
transformRoundsSpinBox->setValue(100);
QTest::keyClick(transformRoundsSpinBox, Qt::Key_Enter);
QTest::qWait(200); // wait for modified timer
QCOMPARE(m_tabWidget->tabText(m_tabWidget->currentIndex()), QString("Save*"));
QCOMPARE(m_db->transformRounds(), Q_UINT64_C(100));
QAction* actionDatabaseSave = m_mainWindow->findChild<QAction*>("actionDatabaseSave");
actionDatabaseSave->trigger();
QCOMPARE(m_tabWidget->tabText(m_tabWidget->currentIndex()), QString("Save"));
QVERIFY(checkDatabase());
}
void TestGui::testKeePass1Import()
{
QAction* actionImportKeePass1 = m_mainWindow->findChild<QAction*>("actionImportKeePass1");

View File

@ -39,6 +39,7 @@ private Q_SLOTS:
void testSearch();
void testSaveAs();
void testSave();
void testDatabaseSettings();
void testKeePass1Import();
void cleanupTestCase();