TestGuiBrowser.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (C) 2011 Felix Geyer <debfx@fobos.de>
  3. * Copyright (C) 2019 KeePassXC Team <team@keepassxc.org>
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 2 or (at your option)
  8. * version 3 of the License.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef KEEPASSXC_TESTGUIBROWSER_H
  19. #define KEEPASSXC_TESTGUIBROWSER_H
  20. #include "gui/MainWindow.h"
  21. #include "util/TemporaryFile.h"
  22. class Database;
  23. class DatabaseTabWidget;
  24. class DatabaseWidget;
  25. class QAbstractItemView;
  26. class TestGuiBrowser : public QObject
  27. {
  28. Q_OBJECT
  29. private slots:
  30. void initTestCase();
  31. void init();
  32. void cleanup();
  33. void cleanupTestCase();
  34. void testEntrySettings();
  35. void testAdditionalURLs();
  36. void testGetDatabaseGroups();
  37. private:
  38. void triggerAction(const QString& name);
  39. void clickIndex(const QModelIndex& index,
  40. QAbstractItemView* view,
  41. Qt::MouseButton button,
  42. Qt::KeyboardModifiers stateKey = 0);
  43. QScopedPointer<MainWindow> m_mainWindow;
  44. QPointer<DatabaseTabWidget> m_tabWidget;
  45. QPointer<DatabaseWidget> m_dbWidget;
  46. QSharedPointer<Database> m_db;
  47. QScopedPointer<TemporaryFile> m_dbFile;
  48. };
  49. #endif // KEEPASSXC_TESTGUIBROWSER_H