Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJonathan White <support@dmapps.us>2020-03-09 05:22:01 +0300
committerJonathan White <support@dmapps.us>2020-03-10 01:03:20 +0300
commitfe1189ea7973466e929810a42b247c284cd26f42 (patch)
tree0405834f0a5755070295741b0dc5c8152ed8d43a /tests
parent1d7ef5d4eb67f935741d95f638770e38ed04f059 (diff)
Enhance Password Editing Fields
* Remove repeat password on entry edit * Move show/hide password and password generator buttons into the field as actions. * Register keyboard shortcut Ctrl+H to toggle password visibility * Register keyboard shortcut Ctrl+G to open the password generator * Cleanup code and improve interactions between elements * Simplify Password Generator button layout; convert advanced mode button to toggle button * Update GUI tests * Fixes #4120
Diffstat (limited to 'tests')
-rw-r--r--tests/gui/TestGui.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp
index 76766c8dc..dd69e3042 100644
--- a/tests/gui/TestGui.cpp
+++ b/tests/gui/TestGui.cpp
@@ -471,17 +471,6 @@ void TestGui::testEditEntry()
QCOMPARE(attrTextEdit->toPlainText(), attrText);
editEntryWidget->setCurrentPage(0);
- // Test mismatch passwords
- auto* passwordEdit = editEntryWidget->findChild<QLineEdit*>("passwordEdit");
- QString originalPassword = passwordEdit->text();
- passwordEdit->setText("newpass");
- QTest::mouseClick(okButton, Qt::LeftButton);
- auto* messageWiget = editEntryWidget->findChild<MessageWidget*>("messageWidget");
- QTRY_VERIFY(messageWiget->isVisible());
- QCOMPARE(m_dbWidget->currentMode(), DatabaseWidget::Mode::EditMode);
- QCOMPARE(passwordEdit->text(), QString("newpass"));
- passwordEdit->setText(originalPassword);
-
// Save the edit (press OK)
QTest::mouseClick(okButton, Qt::LeftButton);
QApplication::processEvents();
@@ -506,7 +495,6 @@ void TestGui::testEditEntry()
titleEdit->setText("multiline\ntitle");
editEntryWidget->findChild<QComboBox*>("usernameComboBox")->lineEdit()->setText("multiline\nusername");
editEntryWidget->findChild<QLineEdit*>("passwordEdit")->setText("multiline\npassword");
- editEntryWidget->findChild<QLineEdit*>("passwordRepeatEdit")->setText("multiline\npassword");
editEntryWidget->findChild<QLineEdit*>("urlEdit")->setText("multiline\nurl");
QTest::mouseClick(okButton, Qt::LeftButton);
@@ -615,9 +603,7 @@ void TestGui::testAddEntry()
QTest::keyClicks(usernameComboBox, "Auto");
QTest::keyPress(usernameComboBox, Qt::Key_Right);
auto* passwordEdit = editEntryWidget->findChild<QLineEdit*>("passwordEdit");
- auto* passwordRepeatEdit = editEntryWidget->findChild<QLineEdit*>("passwordRepeatEdit");
QTest::keyClicks(passwordEdit, "something 2");
- QTest::keyClicks(passwordRepeatEdit, "something 2");
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
QCOMPARE(m_dbWidget->currentMode(), DatabaseWidget::Mode::ViewMode);
@@ -663,8 +649,10 @@ void TestGui::testPasswordEntryEntropy()
QTest::keyClicks(titleEdit, "test");
// Open the password generator
- auto* generatorButton = editEntryWidget->findChild<QToolButton*>("togglePasswordGeneratorButton");
- QTest::mouseClick(generatorButton, Qt::LeftButton);
+ auto* passwordEdit = editEntryWidget->findChild<PasswordEdit*>();
+ QVERIFY(passwordEdit);
+ QTest::mouseClick(passwordEdit, Qt::LeftButton);
+ QTest::keyClick(passwordEdit, Qt::Key_G, Qt::ControlModifier);
// Type in some password
auto* editNewPassword = editEntryWidget->findChild<QLineEdit*>("editNewPassword");
@@ -735,8 +723,10 @@ void TestGui::testDicewareEntryEntropy()
QTest::keyClicks(titleEdit, "test");
// Open the password generator
- auto* generatorButton = editEntryWidget->findChild<QToolButton*>("togglePasswordGeneratorButton");
- QTest::mouseClick(generatorButton, Qt::LeftButton);
+ auto* passwordEdit = editEntryWidget->findChild<PasswordEdit*>();
+ QVERIFY(passwordEdit);
+ QTest::mouseClick(passwordEdit, Qt::LeftButton);
+ QTest::keyClick(passwordEdit, Qt::Key_G, Qt::ControlModifier);
// Select Diceware
auto* tabWidget = editEntryWidget->findChild<QTabWidget*>("tabWidget");
@@ -1440,7 +1430,6 @@ int TestGui::addCannedEntries()
auto* editEntryWidget = m_dbWidget->findChild<EditEntryWidget*>("editEntryWidget");
auto* titleEdit = editEntryWidget->findChild<QLineEdit*>("titleEdit");
auto* passwordEdit = editEntryWidget->findChild<QLineEdit*>("passwordEdit");
- auto* passwordRepeatEdit = editEntryWidget->findChild<QLineEdit*>("passwordRepeatEdit");
// Add entry "test" and confirm added
QTest::mouseClick(entryNewWidget, Qt::LeftButton);
@@ -1453,7 +1442,6 @@ int TestGui::addCannedEntries()
QTest::mouseClick(entryNewWidget, Qt::LeftButton);
QTest::keyClicks(titleEdit, "something 2");
QTest::keyClicks(passwordEdit, "something 2");
- QTest::keyClicks(passwordRepeatEdit, "something 2");
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
++entries_added;