SetupViewTest.cc 1.58 KB
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

10 11 12 13 14 15

/// @file
///     @author Don Gagne <don@thegagnes.com>

#include "SetupViewTest.h"
#include "MockLink.h"
16
#include "MultiVehicleManager.h"
17
#include "QGCApplication.h"
18 19

void SetupViewTest::_clickThrough_test(void)
20 21
{    
    _createMainWindow();
22
    _connectMockLink();
23

24
    AutoPilotPlugin* autopilot = qgcApp()->toolbox()->multiVehicleManager()->activeVehicle()->autopilotPlugin();
Don Gagne's avatar
Don Gagne committed
25
    Q_ASSERT(autopilot);
26

27
    // Switch to the Setup view
Don Gagne's avatar
Don Gagne committed
28
    qgcApp()->showSetupView();
29 30
    QTest::qWait(1000);
    
31
    // Click through fixed buttons
32
    qDebug() << "Showing firmware";
Don Gagne's avatar
Don Gagne committed
33
    qgcApp()->_showSetupFirmware();
34
    QTest::qWait(1000);
35
    qDebug() << "Showing parameters";
Don Gagne's avatar
Don Gagne committed
36
    qgcApp()->_showSetupParameters();
37
    QTest::qWait(1000);
38
    qDebug() << "Showing summary";
Don Gagne's avatar
Don Gagne committed
39
    qgcApp()->_showSetupSummary();
40
    QTest::qWait(1000);
41
    
42 43
    const QVariantList& components = autopilot->vehicleComponents();
    foreach(QVariant varComponent, components) {
44 45
        VehicleComponent* component = qobject_cast<VehicleComponent*>(qvariant_cast<QObject *>(varComponent));
        qDebug() << "Showing" << component->name();
Don Gagne's avatar
Don Gagne committed
46
        qgcApp()->_showSetupVehicleComponent(component);
Don Gagne's avatar
Don Gagne committed
47
        QTest::qWait(1000);
48 49
    }

50
    _disconnectMockLink();
51
    _closeMainWindow();
52
}