CanUseHelpMenu.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <gtest/gtest.h>
  9. #include <QPushButton>
  10. #include <QAction>
  11. #include <QtTest>
  12. #include <QMessageBox>
  13. #include <Tests/UI/MenuUIFixture.h>
  14. #include <Tests/UI/AnimGraphUIFixture.h>
  15. #include <EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetsWindowPlugin.h>
  16. #include <EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.h>
  17. #include <EMotionStudio/EMStudioSDK/Source/EMStudioManager.h>
  18. namespace EMotionFX
  19. {
  20. TEST_F(MenuUIFixture, CanUseHelpMenu)
  21. {
  22. RecordProperty("test_case_id", "C1698605");
  23. // For the open autosave/settings folders, we can't check whether they have succeeded without OS dependent code,
  24. // so we just check the options and folders exist.
  25. const QMenu* helpMenu = MenuUIFixture::FindMainMenuWithName("EMFX.MainWindow.HelpMenu");
  26. ASSERT_TRUE(helpMenu) << "Unable to find help menu.";
  27. const QMenu* foldersMenu = MenuUIFixture::FindMenuWithName(helpMenu, "EMFX.MainWindow.FoldersMenu");
  28. ASSERT_TRUE(helpMenu) << "Unable to find folders menu.";
  29. const QAction* autosaveAction = FindMenuAction(foldersMenu, "Open autosave folder", "EMFX.MainWindow.FoldersMenu");
  30. ASSERT_TRUE(autosaveAction) << "Unable to find autosave folder menu item.";
  31. const QAction* settingsAction = FindMenuAction(foldersMenu, "Open settings folder", "EMFX.MainWindow.FoldersMenu");
  32. ASSERT_TRUE(settingsAction) << "Unable to find settings folder menu item.";
  33. const QString autosaveFolder = EMStudio::GetManager()->GetAutosavesFolder().c_str();
  34. ASSERT_TRUE(QDir(autosaveFolder).exists()) << "Unable to find autosave folder ";
  35. const QString settingsFolder = EMStudio::GetManager()->GetAppDataFolder().c_str();
  36. ASSERT_TRUE(QDir(settingsFolder).exists()) << "Unable to find settings folder ";
  37. }
  38. } // namespace EMotionFX