mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-03-13 09:36:42 -04:00
Fix assert hit when viewing entry history
* Fixes #11371 * Adds test for showing entry history * Improved page switching capabilities for entry edit widget
This commit is contained in:
parent
c6800bf705
commit
2836364e1a
@ -179,6 +179,7 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
|
|||||||
m_previewSplitter->setSizes({1, 1});
|
m_previewSplitter->setSizes({1, 1});
|
||||||
|
|
||||||
m_editEntryWidget->setObjectName("editEntryWidget");
|
m_editEntryWidget->setObjectName("editEntryWidget");
|
||||||
|
m_historyEditEntryWidget->setObjectName("editEntryHistoryWidget");
|
||||||
m_editGroupWidget->setObjectName("editGroupWidget");
|
m_editGroupWidget->setObjectName("editGroupWidget");
|
||||||
m_reportsDialog->setObjectName("reportsDialog");
|
m_reportsDialog->setObjectName("reportsDialog");
|
||||||
m_databaseSettingDialog->setObjectName("databaseSettingsDialog");
|
m_databaseSettingDialog->setObjectName("databaseSettingsDialog");
|
||||||
@ -273,7 +274,7 @@ DatabaseWidget::Mode DatabaseWidget::currentMode() const
|
|||||||
mode = Mode::ReportsMode;
|
mode = Mode::ReportsMode;
|
||||||
} else if (widget == m_databaseSettingDialog) {
|
} else if (widget == m_databaseSettingDialog) {
|
||||||
mode = Mode::DatabaseSettingsMode;
|
mode = Mode::DatabaseSettingsMode;
|
||||||
} else if (widget == m_editEntryWidget) {
|
} else if (widget == m_editEntryWidget || widget == m_historyEditEntryWidget) {
|
||||||
mode = Mode::EditEntryMode;
|
mode = Mode::EditEntryMode;
|
||||||
} else if (widget == m_editGroupWidget) {
|
} else if (widget == m_editGroupWidget) {
|
||||||
mode = Mode::EditGroupMode;
|
mode = Mode::EditGroupMode;
|
||||||
|
@ -73,16 +73,25 @@ void EditWidget::addPage(const QString& labelText, const QIcon& icon, QWidget* w
|
|||||||
m_ui->categoryList->addCategory(labelText, icon);
|
m_ui->categoryList->addCategory(labelText, icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EditWidget::hasPage(QWidget* widget)
|
bool EditWidget::hasPage(const QWidget* widget) const
|
||||||
{
|
{
|
||||||
|
return pageIndex(widget) >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EditWidget::pageIndex(const QWidget* widget) const
|
||||||
|
{
|
||||||
|
if (!widget) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < m_ui->stackedWidget->count(); i++) {
|
for (int i = 0; i < m_ui->stackedWidget->count(); i++) {
|
||||||
auto* scrollArea = qobject_cast<QScrollArea*>(m_ui->stackedWidget->widget(i));
|
auto* scrollArea = qobject_cast<QScrollArea*>(m_ui->stackedWidget->widget(i));
|
||||||
if (scrollArea && scrollArea->widget() == widget) {
|
if (scrollArea && scrollArea->widget() == widget) {
|
||||||
return true;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditWidget::setPageHidden(QWidget* widget, bool hidden)
|
void EditWidget::setPageHidden(QWidget* widget, bool hidden)
|
||||||
|
@ -42,7 +42,8 @@ public:
|
|||||||
~EditWidget();
|
~EditWidget();
|
||||||
|
|
||||||
void addPage(const QString& labelText, const QIcon& icon, QWidget* widget);
|
void addPage(const QString& labelText, const QIcon& icon, QWidget* widget);
|
||||||
bool hasPage(QWidget* widget);
|
bool hasPage(const QWidget* widget) const;
|
||||||
|
int pageIndex(const QWidget* widget) const;
|
||||||
void setPageHidden(QWidget* widget, bool hidden);
|
void setPageHidden(QWidget* widget, bool hidden);
|
||||||
void setCurrentPage(int index);
|
void setCurrentPage(int index);
|
||||||
void setHeadline(const QString& text);
|
void setHeadline(const QString& text);
|
||||||
|
@ -140,6 +140,47 @@ EditEntryWidget::~EditEntryWidget()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EditEntryWidget::switchToPage(Page page)
|
||||||
|
{
|
||||||
|
auto index = pageIndex(widgetForPage(page));
|
||||||
|
if (index >= 0) {
|
||||||
|
setCurrentPage(index);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget* EditEntryWidget::widgetForPage(Page page) const
|
||||||
|
{
|
||||||
|
switch (page) {
|
||||||
|
case Page::Main:
|
||||||
|
return m_mainWidget;
|
||||||
|
case Page::Advanced:
|
||||||
|
return m_advancedWidget;
|
||||||
|
case Page::Icon:
|
||||||
|
return m_iconsWidget;
|
||||||
|
case Page::AutoType:
|
||||||
|
return m_autoTypeWidget;
|
||||||
|
case Page::Browser:
|
||||||
|
#ifdef WITH_XC_BROWSER
|
||||||
|
return m_browserWidget;
|
||||||
|
#else
|
||||||
|
return nullptr;
|
||||||
|
#endif
|
||||||
|
case Page::SSHAgent:
|
||||||
|
#ifdef WITH_XC_SSHAGENT
|
||||||
|
return m_sshAgentWidget;
|
||||||
|
#else
|
||||||
|
return nullptr;
|
||||||
|
#endif
|
||||||
|
case Page::Properties:
|
||||||
|
return m_editWidgetProperties;
|
||||||
|
case Page::History:
|
||||||
|
return m_historyWidget;
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void EditEntryWidget::setupMain()
|
void EditEntryWidget::setupMain()
|
||||||
{
|
{
|
||||||
m_mainUi->setupUi(m_mainWidget);
|
m_mainUi->setupUi(m_mainWidget);
|
||||||
@ -847,7 +888,7 @@ void EditEntryWidget::loadEntry(Entry* entry,
|
|||||||
setForms(entry);
|
setForms(entry);
|
||||||
setReadOnly(m_history);
|
setReadOnly(m_history);
|
||||||
|
|
||||||
setCurrentPage(0);
|
switchToPage(Page::Main);
|
||||||
setPageHidden(m_historyWidget, m_history || m_entry->historyItems().count() < 1);
|
setPageHidden(m_historyWidget, m_history || m_entry->historyItems().count() < 1);
|
||||||
#ifdef WITH_XC_SSHAGENT
|
#ifdef WITH_XC_SSHAGENT
|
||||||
setPageHidden(m_sshAgentWidget, !sshAgent()->isEnabled());
|
setPageHidden(m_sshAgentWidget, !sshAgent()->isEnabled());
|
||||||
@ -1092,7 +1133,7 @@ bool EditEntryWidget::commitEntry()
|
|||||||
MessageBox::Yes | MessageBox::No,
|
MessageBox::Yes | MessageBox::No,
|
||||||
MessageBox::Yes);
|
MessageBox::Yes);
|
||||||
if (res == MessageBox::Yes) {
|
if (res == MessageBox::Yes) {
|
||||||
setCurrentPage(3);
|
switchToPage(Page::AutoType);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1107,7 +1148,7 @@ bool EditEntryWidget::commitEntry()
|
|||||||
MessageBox::Yes | MessageBox::No,
|
MessageBox::Yes | MessageBox::No,
|
||||||
MessageBox::Yes);
|
MessageBox::Yes);
|
||||||
if (res == MessageBox::Yes) {
|
if (res == MessageBox::Yes) {
|
||||||
setCurrentPage(3);
|
switchToPage(Page::AutoType);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,19 @@ public:
|
|||||||
Entry* currentEntry() const;
|
Entry* currentEntry() const;
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
enum class Page
|
||||||
|
{
|
||||||
|
Main,
|
||||||
|
Advanced,
|
||||||
|
Icon,
|
||||||
|
AutoType,
|
||||||
|
Browser,
|
||||||
|
SSHAgent,
|
||||||
|
Properties,
|
||||||
|
History
|
||||||
|
};
|
||||||
|
bool switchToPage(Page page);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void editFinished(bool accepted);
|
void editFinished(bool accepted);
|
||||||
void historyEntryActivated(Entry* entry);
|
void historyEntryActivated(Entry* entry);
|
||||||
@ -162,6 +175,8 @@ private:
|
|||||||
|
|
||||||
void displayAttribute(QModelIndex index, bool showProtected);
|
void displayAttribute(QModelIndex index, bool showProtected);
|
||||||
|
|
||||||
|
QWidget* widgetForPage(Page page) const;
|
||||||
|
|
||||||
QPointer<Entry> m_entry;
|
QPointer<Entry> m_entry;
|
||||||
QSharedPointer<Database> m_db;
|
QSharedPointer<Database> m_db;
|
||||||
|
|
||||||
|
@ -471,8 +471,28 @@ void TestGui::testEditEntry()
|
|||||||
QCOMPARE(entry->historyItems().size(), ++editCount);
|
QCOMPARE(entry->historyItems().size(), ++editCount);
|
||||||
QVERIFY(!applyButton->isEnabled());
|
QVERIFY(!applyButton->isEnabled());
|
||||||
|
|
||||||
|
// Test viewing entry history
|
||||||
|
auto historyView = editEntryWidget->findChild<QTreeView*>("historyView");
|
||||||
|
auto showButton = editEntryWidget->findChild<QPushButton*>("showButton");
|
||||||
|
QVERIFY(historyView);
|
||||||
|
editEntryWidget->switchToPage(EditEntryWidget::Page::History);
|
||||||
|
QApplication::processEvents();
|
||||||
|
QVERIFY(historyView->isVisible());
|
||||||
|
QVERIFY(!showButton->isEnabled());
|
||||||
|
// Select the second row in the history view
|
||||||
|
historyView->setCurrentIndex(historyView->model()->index(1, 0));
|
||||||
|
QVERIFY(showButton->isEnabled());
|
||||||
|
QTest::mouseClick(showButton, Qt::LeftButton);
|
||||||
|
// Verify that the entry history widget is shown
|
||||||
|
auto entryHistoryWidget = m_dbWidget->findChild<QWidget*>("editEntryHistoryWidget");
|
||||||
|
QVERIFY(entryHistoryWidget);
|
||||||
|
QVERIFY(entryHistoryWidget->isVisible());
|
||||||
|
QCOMPARE(m_dbWidget->currentMode(), DatabaseWidget::Mode::EditEntryMode);
|
||||||
|
QTest::keyClick(entryHistoryWidget, Qt::Key_Escape);
|
||||||
|
QVERIFY(historyView->isVisible());
|
||||||
|
|
||||||
// Test the "known bad" checkbox
|
// Test the "known bad" checkbox
|
||||||
editEntryWidget->setCurrentPage(1);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Advanced);
|
||||||
auto excludeReportsCheckBox = editEntryWidget->findChild<QCheckBox*>("excludeReportsCheckBox");
|
auto excludeReportsCheckBox = editEntryWidget->findChild<QCheckBox*>("excludeReportsCheckBox");
|
||||||
QVERIFY(excludeReportsCheckBox);
|
QVERIFY(excludeReportsCheckBox);
|
||||||
QCOMPARE(excludeReportsCheckBox->isChecked(), false);
|
QCOMPARE(excludeReportsCheckBox->isChecked(), false);
|
||||||
@ -495,7 +515,7 @@ void TestGui::testEditEntry()
|
|||||||
QCOMPARE(tags->tags().last(), QString("tag 2_is!awesome"));
|
QCOMPARE(tags->tags().last(), QString("tag 2_is!awesome"));
|
||||||
|
|
||||||
// Test entry colors (simulate choosing a color)
|
// Test entry colors (simulate choosing a color)
|
||||||
editEntryWidget->setCurrentPage(1);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Advanced);
|
||||||
auto fgColor = QString("#FF0000");
|
auto fgColor = QString("#FF0000");
|
||||||
auto bgColor = QString("#0000FF");
|
auto bgColor = QString("#0000FF");
|
||||||
// Set foreground color
|
// Set foreground color
|
||||||
@ -512,7 +532,7 @@ void TestGui::testEditEntry()
|
|||||||
QCOMPARE(entry->historyItems().size(), ++editCount);
|
QCOMPARE(entry->historyItems().size(), ++editCount);
|
||||||
|
|
||||||
// Test protected attributes
|
// Test protected attributes
|
||||||
editEntryWidget->setCurrentPage(1);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Advanced);
|
||||||
auto* attrTextEdit = editEntryWidget->findChild<QPlainTextEdit*>("attributesEdit");
|
auto* attrTextEdit = editEntryWidget->findChild<QPlainTextEdit*>("attributesEdit");
|
||||||
QTest::mouseClick(editEntryWidget->findChild<QAbstractButton*>("addAttributeButton"), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidget->findChild<QAbstractButton*>("addAttributeButton"), Qt::LeftButton);
|
||||||
QString attrText = "TEST TEXT";
|
QString attrText = "TEST TEXT";
|
||||||
@ -522,7 +542,7 @@ void TestGui::testEditEntry()
|
|||||||
QVERIFY(attrTextEdit->toPlainText().contains("PROTECTED"));
|
QVERIFY(attrTextEdit->toPlainText().contains("PROTECTED"));
|
||||||
QTest::mouseClick(editEntryWidget->findChild<QAbstractButton*>("revealAttributeButton"), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidget->findChild<QAbstractButton*>("revealAttributeButton"), Qt::LeftButton);
|
||||||
QCOMPARE(attrTextEdit->toPlainText(), attrText);
|
QCOMPARE(attrTextEdit->toPlainText(), attrText);
|
||||||
editEntryWidget->setCurrentPage(0);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Main);
|
||||||
|
|
||||||
// Save the edit (press OK)
|
// Save the edit (press OK)
|
||||||
QTest::mouseClick(okButton, Qt::LeftButton);
|
QTest::mouseClick(okButton, Qt::LeftButton);
|
||||||
@ -901,7 +921,7 @@ void TestGui::testTotp()
|
|||||||
QCOMPARE(m_dbWidget->currentMode(), DatabaseWidget::Mode::EditEntryMode);
|
QCOMPARE(m_dbWidget->currentMode(), DatabaseWidget::Mode::EditEntryMode);
|
||||||
|
|
||||||
auto* editEntryWidget = m_dbWidget->findChild<EditEntryWidget*>("editEntryWidget");
|
auto* editEntryWidget = m_dbWidget->findChild<EditEntryWidget*>("editEntryWidget");
|
||||||
editEntryWidget->setCurrentPage(1);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Advanced);
|
||||||
auto* attrTextEdit = editEntryWidget->findChild<QPlainTextEdit*>("attributesEdit");
|
auto* attrTextEdit = editEntryWidget->findChild<QPlainTextEdit*>("attributesEdit");
|
||||||
QTest::mouseClick(editEntryWidget->findChild<QAbstractButton*>("revealAttributeButton"), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidget->findChild<QAbstractButton*>("revealAttributeButton"), Qt::LeftButton);
|
||||||
QCOMPARE(attrTextEdit->toPlainText(), expectedFinalSeed);
|
QCOMPARE(attrTextEdit->toPlainText(), expectedFinalSeed);
|
||||||
@ -1623,7 +1643,7 @@ void TestGui::testDatabaseSettings()
|
|||||||
QTest::keyClicks(titleEdit, "Test autosaveDelay 1");
|
QTest::keyClicks(titleEdit, "Test autosaveDelay 1");
|
||||||
|
|
||||||
// 2.b) Save changes
|
// 2.b) Save changes
|
||||||
editEntryWidget->setCurrentPage(0);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Main);
|
||||||
auto* editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
|
auto* editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
|
||||||
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
|
|
||||||
@ -1637,7 +1657,7 @@ void TestGui::testDatabaseSettings()
|
|||||||
QTest::keyClicks(titleEdit, "Test autosaveDelay 2");
|
QTest::keyClicks(titleEdit, "Test autosaveDelay 2");
|
||||||
|
|
||||||
// 2.e) Save changes
|
// 2.e) Save changes
|
||||||
editEntryWidget->setCurrentPage(0);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Main);
|
||||||
editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
|
editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
|
||||||
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
|
|
||||||
@ -1657,7 +1677,7 @@ void TestGui::testDatabaseSettings()
|
|||||||
QTest::keyClicks(titleEdit, "Test autosaveDelay 3");
|
QTest::keyClicks(titleEdit, "Test autosaveDelay 3");
|
||||||
|
|
||||||
// 4.b) Save changes
|
// 4.b) Save changes
|
||||||
editEntryWidget->setCurrentPage(0);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Main);
|
||||||
editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
|
editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
|
||||||
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
|
|
||||||
@ -1676,7 +1696,7 @@ void TestGui::testDatabaseSettings()
|
|||||||
QTest::mouseClick(entryNewWidget, Qt::LeftButton);
|
QTest::mouseClick(entryNewWidget, Qt::LeftButton);
|
||||||
QCOMPARE(m_dbWidget->currentMode(), DatabaseWidget::Mode::EditEntryMode);
|
QCOMPARE(m_dbWidget->currentMode(), DatabaseWidget::Mode::EditEntryMode);
|
||||||
QTest::keyClicks(titleEdit, "Test autosaveDelay 4");
|
QTest::keyClicks(titleEdit, "Test autosaveDelay 4");
|
||||||
editEntryWidget->setCurrentPage(0);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Main);
|
||||||
editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
|
editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
|
||||||
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
Tools::wait(150); // due to modify timer
|
Tools::wait(150); // due to modify timer
|
||||||
@ -1922,7 +1942,7 @@ void TestGui::testAutoType()
|
|||||||
QTest::keyClicks(usernameComboBox, "AutocompletionUsername");
|
QTest::keyClicks(usernameComboBox, "AutocompletionUsername");
|
||||||
|
|
||||||
// 1.b) Uncheck Auto-Type checkbox
|
// 1.b) Uncheck Auto-Type checkbox
|
||||||
editEntryWidget->setCurrentPage(3);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::AutoType);
|
||||||
auto* enableAutoTypeButton = editEntryWidget->findChild<QCheckBox*>("enableButton");
|
auto* enableAutoTypeButton = editEntryWidget->findChild<QCheckBox*>("enableButton");
|
||||||
QVERIFY(enableAutoTypeButton);
|
QVERIFY(enableAutoTypeButton);
|
||||||
QVERIFY(enableAutoTypeButton->isVisible());
|
QVERIFY(enableAutoTypeButton->isVisible());
|
||||||
@ -1932,7 +1952,7 @@ void TestGui::testAutoType()
|
|||||||
QVERIFY(!enableAutoTypeButton->isChecked());
|
QVERIFY(!enableAutoTypeButton->isChecked());
|
||||||
|
|
||||||
// 1.c) Save changes
|
// 1.c) Save changes
|
||||||
editEntryWidget->setCurrentPage(0);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Main);
|
||||||
auto* editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
|
auto* editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox");
|
||||||
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
|
|
||||||
@ -1946,13 +1966,13 @@ void TestGui::testAutoType()
|
|||||||
QTest::keyClicks(usernameComboBox, "AutocompletionUsername");
|
QTest::keyClicks(usernameComboBox, "AutocompletionUsername");
|
||||||
|
|
||||||
// 2.b) Confirm AutoType is enabled and default
|
// 2.b) Confirm AutoType is enabled and default
|
||||||
editEntryWidget->setCurrentPage(3);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::AutoType);
|
||||||
QVERIFY(enableAutoTypeButton->isChecked());
|
QVERIFY(enableAutoTypeButton->isChecked());
|
||||||
auto* inheritSequenceButton = editEntryWidget->findChild<QRadioButton*>("inheritSequenceButton");
|
auto* inheritSequenceButton = editEntryWidget->findChild<QRadioButton*>("inheritSequenceButton");
|
||||||
QVERIFY(inheritSequenceButton->isChecked());
|
QVERIFY(inheritSequenceButton->isChecked());
|
||||||
|
|
||||||
// 2.c) Save changes
|
// 2.c) Save changes
|
||||||
editEntryWidget->setCurrentPage(0);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Main);
|
||||||
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
|
|
||||||
// 3. Create an entry with custom Auto-Type sequence
|
// 3. Create an entry with custom Auto-Type sequence
|
||||||
@ -1965,7 +1985,7 @@ void TestGui::testAutoType()
|
|||||||
QTest::keyClicks(usernameComboBox, "AutocompletionUsername");
|
QTest::keyClicks(usernameComboBox, "AutocompletionUsername");
|
||||||
|
|
||||||
// 3.b) Confirm AutoType is enabled and set custom sequence
|
// 3.b) Confirm AutoType is enabled and set custom sequence
|
||||||
editEntryWidget->setCurrentPage(3);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::AutoType);
|
||||||
QVERIFY(enableAutoTypeButton->isChecked());
|
QVERIFY(enableAutoTypeButton->isChecked());
|
||||||
auto* customSequenceButton = editEntryWidget->findChild<QRadioButton*>("customSequenceButton");
|
auto* customSequenceButton = editEntryWidget->findChild<QRadioButton*>("customSequenceButton");
|
||||||
QTest::mouseClick(customSequenceButton, Qt::LeftButton);
|
QTest::mouseClick(customSequenceButton, Qt::LeftButton);
|
||||||
@ -1978,7 +1998,7 @@ void TestGui::testAutoType()
|
|||||||
QTest::keyClicks(sequenceEdit, "{USERNAME}{TAB}{TAB}{PASSWORD}{ENTER}");
|
QTest::keyClicks(sequenceEdit, "{USERNAME}{TAB}{TAB}{PASSWORD}{ENTER}");
|
||||||
|
|
||||||
// 3.c) Save changes
|
// 3.c) Save changes
|
||||||
editEntryWidget->setCurrentPage(0);
|
editEntryWidget->switchToPage(EditEntryWidget::Page::Main);
|
||||||
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user