Commit 4c8b3f0f authored by Don Gagne's avatar Don Gagne

Click through all setup buttons

parent 999a4a87
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
#include "SetupViewTest.h" #include "SetupViewTest.h"
#include "MockLink.h" #include "MockLink.h"
#include "QGCMessageBox.h" #include "QGCMessageBox.h"
#include "SetupView.h"
#include "UASManager.h"
#include "AutoPilotPluginManager.h"
UT_REGISTER_TEST(SetupViewTest) UT_REGISTER_TEST(SetupViewTest)
...@@ -72,9 +75,31 @@ void SetupViewTest::_clickThrough_test(void) ...@@ -72,9 +75,31 @@ void SetupViewTest::_clickThrough_test(void)
_mainToolBar->onSetupView(); _mainToolBar->onSetupView();
QTest::qWait(1000); QTest::qWait(1000);
// Click through all the setup buttons MainWindow* mainWindow = MainWindow::instance();
// FIXME: NYI Q_ASSERT(mainWindow);
QWidget* setupViewWidget = mainWindow->getCurrentViewWidget();
Q_ASSERT(setupViewWidget);
SetupView* setupView = qobject_cast<SetupView*>(setupViewWidget);
Q_ASSERT(setupView);
// Click through fixed buttons
setupView->firmwareButtonClicked();
QTest::qWait(1000);
setupView->parametersButtonClicked();
QTest::qWait(1000);
setupView->summaryButtonClicked();
QTest::qWait(1000);
// Click through component buttons
UASInterface* uas = UASManager::instance()->getActiveUAS();
Q_ASSERT(uas);
AutoPilotPlugin* autopilot = AutoPilotPluginManager::instance()->getInstanceForAutoPilotPlugin(uas);
Q_ASSERT(autopilot);
const QVariantList& components = autopilot->vehicleComponents();
foreach(QVariant varComponent, components) {
setupView->setupButtonClicked(varComponent);
}
// On MainWindow close we should get a message box telling the user to disconnect first. Disconnect will then pop // On MainWindow close we should get a message box telling the user to disconnect first. Disconnect will then pop
// the log file save dialog. // the log file save dialog.
......
...@@ -124,6 +124,8 @@ public: ...@@ -124,6 +124,8 @@ public:
/// @brief Gets a pointer to the Main Tool Bar /// @brief Gets a pointer to the Main Tool Bar
MainToolBar* getMainToolBar(void) { return _mainToolBar; } MainToolBar* getMainToolBar(void) { return _mainToolBar; }
QWidget* getCurrentViewWidget(void) { return _currentViewWidget; }
public slots: public slots:
/** @brief Show the application settings */ /** @brief Show the application settings */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment