wlanutilities/wlanwizard/t_wlanwizard/ut/testwlanwizardeap.cpp
author hgs
Thu, 24 Jun 2010 10:49:51 +0300
changeset 39 7b3e49e4608a
permissions -rw-r--r--
201025
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
 * All rights reserved.
hgs
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
 *
hgs
parents:
diff changeset
     9
 * Initial Contributors:
hgs
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
 *
hgs
parents:
diff changeset
    12
 * Contributors:
hgs
parents:
diff changeset
    13
 *
hgs
parents:
diff changeset
    14
 * Description:
hgs
parents:
diff changeset
    15
 */
hgs
parents:
diff changeset
    16
hgs
parents:
diff changeset
    17
// System includes
hgs
parents:
diff changeset
    18
#include <QTest>
hgs
parents:
diff changeset
    19
#include <QDebug>
hgs
parents:
diff changeset
    20
#include <QList>
hgs
parents:
diff changeset
    21
#include <cmmanagerdefines_shim.h>
hgs
parents:
diff changeset
    22
#include <wlanerrorcodes.h>
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
// User includes
hgs
parents:
diff changeset
    25
#include "testwlanwizardeap.h"
hgs
parents:
diff changeset
    26
#include "testwlanwizardeap_conf.h"
hgs
parents:
diff changeset
    27
#include "hbautotest.h"
hgs
parents:
diff changeset
    28
#include "wlanwizard.h"
hgs
parents:
diff changeset
    29
#include "wlanwizard_p.h"
hgs
parents:
diff changeset
    30
#include "wlanqtutils_context.h"
hgs
parents:
diff changeset
    31
#include "wlanqtutils.h"
hgs
parents:
diff changeset
    32
#include "wlanqtutilsap.h"
hgs
parents:
diff changeset
    33
#include "wlanwizardpageinternal.h"
hgs
parents:
diff changeset
    34
#include "eapwizardpage.h"
hgs
parents:
diff changeset
    35
#include "eapqtvalidator_stub.h"
hgs
parents:
diff changeset
    36
hgs
parents:
diff changeset
    37
#include "eapqtconfiginterface_context.h"
hgs
parents:
diff changeset
    38
hgs
parents:
diff changeset
    39
// External function prototypes
hgs
parents:
diff changeset
    40
hgs
parents:
diff changeset
    41
// Local constants
hgs
parents:
diff changeset
    42
hgs
parents:
diff changeset
    43
hgs
parents:
diff changeset
    44
// ======== LOCAL FUNCTIONS ========
hgs
parents:
diff changeset
    45
hgs
parents:
diff changeset
    46
// ======== MEMBER FUNCTIONS ========
hgs
parents:
diff changeset
    47
hgs
parents:
diff changeset
    48
hgs
parents:
diff changeset
    49
// ---------------------------------------------------------
hgs
parents:
diff changeset
    50
// TEST CASES
hgs
parents:
diff changeset
    51
// ---------------------------------------------------------
hgs
parents:
diff changeset
    52
void TestWlanWizardEap::tc_eap_outer_page_orientation_change()
hgs
parents:
diff changeset
    53
{
hgs
parents:
diff changeset
    54
#ifdef tc_eap_outer_page_orientation_change_enabled
hgs
parents:
diff changeset
    55
   
hgs
parents:
diff changeset
    56
    const QString ssid("tc_eap_outer_page_orientation_change");
hgs
parents:
diff changeset
    57
    
hgs
parents:
diff changeset
    58
    mEapQtUtilsContext->createEapAkaSim(EapQtPluginHandle::PluginEapAka);
hgs
parents:
diff changeset
    59
    
hgs
parents:
diff changeset
    60
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
    61
        ssid, 
hgs
parents:
diff changeset
    62
        CMManagerShim::Infra,
hgs
parents:
diff changeset
    63
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
    64
        false, false, false);
hgs
parents:
diff changeset
    65
hgs
parents:
diff changeset
    66
    mView->showWizard();
hgs
parents:
diff changeset
    67
    
hgs
parents:
diff changeset
    68
    verify_outertype(ButtonDisabled);
hgs
parents:
diff changeset
    69
    
hgs
parents:
diff changeset
    70
    mMainWindow->setOrientation(Qt::Horizontal, false);
hgs
parents:
diff changeset
    71
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
    72
hgs
parents:
diff changeset
    73
    verify_outertype(ButtonDisabled);
hgs
parents:
diff changeset
    74
    
hgs
parents:
diff changeset
    75
    mMainWindow->setOrientation(Qt::Vertical, false);
hgs
parents:
diff changeset
    76
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
    77
    
hgs
parents:
diff changeset
    78
    verify_outertype(ButtonDisabled);
hgs
parents:
diff changeset
    79
#endif
hgs
parents:
diff changeset
    80
}
hgs
parents:
diff changeset
    81
hgs
parents:
diff changeset
    82
void TestWlanWizardEap::tc_eap_aka()
hgs
parents:
diff changeset
    83
{
hgs
parents:
diff changeset
    84
#ifdef tc_eap_aka_enabled
hgs
parents:
diff changeset
    85
    tc_eap_aka_sim(EapQtPluginHandle::PluginEapAka);
hgs
parents:
diff changeset
    86
#endif
hgs
parents:
diff changeset
    87
}
hgs
parents:
diff changeset
    88
hgs
parents:
diff changeset
    89
void TestWlanWizardEap::tc_eap_sim()
hgs
parents:
diff changeset
    90
{
hgs
parents:
diff changeset
    91
#ifdef tc_eap_sim_enabled
hgs
parents:
diff changeset
    92
    tc_eap_aka_sim(EapQtPluginHandle::PluginEapSim);
hgs
parents:
diff changeset
    93
#endif
hgs
parents:
diff changeset
    94
}
hgs
parents:
diff changeset
    95
hgs
parents:
diff changeset
    96
void TestWlanWizardEap::tc_eap_leap()
hgs
parents:
diff changeset
    97
{
hgs
parents:
diff changeset
    98
#ifdef tc_eap_leap_enabled
hgs
parents:
diff changeset
    99
    const QString username("user");
hgs
parents:
diff changeset
   100
    const QString password("passwd");
hgs
parents:
diff changeset
   101
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
   102
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
   103
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(3);
hgs
parents:
diff changeset
   104
    mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
   105
    
hgs
parents:
diff changeset
   106
    mEapQtUtilsContext->setConfigurationReference(3, true);
hgs
parents:
diff changeset
   107
    mEapQtUtilsContext->createLeap(username,password);
hgs
parents:
diff changeset
   108
    
hgs
parents:
diff changeset
   109
    const QString ssid("tc_eap_leap");
hgs
parents:
diff changeset
   110
    
hgs
parents:
diff changeset
   111
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
   112
        ssid, 
hgs
parents:
diff changeset
   113
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   114
        CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
   115
        false, false, false);
hgs
parents:
diff changeset
   116
hgs
parents:
diff changeset
   117
    mView->showWizard();
hgs
parents:
diff changeset
   118
    
hgs
parents:
diff changeset
   119
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
   120
    verify_username_password_click_next(EapQtPluginHandle::PluginLeap, username, password);
hgs
parents:
diff changeset
   121
    
hgs
parents:
diff changeset
   122
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPage::PageProcessSettings,ssid), true );
hgs
parents:
diff changeset
   123
    QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   124
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   125
hgs
parents:
diff changeset
   126
    QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
hgs
parents:
diff changeset
   127
    QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true );
hgs
parents:
diff changeset
   128
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   129
    
hgs
parents:
diff changeset
   130
    QCOMPARE( verifySummaryPage(
hgs
parents:
diff changeset
   131
        ssid,
hgs
parents:
diff changeset
   132
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   133
        false, 
hgs
parents:
diff changeset
   134
        CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
   135
        false,
hgs
parents:
diff changeset
   136
        hbTrId("txt_occ_dblist_destination_val_internet"),
hgs
parents:
diff changeset
   137
        EapQtPluginHandle::PluginLeap),true);
hgs
parents:
diff changeset
   138
    
hgs
parents:
diff changeset
   139
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   140
#endif
hgs
parents:
diff changeset
   141
}
hgs
parents:
diff changeset
   142
hgs
parents:
diff changeset
   143
void TestWlanWizardEap::tc_eap_peap_gtc()
hgs
parents:
diff changeset
   144
{
hgs
parents:
diff changeset
   145
#ifdef tc_eap_peap_gtc_enabled
hgs
parents:
diff changeset
   146
    tc_eap_peap_ttls(
hgs
parents:
diff changeset
   147
        EapQtPluginHandle::PluginPeap, 
hgs
parents:
diff changeset
   148
        EapQtPluginHandle::PluginEapGtc);
hgs
parents:
diff changeset
   149
#endif
hgs
parents:
diff changeset
   150
}
hgs
parents:
diff changeset
   151
hgs
parents:
diff changeset
   152
void TestWlanWizardEap::tc_eap_peap_mschapv2()
hgs
parents:
diff changeset
   153
{
hgs
parents:
diff changeset
   154
#ifdef tc_eap_peap_mschapv2_enabled
hgs
parents:
diff changeset
   155
    tc_eap_peap_ttls(
hgs
parents:
diff changeset
   156
        EapQtPluginHandle::PluginPeap, 
hgs
parents:
diff changeset
   157
        EapQtPluginHandle::PluginEapMschapv2);
hgs
parents:
diff changeset
   158
#endif
hgs
parents:
diff changeset
   159
}
hgs
parents:
diff changeset
   160
hgs
parents:
diff changeset
   161
void TestWlanWizardEap::tc_eap_ttls_mschapv2()
hgs
parents:
diff changeset
   162
{
hgs
parents:
diff changeset
   163
#ifdef tc_eap_ttls_mschapv2_enabled
hgs
parents:
diff changeset
   164
    tc_eap_peap_ttls(
hgs
parents:
diff changeset
   165
        EapQtPluginHandle::PluginEapTtls, 
hgs
parents:
diff changeset
   166
        EapQtPluginHandle::PluginPlainMschapv2);
hgs
parents:
diff changeset
   167
#endif
hgs
parents:
diff changeset
   168
}
hgs
parents:
diff changeset
   169
hgs
parents:
diff changeset
   170
void TestWlanWizardEap::tc_eap_ttls_pap()
hgs
parents:
diff changeset
   171
{
hgs
parents:
diff changeset
   172
#ifdef tc_eap_ttls_pap_enabled
hgs
parents:
diff changeset
   173
    tc_eap_peap_ttls(
hgs
parents:
diff changeset
   174
        EapQtPluginHandle::PluginEapTtls, 
hgs
parents:
diff changeset
   175
        EapQtPluginHandle::PluginPap);
hgs
parents:
diff changeset
   176
#endif
hgs
parents:
diff changeset
   177
}
hgs
parents:
diff changeset
   178
hgs
parents:
diff changeset
   179
void TestWlanWizardEap::tc_eap_ttls_gtc()
hgs
parents:
diff changeset
   180
{
hgs
parents:
diff changeset
   181
#ifdef tc_eap_ttls_gtc_enabled
hgs
parents:
diff changeset
   182
    tc_eap_peap_ttls(
hgs
parents:
diff changeset
   183
        EapQtPluginHandle::PluginEapTtls, 
hgs
parents:
diff changeset
   184
        EapQtPluginHandle::PluginEapGtc);
hgs
parents:
diff changeset
   185
#endif
hgs
parents:
diff changeset
   186
}
hgs
parents:
diff changeset
   187
hgs
parents:
diff changeset
   188
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanUserRejected()
hgs
parents:
diff changeset
   189
{
hgs
parents:
diff changeset
   190
#ifdef tc_eap_aka_connect_KErrWlanUserRejected_enabled
hgs
parents:
diff changeset
   191
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   192
        KErrWlanUserRejected,
hgs
parents:
diff changeset
   193
        hbTrId("txt_occ_dialog_1_auth_failed_user_cert_rej").arg(
hgs
parents:
diff changeset
   194
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   195
#endif
hgs
parents:
diff changeset
   196
}
hgs
parents:
diff changeset
   197
hgs
parents:
diff changeset
   198
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanUserCertificateExpired()
hgs
parents:
diff changeset
   199
{
hgs
parents:
diff changeset
   200
#ifdef tc_eap_aka_connect_KErrWlanUserCertificateExpired_enabled
hgs
parents:
diff changeset
   201
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   202
        KErrWlanUserCertificateExpired,
hgs
parents:
diff changeset
   203
        hbTrId("txt_occ_dialog_1_auth_failed_user_cert_exp").arg(
hgs
parents:
diff changeset
   204
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   205
#endif
hgs
parents:
diff changeset
   206
}
hgs
parents:
diff changeset
   207
hgs
parents:
diff changeset
   208
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanServerCertificateExpired()
hgs
parents:
diff changeset
   209
{
hgs
parents:
diff changeset
   210
#ifdef tc_eap_aka_connect_KErrWlanServerCertificateExpired_enabled
hgs
parents:
diff changeset
   211
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   212
        KErrWlanServerCertificateExpired,
hgs
parents:
diff changeset
   213
        hbTrId("txt_occ_dialog_1_authentication_failed_server_ce").arg(
hgs
parents:
diff changeset
   214
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   215
#endif
hgs
parents:
diff changeset
   216
}
hgs
parents:
diff changeset
   217
hgs
parents:
diff changeset
   218
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanCerficateVerifyFailed()
hgs
parents:
diff changeset
   219
{
hgs
parents:
diff changeset
   220
#ifdef tc_eap_aka_connect_KErrWlanCerficateVerifyFailed_enabled
hgs
parents:
diff changeset
   221
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   222
        KErrWlanCerficateVerifyFailed,
hgs
parents:
diff changeset
   223
        hbTrId("txt_occ_dialog_1_authentication_failed_could_not").arg(
hgs
parents:
diff changeset
   224
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   225
#endif    
hgs
parents:
diff changeset
   226
}
hgs
parents:
diff changeset
   227
hgs
parents:
diff changeset
   228
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanNoCipherSuite()
hgs
parents:
diff changeset
   229
{
hgs
parents:
diff changeset
   230
#ifdef tc_eap_aka_connect_KErrWlanNoCipherSuite_enabled
hgs
parents:
diff changeset
   231
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   232
        KErrWlanNoCipherSuite,
hgs
parents:
diff changeset
   233
        hbTrId("txt_occ_dialog_1_authentication_failed_cipher_su").arg(
hgs
parents:
diff changeset
   234
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   235
#endif     
hgs
parents:
diff changeset
   236
}
hgs
parents:
diff changeset
   237
hgs
parents:
diff changeset
   238
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanSimNotInstalled()
hgs
parents:
diff changeset
   239
{
hgs
parents:
diff changeset
   240
#ifdef tc_eap_aka_connect_KErrWlanSimNotInstalled_enabled
hgs
parents:
diff changeset
   241
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   242
        KErrWlanSimNotInstalled,
hgs
parents:
diff changeset
   243
        hbTrId("txt_occ_dialog_1_authentication_failed_check_sim").arg(
hgs
parents:
diff changeset
   244
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   245
#endif      
hgs
parents:
diff changeset
   246
}
hgs
parents:
diff changeset
   247
hgs
parents:
diff changeset
   248
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanEapFastPacStoreCorrupted()
hgs
parents:
diff changeset
   249
{
hgs
parents:
diff changeset
   250
#ifdef tc_eap_aka_connect_KErrWlanEapFastPacStoreCorrupted_enabled
hgs
parents:
diff changeset
   251
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   252
        KErrWlanEapFastPacStoreCorrupted,
hgs
parents:
diff changeset
   253
        hbTrId("txt_occ_dialog_1_authentication_failed_reset_pac").arg(
hgs
parents:
diff changeset
   254
            eapTypeToString(EapQtPluginHandle::PluginEapFast)));
hgs
parents:
diff changeset
   255
#endif      
hgs
parents:
diff changeset
   256
}
hgs
parents:
diff changeset
   257
hgs
parents:
diff changeset
   258
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanEapSimFailed()
hgs
parents:
diff changeset
   259
{
hgs
parents:
diff changeset
   260
#ifdef tc_eap_aka_connect_KErrWlanEapSimFailed_enabled
hgs
parents:
diff changeset
   261
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   262
        KErrWlanEapSimFailed,
hgs
parents:
diff changeset
   263
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   264
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   265
#endif      
hgs
parents:
diff changeset
   266
}
hgs
parents:
diff changeset
   267
hgs
parents:
diff changeset
   268
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanNotSubscribed()
hgs
parents:
diff changeset
   269
{
hgs
parents:
diff changeset
   270
#ifdef tc_eap_aka_connect_KErrWlanNotSubscribed_enabled
hgs
parents:
diff changeset
   271
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   272
        KErrWlanNotSubscribed,
hgs
parents:
diff changeset
   273
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   274
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   275
#endif      
hgs
parents:
diff changeset
   276
}
hgs
parents:
diff changeset
   277
hgs
parents:
diff changeset
   278
void TestWlanWizardEap::tc_eap_aka_connect_KErrCancel()
hgs
parents:
diff changeset
   279
{
hgs
parents:
diff changeset
   280
#ifdef tc_eap_aka_connect_KErrCancel_enabled
hgs
parents:
diff changeset
   281
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   282
        KErrCancel,
hgs
parents:
diff changeset
   283
        hbTrId("txt_occ_dialog_connection_failed"));
hgs
parents:
diff changeset
   284
#endif       
hgs
parents:
diff changeset
   285
}
hgs
parents:
diff changeset
   286
hgs
parents:
diff changeset
   287
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanEapTlsFailed()
hgs
parents:
diff changeset
   288
{
hgs
parents:
diff changeset
   289
#ifdef tc_eap_aka_connect_KErrWlanEapTlsFailed_enabled
hgs
parents:
diff changeset
   290
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   291
        KErrWlanEapTlsFailed,
hgs
parents:
diff changeset
   292
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   293
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   294
#endif
hgs
parents:
diff changeset
   295
}
hgs
parents:
diff changeset
   296
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanEapPeapFailed()
hgs
parents:
diff changeset
   297
{
hgs
parents:
diff changeset
   298
#ifdef tc_eap_aka_connect_KErrWlanEapPeapFailed_enabled
hgs
parents:
diff changeset
   299
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   300
        KErrWlanEapPeapFailed,
hgs
parents:
diff changeset
   301
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   302
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));    
hgs
parents:
diff changeset
   303
#endif
hgs
parents:
diff changeset
   304
}
hgs
parents:
diff changeset
   305
hgs
parents:
diff changeset
   306
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanEapAkaFailed()
hgs
parents:
diff changeset
   307
{
hgs
parents:
diff changeset
   308
#ifdef tc_eap_aka_connect_KErrWlanEapAkaFailed_enabled
hgs
parents:
diff changeset
   309
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   310
        KErrWlanEapAkaFailed,
hgs
parents:
diff changeset
   311
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   312
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   313
#endif
hgs
parents:
diff changeset
   314
}
hgs
parents:
diff changeset
   315
hgs
parents:
diff changeset
   316
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanEapTtlsFailed()
hgs
parents:
diff changeset
   317
{
hgs
parents:
diff changeset
   318
#ifdef tc_eap_aka_connect_KErrWlanEapTtlsFailed_enabled
hgs
parents:
diff changeset
   319
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   320
        KErrWlanEapTtlsFailed,
hgs
parents:
diff changeset
   321
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   322
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   323
#endif
hgs
parents:
diff changeset
   324
}
hgs
parents:
diff changeset
   325
hgs
parents:
diff changeset
   326
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanLeapFailed()
hgs
parents:
diff changeset
   327
{
hgs
parents:
diff changeset
   328
#ifdef tc_eap_aka_connect_KErrWlanLeapFailed_enabled
hgs
parents:
diff changeset
   329
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   330
        KErrWlanLeapFailed,
hgs
parents:
diff changeset
   331
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   332
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   333
#endif
hgs
parents:
diff changeset
   334
}
hgs
parents:
diff changeset
   335
hgs
parents:
diff changeset
   336
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanNoUserCertificate()
hgs
parents:
diff changeset
   337
{
hgs
parents:
diff changeset
   338
#ifdef tc_eap_aka_connect_KErrWlanNoUserCertificate_enabled 
hgs
parents:
diff changeset
   339
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   340
        KErrWlanNoUserCertificate,
hgs
parents:
diff changeset
   341
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   342
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   343
#endif
hgs
parents:
diff changeset
   344
}
hgs
parents:
diff changeset
   345
hgs
parents:
diff changeset
   346
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanEapFastTunnelCompromiseError()
hgs
parents:
diff changeset
   347
{
hgs
parents:
diff changeset
   348
#ifdef tc_eap_aka_connect_KErrWlanEapFastTunnelCompromiseError_enabled
hgs
parents:
diff changeset
   349
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   350
        KErrWlanEapFastTunnelCompromiseError,
hgs
parents:
diff changeset
   351
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   352
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));    
hgs
parents:
diff changeset
   353
#endif
hgs
parents:
diff changeset
   354
}
hgs
parents:
diff changeset
   355
hgs
parents:
diff changeset
   356
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanEapFastUnexpextedTlvExhanged()
hgs
parents:
diff changeset
   357
{
hgs
parents:
diff changeset
   358
#ifdef tc_eap_aka_connect_KErrWlanEapFastUnexpextedTlvExhanged_enabled
hgs
parents:
diff changeset
   359
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   360
        KErrWlanEapFastUnexpextedTlvExhanged,
hgs
parents:
diff changeset
   361
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   362
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));    
hgs
parents:
diff changeset
   363
#endif
hgs
parents:
diff changeset
   364
}
hgs
parents:
diff changeset
   365
hgs
parents:
diff changeset
   366
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanEapFastNoPacNorCertsToAuthenticateWithProvDisabled()
hgs
parents:
diff changeset
   367
{
hgs
parents:
diff changeset
   368
#ifdef tc_eap_aka_connect_KErrWlanEapFastNoPacNorCertsToAuthenticateWithProvDisabled_enabled
hgs
parents:
diff changeset
   369
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   370
        KErrWlanEapFastNoPacNorCertsToAuthenticateWithProvDisabled,
hgs
parents:
diff changeset
   371
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   372
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   373
#endif
hgs
parents:
diff changeset
   374
}
hgs
parents:
diff changeset
   375
hgs
parents:
diff changeset
   376
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanEapFastNoMatchingPacForAid()
hgs
parents:
diff changeset
   377
{
hgs
parents:
diff changeset
   378
#ifdef tc_eap_aka_connect_KErrWlanEapFastNoMatchingPacForAid_enabled
hgs
parents:
diff changeset
   379
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   380
        KErrWlanEapFastNoMatchingPacForAid,
hgs
parents:
diff changeset
   381
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   382
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   383
#endif
hgs
parents:
diff changeset
   384
}
hgs
parents:
diff changeset
   385
hgs
parents:
diff changeset
   386
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanEapFastAuthFailed()
hgs
parents:
diff changeset
   387
{
hgs
parents:
diff changeset
   388
#ifdef tc_eap_aka_connect_KErrWlanEapFastAuthFailed_enabled
hgs
parents:
diff changeset
   389
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   390
        KErrWlanEapFastAuthFailed,
hgs
parents:
diff changeset
   391
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   392
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));    
hgs
parents:
diff changeset
   393
#endif
hgs
parents:
diff changeset
   394
}
hgs
parents:
diff changeset
   395
hgs
parents:
diff changeset
   396
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanAccessBarred()
hgs
parents:
diff changeset
   397
{
hgs
parents:
diff changeset
   398
#ifdef tc_eap_aka_connect_KErrWlanAccessBarred_enabled
hgs
parents:
diff changeset
   399
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   400
        KErrWlanAccessBarred,
hgs
parents:
diff changeset
   401
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   402
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));    
hgs
parents:
diff changeset
   403
#endif
hgs
parents:
diff changeset
   404
}
hgs
parents:
diff changeset
   405
hgs
parents:
diff changeset
   406
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanPasswordExpired()
hgs
parents:
diff changeset
   407
{
hgs
parents:
diff changeset
   408
#ifdef tc_eap_aka_connect_KErrWlanPasswordExpired_enabled
hgs
parents:
diff changeset
   409
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   410
        KErrWlanPasswordExpired,
hgs
parents:
diff changeset
   411
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   412
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));    
hgs
parents:
diff changeset
   413
#endif
hgs
parents:
diff changeset
   414
}
hgs
parents:
diff changeset
   415
hgs
parents:
diff changeset
   416
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanNoDialinPermissions()
hgs
parents:
diff changeset
   417
{
hgs
parents:
diff changeset
   418
#ifdef tc_eap_aka_connect_KErrWlanNoDialinPermissions_enabled
hgs
parents:
diff changeset
   419
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   420
        KErrWlanNoDialinPermissions,
hgs
parents:
diff changeset
   421
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   422
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));    
hgs
parents:
diff changeset
   423
#endif
hgs
parents:
diff changeset
   424
}
hgs
parents:
diff changeset
   425
hgs
parents:
diff changeset
   426
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanAccountDisabled()
hgs
parents:
diff changeset
   427
{
hgs
parents:
diff changeset
   428
#ifdef tc_eap_aka_connect_KErrWlanAccountDisabled_enabled
hgs
parents:
diff changeset
   429
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   430
        KErrWlanAccountDisabled,
hgs
parents:
diff changeset
   431
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   432
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));
hgs
parents:
diff changeset
   433
#endif
hgs
parents:
diff changeset
   434
}
hgs
parents:
diff changeset
   435
hgs
parents:
diff changeset
   436
void TestWlanWizardEap::tc_eap_aka_connect_KErrWlanRestrictedLogonHours()
hgs
parents:
diff changeset
   437
{
hgs
parents:
diff changeset
   438
#ifdef tc_eap_aka_connect_KErrWlanRestrictedLogonHours_enabled
hgs
parents:
diff changeset
   439
    tc_eap_aka_connect_error(
hgs
parents:
diff changeset
   440
        KErrWlanRestrictedLogonHours,
hgs
parents:
diff changeset
   441
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   442
            eapTypeToString(EapQtPluginHandle::PluginEapAka)));    
hgs
parents:
diff changeset
   443
#endif
hgs
parents:
diff changeset
   444
}
hgs
parents:
diff changeset
   445
hgs
parents:
diff changeset
   446
void TestWlanWizardEap::tc_eap_ttls_mschapv2_connect_KErrWlanEapGtcFailed()
hgs
parents:
diff changeset
   447
{
hgs
parents:
diff changeset
   448
#ifdef tc_eap_ttls_mschapv2_connect_KErrWlanEapGtcFailed_enabled
hgs
parents:
diff changeset
   449
    tc_eap_peap_ttls(
hgs
parents:
diff changeset
   450
        EapQtPluginHandle::PluginEapTtls, 
hgs
parents:
diff changeset
   451
        EapQtPluginHandle::PluginPlainMschapv2,
hgs
parents:
diff changeset
   452
        KErrWlanEapGtcFailed,
hgs
parents:
diff changeset
   453
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   454
            eapTypeToString(EapQtPluginHandle::PluginPlainMschapv2)));
hgs
parents:
diff changeset
   455
#endif
hgs
parents:
diff changeset
   456
}
hgs
parents:
diff changeset
   457
hgs
parents:
diff changeset
   458
void TestWlanWizardEap::tc_eap_ttls_mschapv2_connect_KErrWlanEapMsChapv2()
hgs
parents:
diff changeset
   459
{
hgs
parents:
diff changeset
   460
#ifdef tc_eap_ttls_mschapv2_connect_KErrWlanEapMsChapv2_enabled
hgs
parents:
diff changeset
   461
    tc_eap_peap_ttls(
hgs
parents:
diff changeset
   462
        EapQtPluginHandle::PluginEapTtls, 
hgs
parents:
diff changeset
   463
        EapQtPluginHandle::PluginPlainMschapv2,
hgs
parents:
diff changeset
   464
        KErrWlanEapMsChapv2,
hgs
parents:
diff changeset
   465
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   466
            eapTypeToString(EapQtPluginHandle::PluginPlainMschapv2)));
hgs
parents:
diff changeset
   467
#endif
hgs
parents:
diff changeset
   468
}
hgs
parents:
diff changeset
   469
hgs
parents:
diff changeset
   470
void TestWlanWizardEap::tc_eap_ttls_mschapv2_connect_KErrWlanNotSubscribed()
hgs
parents:
diff changeset
   471
{
hgs
parents:
diff changeset
   472
#ifdef tc_eap_ttls_mschapv2_connect_KErrWlanNotSubscribed_enabled
hgs
parents:
diff changeset
   473
    tc_eap_peap_ttls(
hgs
parents:
diff changeset
   474
        EapQtPluginHandle::PluginEapTtls, 
hgs
parents:
diff changeset
   475
        EapQtPluginHandle::PluginPlainMschapv2,
hgs
parents:
diff changeset
   476
        KErrWlanNotSubscribed,
hgs
parents:
diff changeset
   477
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   478
            eapTypeToString(EapQtPluginHandle::PluginPlainMschapv2)));
hgs
parents:
diff changeset
   479
#endif
hgs
parents:
diff changeset
   480
}
hgs
parents:
diff changeset
   481
hgs
parents:
diff changeset
   482
void TestWlanWizardEap::tc_eap_ttls_gtc_back_and_forward()
hgs
parents:
diff changeset
   483
{
hgs
parents:
diff changeset
   484
#ifdef tc_eap_ttls_gtc_back_and_forward_enabled
hgs
parents:
diff changeset
   485
    tc_eap_peap_ttls(
hgs
parents:
diff changeset
   486
        EapQtPluginHandle::PluginEapTtls, 
hgs
parents:
diff changeset
   487
        EapQtPluginHandle::PluginEapGtc,
hgs
parents:
diff changeset
   488
        KErrWlanNotSubscribed,
hgs
parents:
diff changeset
   489
        hbTrId("txt_occ_dialog_1_authentication_failed").arg(
hgs
parents:
diff changeset
   490
            eapTypeToString(EapQtPluginHandle::PluginEapGtc)));
hgs
parents:
diff changeset
   491
    
hgs
parents:
diff changeset
   492
    // Go back to outertype selection page
hgs
parents:
diff changeset
   493
    QCOMPARE(mouseClickPrevious(), true);
hgs
parents:
diff changeset
   494
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   495
    verify_username_password(EapQtPluginHandle::PluginEapGtc);
hgs
parents:
diff changeset
   496
hgs
parents:
diff changeset
   497
    QCOMPARE(mouseClickPrevious(), true);
hgs
parents:
diff changeset
   498
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   499
    verify_innertype(
hgs
parents:
diff changeset
   500
        EapQtPluginHandle::PluginEapTtls,
hgs
parents:
diff changeset
   501
        ButtonEnabled);
hgs
parents:
diff changeset
   502
hgs
parents:
diff changeset
   503
    QCOMPARE(mouseClickPrevious(), true);
hgs
parents:
diff changeset
   504
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   505
    verify_identity_page(eapTypeToString(EapQtPluginHandle::PluginEapTtls));
hgs
parents:
diff changeset
   506
    
hgs
parents:
diff changeset
   507
    QCOMPARE(mouseClickPrevious(), true);
hgs
parents:
diff changeset
   508
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   509
    verify_ca_cert_page();
hgs
parents:
diff changeset
   510
    
hgs
parents:
diff changeset
   511
    QCOMPARE(mouseClickPrevious(), true);
hgs
parents:
diff changeset
   512
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   513
    verify_outertype(ButtonEnabled);
hgs
parents:
diff changeset
   514
    
hgs
parents:
diff changeset
   515
    // Go forward to username & password page
hgs
parents:
diff changeset
   516
    QCOMPARE(mouseClickNext(), true);
hgs
parents:
diff changeset
   517
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   518
    verify_ca_cert_page();
hgs
parents:
diff changeset
   519
    
hgs
parents:
diff changeset
   520
    // Create new validators
hgs
parents:
diff changeset
   521
    mEapQtUtilsContext->createEapIdentifyValidators(EapQtPluginHandle::PluginEapTtls);
hgs
parents:
diff changeset
   522
    mEapQtUtilsContext->createInnerTypeValidators(EapQtPluginHandle::PluginEapGtc);
hgs
parents:
diff changeset
   523
    
hgs
parents:
diff changeset
   524
    QCOMPARE(mouseClickNext(), true);
hgs
parents:
diff changeset
   525
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   526
    verify_identity_page(eapTypeToString(EapQtPluginHandle::PluginEapTtls));
hgs
parents:
diff changeset
   527
    
hgs
parents:
diff changeset
   528
    QCOMPARE(mouseClickNext(), true);
hgs
parents:
diff changeset
   529
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   530
    verify_innertype(
hgs
parents:
diff changeset
   531
        EapQtPluginHandle::PluginEapTtls,
hgs
parents:
diff changeset
   532
        ButtonEnabled);
hgs
parents:
diff changeset
   533
    
hgs
parents:
diff changeset
   534
    QCOMPARE(mouseClickNext(), true);
hgs
parents:
diff changeset
   535
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   536
    verify_username_password(EapQtPluginHandle::PluginEapGtc);
hgs
parents:
diff changeset
   537
#endif
hgs
parents:
diff changeset
   538
}
hgs
parents:
diff changeset
   539
hgs
parents:
diff changeset
   540
void TestWlanWizardEap::tc_eap_aka_set_outer_type_fails()
hgs
parents:
diff changeset
   541
{
hgs
parents:
diff changeset
   542
#ifdef tc_eap_aka_set_outer_type_fails_enabled
hgs
parents:
diff changeset
   543
    const QString ssid("tc_eap_aka_set_outer_type_fails");
hgs
parents:
diff changeset
   544
    
hgs
parents:
diff changeset
   545
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
   546
    mWlanQtUtilsContext->setConnectionSuccessed(false);
hgs
parents:
diff changeset
   547
    mWlanQtUtilsContext->setSignalWlanNetworkClosed(3, KErrCancel);
hgs
parents:
diff changeset
   548
    
hgs
parents:
diff changeset
   549
    mEapQtUtilsContext->setConfigurationReference(3, true);
hgs
parents:
diff changeset
   550
    mEapQtUtilsContext->createEapAkaSim(EapQtPluginHandle::PluginEapAka);
hgs
parents:
diff changeset
   551
    mEapQtUtilsContext->setSelectectedOuterTypesReturn(false);
hgs
parents:
diff changeset
   552
    
hgs
parents:
diff changeset
   553
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
   554
        ssid, 
hgs
parents:
diff changeset
   555
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   556
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
   557
        false, false, false);
hgs
parents:
diff changeset
   558
hgs
parents:
diff changeset
   559
    mView->showWizard();
hgs
parents:
diff changeset
   560
    
hgs
parents:
diff changeset
   561
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
   562
    
hgs
parents:
diff changeset
   563
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, ssid), true );
hgs
parents:
diff changeset
   564
    QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   565
    QCOMPARE( 
hgs
parents:
diff changeset
   566
        verifyCurrentPageWithInfo(
hgs
parents:
diff changeset
   567
            WlanWizardPageInternal::PageGenericError, 
hgs
parents:
diff changeset
   568
            hbTrId("txt_occ_dialog_unable_to_save_settings_please_ret")), true );
hgs
parents:
diff changeset
   569
    
hgs
parents:
diff changeset
   570
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   571
#endif
hgs
parents:
diff changeset
   572
}
hgs
parents:
diff changeset
   573
hgs
parents:
diff changeset
   574
void TestWlanWizardEap::tc_eap_aka_save_outer_configuration_fails()
hgs
parents:
diff changeset
   575
{
hgs
parents:
diff changeset
   576
#ifdef tc_eap_aka_save_outer_configuration_fails_enabled
hgs
parents:
diff changeset
   577
    const QString ssid("tc_eap_aka_save_outer_configuration_fails");
hgs
parents:
diff changeset
   578
    
hgs
parents:
diff changeset
   579
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
   580
    mWlanQtUtilsContext->setConnectionSuccessed(false);
hgs
parents:
diff changeset
   581
    mWlanQtUtilsContext->setSignalWlanNetworkClosed(3, KErrCancel);
hgs
parents:
diff changeset
   582
    
hgs
parents:
diff changeset
   583
    mEapQtUtilsContext->setConfigurationReference(3, true);
hgs
parents:
diff changeset
   584
    mEapQtUtilsContext->createEapAkaSim(EapQtPluginHandle::PluginEapAka);
hgs
parents:
diff changeset
   585
    mEapQtUtilsContext->setOuterConfigReturn(false);
hgs
parents:
diff changeset
   586
    
hgs
parents:
diff changeset
   587
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
   588
        ssid, 
hgs
parents:
diff changeset
   589
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   590
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
   591
        false, false, false);
hgs
parents:
diff changeset
   592
hgs
parents:
diff changeset
   593
    mView->showWizard();
hgs
parents:
diff changeset
   594
    
hgs
parents:
diff changeset
   595
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
   596
    
hgs
parents:
diff changeset
   597
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, ssid), true );
hgs
parents:
diff changeset
   598
    QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   599
    QCOMPARE( 
hgs
parents:
diff changeset
   600
        verifyCurrentPageWithInfo(
hgs
parents:
diff changeset
   601
            WlanWizardPageInternal::PageGenericError, 
hgs
parents:
diff changeset
   602
            hbTrId("txt_occ_dialog_unable_to_save_settings_please_ret")), true );
hgs
parents:
diff changeset
   603
    
hgs
parents:
diff changeset
   604
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   605
#endif
hgs
parents:
diff changeset
   606
}
hgs
parents:
diff changeset
   607
hgs
parents:
diff changeset
   608
void TestWlanWizardEap::tc_eap_aka_set_configuration_reference_fails()
hgs
parents:
diff changeset
   609
{
hgs
parents:
diff changeset
   610
#ifdef tc_eap_aka_set_configuration_reference_fails_enabled
hgs
parents:
diff changeset
   611
    const QString ssid("tc_eap_aka_set_configuration_reference_fails");
hgs
parents:
diff changeset
   612
    
hgs
parents:
diff changeset
   613
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
   614
    mWlanQtUtilsContext->setConnectionSuccessed(false);
hgs
parents:
diff changeset
   615
    mWlanQtUtilsContext->setSignalWlanNetworkClosed(3, KErrCancel);
hgs
parents:
diff changeset
   616
    
hgs
parents:
diff changeset
   617
    mEapQtUtilsContext->setConfigurationReference(3, false);
hgs
parents:
diff changeset
   618
    mEapQtUtilsContext->createEapAkaSim(EapQtPluginHandle::PluginEapAka);
hgs
parents:
diff changeset
   619
    
hgs
parents:
diff changeset
   620
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
   621
        ssid, 
hgs
parents:
diff changeset
   622
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   623
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
   624
        false, false, false);
hgs
parents:
diff changeset
   625
hgs
parents:
diff changeset
   626
    mView->showWizard();
hgs
parents:
diff changeset
   627
    
hgs
parents:
diff changeset
   628
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
   629
    
hgs
parents:
diff changeset
   630
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, ssid), true );
hgs
parents:
diff changeset
   631
    QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   632
    QCOMPARE( 
hgs
parents:
diff changeset
   633
        verifyCurrentPageWithInfo(
hgs
parents:
diff changeset
   634
            WlanWizardPageInternal::PageGenericError, 
hgs
parents:
diff changeset
   635
            hbTrId("txt_occ_dialog_unable_to_save_settings_please_ret")), true );
hgs
parents:
diff changeset
   636
    
hgs
parents:
diff changeset
   637
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   638
#endif
hgs
parents:
diff changeset
   639
}
hgs
parents:
diff changeset
   640
hgs
parents:
diff changeset
   641
void TestWlanWizardEap::tc_eap_peap_gtc_save_inner_configuration_fails()
hgs
parents:
diff changeset
   642
{
hgs
parents:
diff changeset
   643
#ifdef tc_eap_peap_gtc_save_inner_configuration_fails_enabled
hgs
parents:
diff changeset
   644
    tc_eap_peap_ttls(
hgs
parents:
diff changeset
   645
        EapQtPluginHandle::PluginEapTtls, 
hgs
parents:
diff changeset
   646
        EapQtPluginHandle::PluginEapGtc,
hgs
parents:
diff changeset
   647
        KErrGeneral, // Not used directly in sub test case
hgs
parents:
diff changeset
   648
        hbTrId("txt_occ_dialog_unable_to_save_settings_please_ret"),
hgs
parents:
diff changeset
   649
        false );
hgs
parents:
diff changeset
   650
#endif
hgs
parents:
diff changeset
   651
}
hgs
parents:
diff changeset
   652
hgs
parents:
diff changeset
   653
hgs
parents:
diff changeset
   654
void TestWlanWizardEap::tc_eap_peap_identity_validators()
hgs
parents:
diff changeset
   655
{
hgs
parents:
diff changeset
   656
#ifdef tc_eap_peap_identity_validators_enabled
hgs
parents:
diff changeset
   657
    const QString ssid("tc_eap_peap_identity_validators");
hgs
parents:
diff changeset
   658
    const QString username("u");
hgs
parents:
diff changeset
   659
    const QString password("p");
hgs
parents:
diff changeset
   660
    const QString usernameIdentity("identity");
hgs
parents:
diff changeset
   661
    const QString realm("realm.com");
hgs
parents:
diff changeset
   662
    EapQtPluginHandle::Plugin outerType(EapQtPluginHandle::PluginPeap);
hgs
parents:
diff changeset
   663
    EapQtPluginHandle::Plugin innerType(EapQtPluginHandle::PluginEapGtc);
hgs
parents:
diff changeset
   664
    
hgs
parents:
diff changeset
   665
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
   666
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
   667
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(3);
hgs
parents:
diff changeset
   668
    mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
   669
hgs
parents:
diff changeset
   670
    mEapQtUtilsContext->setConfigurationReference(3, true);
hgs
parents:
diff changeset
   671
    mEapQtUtilsContext->createEapTtlsPeap(
hgs
parents:
diff changeset
   672
        outerType,
hgs
parents:
diff changeset
   673
        true,
hgs
parents:
diff changeset
   674
        true,
hgs
parents:
diff changeset
   675
        usernameIdentity,
hgs
parents:
diff changeset
   676
        true,
hgs
parents:
diff changeset
   677
        realm,
hgs
parents:
diff changeset
   678
        innerType );
hgs
parents:
diff changeset
   679
hgs
parents:
diff changeset
   680
    EapQtValidatorStub* validatorUser = (EapQtValidatorStub*)mEapQtUtilsContext->validator(
hgs
parents:
diff changeset
   681
        EapQtExpandedEapType::TypePeap, EapQtConfig::Username);
hgs
parents:
diff changeset
   682
    EapQtValidatorStub* validatorRealm = (EapQtValidatorStub*)mEapQtUtilsContext->validator(
hgs
parents:
diff changeset
   683
        EapQtExpandedEapType::TypePeap,EapQtConfig::Realm);
hgs
parents:
diff changeset
   684
    
hgs
parents:
diff changeset
   685
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
   686
        ssid, 
hgs
parents:
diff changeset
   687
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   688
        CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
   689
        false, false, false);
hgs
parents:
diff changeset
   690
hgs
parents:
diff changeset
   691
    mView->showWizard();
hgs
parents:
diff changeset
   692
    
hgs
parents:
diff changeset
   693
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
   694
    verify_ca_cert_page_select_and_click_next(true);
hgs
parents:
diff changeset
   695
    
hgs
parents:
diff changeset
   696
    QCOMPARE( verifyCurrentPageWithInfo(EapWizardPage::PageIdentity, eapTypeToString(outerType)), true );
hgs
parents:
diff changeset
   697
    // Check box checked next enabled
hgs
parents:
diff changeset
   698
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
   699
    QCOMPARE(verifyCheckBoxState("setlabel_53_val", true), true);
hgs
parents:
diff changeset
   700
    QCOMPARE(verifyCheckBoxState("setlabel_54_val", true), true);
hgs
parents:
diff changeset
   701
hgs
parents:
diff changeset
   702
    // 1. Username validator returns false, checkbox not checked
hgs
parents:
diff changeset
   703
    validatorUser->setReturnValue(EapQtValidator::StatusInvalid);
hgs
parents:
diff changeset
   704
    validatorRealm->setReturnValue(EapQtValidator::StatusOk);
hgs
parents:
diff changeset
   705
    
hgs
parents:
diff changeset
   706
    QCOMPARE(selectCheckBoxState("setlabel_53_val", false), true);
hgs
parents:
diff changeset
   707
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   708
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   709
  
hgs
parents:
diff changeset
   710
    // 2. Username validator returns true, checkbox not checked
hgs
parents:
diff changeset
   711
    validatorUser->setReturnValue(EapQtValidator::StatusOk);
hgs
parents:
diff changeset
   712
    validatorRealm->setReturnValue(EapQtValidator::StatusOk);
hgs
parents:
diff changeset
   713
    QCOMPARE( mouseClickObject("lineEditUsername"), true );
hgs
parents:
diff changeset
   714
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   715
    QCOMPARE( insertTextToObject("lineEditUsername", username), true );
hgs
parents:
diff changeset
   716
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   717
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );    
hgs
parents:
diff changeset
   718
hgs
parents:
diff changeset
   719
    // 3. back to valid state, checkboc checked
hgs
parents:
diff changeset
   720
    QCOMPARE(selectCheckBoxState("setlabel_53_val", true), true);
hgs
parents:
diff changeset
   721
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   722
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
   723
hgs
parents:
diff changeset
   724
    // 4. Realm validator returns false, checkbox not checked
hgs
parents:
diff changeset
   725
    validatorUser->setReturnValue(EapQtValidator::StatusOk);
hgs
parents:
diff changeset
   726
    validatorRealm->setReturnValue(EapQtValidator::StatusInvalid);
hgs
parents:
diff changeset
   727
hgs
parents:
diff changeset
   728
    QCOMPARE(selectCheckBoxState("setlabel_54_val", false), true);
hgs
parents:
diff changeset
   729
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   730
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   731
    
hgs
parents:
diff changeset
   732
    // 5. Realm validator returns true, checkbox not checked
hgs
parents:
diff changeset
   733
    validatorUser->setReturnValue(EapQtValidator::StatusOk);
hgs
parents:
diff changeset
   734
    validatorRealm->setReturnValue(EapQtValidator::StatusOk);
hgs
parents:
diff changeset
   735
    QCOMPARE( mouseClickObject("lineEditRealm"), true );
hgs
parents:
diff changeset
   736
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   737
    QCOMPARE( insertTextToObject("lineEditRealm", username), true );
hgs
parents:
diff changeset
   738
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   739
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );    
hgs
parents:
diff changeset
   740
hgs
parents:
diff changeset
   741
    // 6. back to valid state, checkboc checked
hgs
parents:
diff changeset
   742
    QCOMPARE(selectCheckBoxState("setlabel_54_val", true), true);
hgs
parents:
diff changeset
   743
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   744
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
   745
#endif
hgs
parents:
diff changeset
   746
}
hgs
parents:
diff changeset
   747
hgs
parents:
diff changeset
   748
void TestWlanWizardEap::tc_eap_leap_user_password_validators()
hgs
parents:
diff changeset
   749
{
hgs
parents:
diff changeset
   750
#ifdef tc_eap_leap_user_password_validators_enabled
hgs
parents:
diff changeset
   751
    const QString ssid("tc_eap_leap_user_password_validators");
hgs
parents:
diff changeset
   752
    const QString username("u");
hgs
parents:
diff changeset
   753
    const QString password("p");
hgs
parents:
diff changeset
   754
    
hgs
parents:
diff changeset
   755
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
   756
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
   757
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(3);
hgs
parents:
diff changeset
   758
    mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
   759
    
hgs
parents:
diff changeset
   760
    mEapQtUtilsContext->setConfigurationReference(3, true);
hgs
parents:
diff changeset
   761
    mEapQtUtilsContext->createLeap(username,password);
hgs
parents:
diff changeset
   762
    
hgs
parents:
diff changeset
   763
    EapQtValidatorStub* validatorUser = (EapQtValidatorStub*)mEapQtUtilsContext->validator(
hgs
parents:
diff changeset
   764
        EapQtExpandedEapType::TypeLeap, EapQtConfig::Username);
hgs
parents:
diff changeset
   765
    EapQtValidatorStub* validatorPassword = (EapQtValidatorStub*)mEapQtUtilsContext->validator(
hgs
parents:
diff changeset
   766
        EapQtExpandedEapType::TypeLeap, EapQtConfig::Password);
hgs
parents:
diff changeset
   767
    validatorUser->setReturnValue(EapQtValidator::StatusInvalid);
hgs
parents:
diff changeset
   768
    validatorPassword->setReturnValue(EapQtValidator::StatusInvalid);
hgs
parents:
diff changeset
   769
hgs
parents:
diff changeset
   770
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
   771
        ssid, 
hgs
parents:
diff changeset
   772
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   773
        CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
   774
        false, false, false);
hgs
parents:
diff changeset
   775
hgs
parents:
diff changeset
   776
    mView->showWizard();
hgs
parents:
diff changeset
   777
    
hgs
parents:
diff changeset
   778
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
   779
hgs
parents:
diff changeset
   780
    // 1. By default both validator return invalid
hgs
parents:
diff changeset
   781
    QCOMPARE( 
hgs
parents:
diff changeset
   782
        verifyCurrentPageWithInfo(
hgs
parents:
diff changeset
   783
            EapWizardPage::PageUsernamePassword, 
hgs
parents:
diff changeset
   784
            eapTypeToString(EapQtPluginHandle::PluginLeap)), true );
hgs
parents:
diff changeset
   785
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   786
    
hgs
parents:
diff changeset
   787
    // 2. User return ok, password invalid 
hgs
parents:
diff changeset
   788
    validatorUser->setReturnValue(EapQtValidator::StatusOk);
hgs
parents:
diff changeset
   789
    QCOMPARE( mouseClickObject("lineEditUsername"), true );
hgs
parents:
diff changeset
   790
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   791
    QCOMPARE( insertTextToObject("lineEditUsername", username), true );
hgs
parents:
diff changeset
   792
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   793
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   794
    
hgs
parents:
diff changeset
   795
    // 3. User return ok, password ok
hgs
parents:
diff changeset
   796
    validatorPassword->setReturnValue(EapQtValidator::StatusOk);
hgs
parents:
diff changeset
   797
    QCOMPARE( mouseClickObject("lineEditPassword"), true );
hgs
parents:
diff changeset
   798
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   799
    QCOMPARE( insertTextToObject("lineEditPassword", password), true );
hgs
parents:
diff changeset
   800
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
   801
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
   802
#endif
hgs
parents:
diff changeset
   803
}
hgs
parents:
diff changeset
   804
hgs
parents:
diff changeset
   805
void TestWlanWizardEap::tc_eap_tls_no_user_certificate()
hgs
parents:
diff changeset
   806
{
hgs
parents:
diff changeset
   807
#ifdef tc_eap_tls_no_user_certificate_enabled
hgs
parents:
diff changeset
   808
    
hgs
parents:
diff changeset
   809
    const QString ssid("tc_eap_tls_no_user_certificate");
hgs
parents:
diff changeset
   810
    
hgs
parents:
diff changeset
   811
    QList<EapQtCertificateInfo> caCerts;
hgs
parents:
diff changeset
   812
    QList<EapQtCertificateInfo> userCerts;
hgs
parents:
diff changeset
   813
    
hgs
parents:
diff changeset
   814
    EapQtCertificateInfo caCert;
hgs
parents:
diff changeset
   815
    caCert.setValue(EapQtCertificateInfo::CertificateLabel, "My Super Cert 1");
hgs
parents:
diff changeset
   816
    caCerts.append(caCert);
hgs
parents:
diff changeset
   817
    
hgs
parents:
diff changeset
   818
    mEapQtUtilsContext->createEapTls(
hgs
parents:
diff changeset
   819
        caCerts,
hgs
parents:
diff changeset
   820
        0,
hgs
parents:
diff changeset
   821
        userCerts,
hgs
parents:
diff changeset
   822
        -1);
hgs
parents:
diff changeset
   823
    
hgs
parents:
diff changeset
   824
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
   825
        ssid, 
hgs
parents:
diff changeset
   826
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   827
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
   828
        false, false, false);
hgs
parents:
diff changeset
   829
hgs
parents:
diff changeset
   830
    mView->showWizard();
hgs
parents:
diff changeset
   831
    
hgs
parents:
diff changeset
   832
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
   833
    verify_ca_cert_page_select_and_click_next(false);
hgs
parents:
diff changeset
   834
    verify_user_cert_page_select_and_click_next(ButtonDisabled, -1);
hgs
parents:
diff changeset
   835
hgs
parents:
diff changeset
   836
#endif
hgs
parents:
diff changeset
   837
}
hgs
parents:
diff changeset
   838
hgs
parents:
diff changeset
   839
void TestWlanWizardEap::tc_eap_tls_one_user_certificate_with_ca_selection()
hgs
parents:
diff changeset
   840
{
hgs
parents:
diff changeset
   841
#ifdef tc_eap_tls_one_user_certificate_with_ca_selection_enabled
hgs
parents:
diff changeset
   842
    const QString ssid("tc_eap_tls_one_user_certificate_with_ca_selection");
hgs
parents:
diff changeset
   843
    
hgs
parents:
diff changeset
   844
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
   845
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
   846
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(3);
hgs
parents:
diff changeset
   847
    mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
   848
    
hgs
parents:
diff changeset
   849
    mEapQtUtilsContext->setConfigurationReference(3, true);
hgs
parents:
diff changeset
   850
    
hgs
parents:
diff changeset
   851
    QList<EapQtCertificateInfo> caCerts;
hgs
parents:
diff changeset
   852
    QList<EapQtCertificateInfo> userCerts;
hgs
parents:
diff changeset
   853
    
hgs
parents:
diff changeset
   854
    EapQtCertificateInfo cert;
hgs
parents:
diff changeset
   855
    cert.setValue(EapQtCertificateInfo::CertificateLabel, "My CA Cert");
hgs
parents:
diff changeset
   856
    caCerts.append(cert);
hgs
parents:
diff changeset
   857
    
hgs
parents:
diff changeset
   858
    cert.setValue(EapQtCertificateInfo::CertificateLabel, "My User Cert");
hgs
parents:
diff changeset
   859
    userCerts.append(cert);
hgs
parents:
diff changeset
   860
    
hgs
parents:
diff changeset
   861
    mEapQtUtilsContext->createEapTls(
hgs
parents:
diff changeset
   862
        caCerts,
hgs
parents:
diff changeset
   863
        0,
hgs
parents:
diff changeset
   864
        userCerts,
hgs
parents:
diff changeset
   865
        0);
hgs
parents:
diff changeset
   866
    
hgs
parents:
diff changeset
   867
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
   868
        ssid, 
hgs
parents:
diff changeset
   869
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   870
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
   871
        false, false, false);
hgs
parents:
diff changeset
   872
hgs
parents:
diff changeset
   873
    mView->showWizard();
hgs
parents:
diff changeset
   874
    
hgs
parents:
diff changeset
   875
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
   876
    verify_ca_cert_page_select_and_click_next(false);
hgs
parents:
diff changeset
   877
    verify_user_cert_page_select_and_click_next(ButtonEnabled, 0);
hgs
parents:
diff changeset
   878
    verify_identity_and_click_next(eapTypeToString(EapQtPluginHandle::PluginEapTls));
hgs
parents:
diff changeset
   879
    
hgs
parents:
diff changeset
   880
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPage::PageProcessSettings,ssid), true );
hgs
parents:
diff changeset
   881
    QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   882
hgs
parents:
diff changeset
   883
    QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
hgs
parents:
diff changeset
   884
    QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true );
hgs
parents:
diff changeset
   885
    
hgs
parents:
diff changeset
   886
    QCOMPARE( verifySummaryPage(
hgs
parents:
diff changeset
   887
        ssid,
hgs
parents:
diff changeset
   888
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   889
        false, 
hgs
parents:
diff changeset
   890
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
   891
        false,
hgs
parents:
diff changeset
   892
        hbTrId("txt_occ_dblist_destination_val_internet"),
hgs
parents:
diff changeset
   893
        EapQtPluginHandle::PluginEapTls),true);
hgs
parents:
diff changeset
   894
    
hgs
parents:
diff changeset
   895
#endif
hgs
parents:
diff changeset
   896
}
hgs
parents:
diff changeset
   897
hgs
parents:
diff changeset
   898
void TestWlanWizardEap::tc_eap_tls_two_user_certificates()
hgs
parents:
diff changeset
   899
{
hgs
parents:
diff changeset
   900
#ifdef tc_eap_tls_two_user_certificates_enabled
hgs
parents:
diff changeset
   901
    const QString ssid("tc_eap_tls_two_user_certificates");
hgs
parents:
diff changeset
   902
    
hgs
parents:
diff changeset
   903
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
   904
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
   905
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(3);
hgs
parents:
diff changeset
   906
    mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
   907
    
hgs
parents:
diff changeset
   908
    mEapQtUtilsContext->setConfigurationReference(3, true);
hgs
parents:
diff changeset
   909
    
hgs
parents:
diff changeset
   910
    QList<EapQtCertificateInfo> caCerts;
hgs
parents:
diff changeset
   911
    QList<EapQtCertificateInfo> userCerts;
hgs
parents:
diff changeset
   912
    
hgs
parents:
diff changeset
   913
    EapQtCertificateInfo cert;
hgs
parents:
diff changeset
   914
    cert.setValue(EapQtCertificateInfo::CertificateLabel, "My CA Cert");
hgs
parents:
diff changeset
   915
    caCerts.append(cert);
hgs
parents:
diff changeset
   916
    cert.setValue(EapQtCertificateInfo::CertificateLabel, "My Super CA Cert");
hgs
parents:
diff changeset
   917
    caCerts.append(cert);
hgs
parents:
diff changeset
   918
    
hgs
parents:
diff changeset
   919
    cert.setValue(EapQtCertificateInfo::CertificateLabel, "My User Cert");
hgs
parents:
diff changeset
   920
    userCerts.append(cert);
hgs
parents:
diff changeset
   921
    cert.setValue(EapQtCertificateInfo::CertificateLabel, "My User Cert Second");
hgs
parents:
diff changeset
   922
    userCerts.append(cert);
hgs
parents:
diff changeset
   923
    
hgs
parents:
diff changeset
   924
    mEapQtUtilsContext->createEapTls(
hgs
parents:
diff changeset
   925
        caCerts,
hgs
parents:
diff changeset
   926
        0,
hgs
parents:
diff changeset
   927
        userCerts,
hgs
parents:
diff changeset
   928
        1);
hgs
parents:
diff changeset
   929
    
hgs
parents:
diff changeset
   930
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
   931
        ssid, 
hgs
parents:
diff changeset
   932
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   933
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
   934
        false, false, false);
hgs
parents:
diff changeset
   935
hgs
parents:
diff changeset
   936
    mView->showWizard();
hgs
parents:
diff changeset
   937
    
hgs
parents:
diff changeset
   938
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
   939
    verify_ca_cert_page_select_and_click_next(false);
hgs
parents:
diff changeset
   940
    verify_user_cert_page_select_and_click_next(ButtonDisabled, 1);
hgs
parents:
diff changeset
   941
    verify_identity_and_click_next(eapTypeToString(EapQtPluginHandle::PluginEapTls));
hgs
parents:
diff changeset
   942
    
hgs
parents:
diff changeset
   943
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPage::PageProcessSettings,ssid), true );
hgs
parents:
diff changeset
   944
    QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
   945
hgs
parents:
diff changeset
   946
    QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
hgs
parents:
diff changeset
   947
    QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true );
hgs
parents:
diff changeset
   948
    
hgs
parents:
diff changeset
   949
    QCOMPARE( verifySummaryPage(
hgs
parents:
diff changeset
   950
        ssid,
hgs
parents:
diff changeset
   951
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   952
        false, 
hgs
parents:
diff changeset
   953
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
   954
        false,
hgs
parents:
diff changeset
   955
        hbTrId("txt_occ_dblist_destination_val_internet"),
hgs
parents:
diff changeset
   956
        EapQtPluginHandle::PluginEapTls),true);
hgs
parents:
diff changeset
   957
    
hgs
parents:
diff changeset
   958
#endif 
hgs
parents:
diff changeset
   959
}
hgs
parents:
diff changeset
   960
hgs
parents:
diff changeset
   961
void TestWlanWizardEap::tc_eap_tls_back_and_forward_certs_with_cert_update()
hgs
parents:
diff changeset
   962
{
hgs
parents:
diff changeset
   963
#ifdef tc_eap_tls_back_and_forward_certs_with_cert_update_enabled
hgs
parents:
diff changeset
   964
    const QString ssid("tc_eap_tls_two_user_certificates");
hgs
parents:
diff changeset
   965
    
hgs
parents:
diff changeset
   966
    const QString caCert1("My CA Cert");
hgs
parents:
diff changeset
   967
    const QString caCert2("My CA Cert Second");
hgs
parents:
diff changeset
   968
hgs
parents:
diff changeset
   969
    const QString userCert1("My User Cert");
hgs
parents:
diff changeset
   970
    const QString userCert2("My User Cert Second");
hgs
parents:
diff changeset
   971
    
hgs
parents:
diff changeset
   972
    QList<EapQtCertificateInfo> caCerts;
hgs
parents:
diff changeset
   973
    QList<EapQtCertificateInfo> userCerts;
hgs
parents:
diff changeset
   974
    
hgs
parents:
diff changeset
   975
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
   976
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
   977
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(3);
hgs
parents:
diff changeset
   978
    mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
   979
    
hgs
parents:
diff changeset
   980
    mEapQtUtilsContext->setConfigurationReference(3, true);
hgs
parents:
diff changeset
   981
    
hgs
parents:
diff changeset
   982
    EapQtCertificateInfo cert;
hgs
parents:
diff changeset
   983
    cert.setValue(EapQtCertificateInfo::CertificateLabel, caCert1);
hgs
parents:
diff changeset
   984
    caCerts.append(cert);
hgs
parents:
diff changeset
   985
    
hgs
parents:
diff changeset
   986
    cert.setValue(EapQtCertificateInfo::CertificateLabel, userCert1);
hgs
parents:
diff changeset
   987
    userCerts.append(cert);
hgs
parents:
diff changeset
   988
    
hgs
parents:
diff changeset
   989
    mEapQtUtilsContext->createEapTls(
hgs
parents:
diff changeset
   990
        caCerts,
hgs
parents:
diff changeset
   991
        0,
hgs
parents:
diff changeset
   992
        userCerts,
hgs
parents:
diff changeset
   993
        0);
hgs
parents:
diff changeset
   994
    
hgs
parents:
diff changeset
   995
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
   996
        ssid, 
hgs
parents:
diff changeset
   997
        CMManagerShim::Infra,
hgs
parents:
diff changeset
   998
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
   999
        false, false, false);
hgs
parents:
diff changeset
  1000
hgs
parents:
diff changeset
  1001
    mView->showWizard();
hgs
parents:
diff changeset
  1002
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
  1003
    verify_ca_cert_page_select_and_click_next(true);
hgs
parents:
diff changeset
  1004
    verify_user_cert_page_select_and_click_next(ButtonEnabled, 0);
hgs
parents:
diff changeset
  1005
    verify_identity_page(eapTypeToString(EapQtPluginHandle::PluginEapTls));
hgs
parents:
diff changeset
  1006
hgs
parents:
diff changeset
  1007
    // backwards
hgs
parents:
diff changeset
  1008
    QCOMPARE(mouseClickPrevious(), true);
hgs
parents:
diff changeset
  1009
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1010
    verify_user_cert_page(ButtonEnabled, userCert1, 0 );
hgs
parents:
diff changeset
  1011
hgs
parents:
diff changeset
  1012
    QCOMPARE(mouseClickPrevious(), true);
hgs
parents:
diff changeset
  1013
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1014
    verify_ca_cert_page();
hgs
parents:
diff changeset
  1015
hgs
parents:
diff changeset
  1016
    QCOMPARE(mouseClickPrevious(), true);
hgs
parents:
diff changeset
  1017
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1018
    verify_outertype(ButtonEnabled);
hgs
parents:
diff changeset
  1019
hgs
parents:
diff changeset
  1020
    cert.setValue(EapQtCertificateInfo::CertificateLabel, caCert2);
hgs
parents:
diff changeset
  1021
    caCerts.append(cert);
hgs
parents:
diff changeset
  1022
    mEapQtUtilsContext->setCertsCa(caCerts);
hgs
parents:
diff changeset
  1023
    
hgs
parents:
diff changeset
  1024
    cert.setValue(EapQtCertificateInfo::CertificateLabel, userCert2);
hgs
parents:
diff changeset
  1025
    userCerts.append(cert);
hgs
parents:
diff changeset
  1026
    mEapQtUtilsContext->setCertsUser(userCerts);
hgs
parents:
diff changeset
  1027
hgs
parents:
diff changeset
  1028
    mEapQtUtilsContext->createEapIdentifyValidators(EapQtPluginHandle::PluginEapTls);
hgs
parents:
diff changeset
  1029
    
hgs
parents:
diff changeset
  1030
    // Forward
hgs
parents:
diff changeset
  1031
    QCOMPARE(mouseClickNext(), true);
hgs
parents:
diff changeset
  1032
    verify_ca_cert_page_select_and_click_next(false);
hgs
parents:
diff changeset
  1033
    verify_user_cert_page(ButtonDisabled);
hgs
parents:
diff changeset
  1034
hgs
parents:
diff changeset
  1035
    // backwards
hgs
parents:
diff changeset
  1036
    QCOMPARE(mouseClickPrevious(), true);
hgs
parents:
diff changeset
  1037
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1038
    verify_ca_cert_page(caCert1, 1);
hgs
parents:
diff changeset
  1039
hgs
parents:
diff changeset
  1040
    QCOMPARE(mouseClickPrevious(), true);
hgs
parents:
diff changeset
  1041
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1042
    verify_outertype(ButtonEnabled);
hgs
parents:
diff changeset
  1043
hgs
parents:
diff changeset
  1044
    QCOMPARE(mouseClickNext(), true);
hgs
parents:
diff changeset
  1045
    verify_ca_cert_page(caCert1, 1);
hgs
parents:
diff changeset
  1046
hgs
parents:
diff changeset
  1047
    QCOMPARE(mouseClickNext(), true);
hgs
parents:
diff changeset
  1048
    verify_user_cert_page_select_and_click_next(ButtonDisabled, 0);
hgs
parents:
diff changeset
  1049
hgs
parents:
diff changeset
  1050
    verify_identity_and_click_next(eapTypeToString(EapQtPluginHandle::PluginEapTls));        
hgs
parents:
diff changeset
  1051
hgs
parents:
diff changeset
  1052
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPage::PageProcessSettings,ssid), true );
hgs
parents:
diff changeset
  1053
    QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1054
hgs
parents:
diff changeset
  1055
    QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
hgs
parents:
diff changeset
  1056
    QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true );
hgs
parents:
diff changeset
  1057
    
hgs
parents:
diff changeset
  1058
    QCOMPARE( verifySummaryPage(
hgs
parents:
diff changeset
  1059
        ssid,
hgs
parents:
diff changeset
  1060
        CMManagerShim::Infra,
hgs
parents:
diff changeset
  1061
        false, 
hgs
parents:
diff changeset
  1062
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
  1063
        false,
hgs
parents:
diff changeset
  1064
        hbTrId("txt_occ_dblist_destination_val_internet"),
hgs
parents:
diff changeset
  1065
        EapQtPluginHandle::PluginEapTls),true);
hgs
parents:
diff changeset
  1066
    
hgs
parents:
diff changeset
  1067
#endif 
hgs
parents:
diff changeset
  1068
}
hgs
parents:
diff changeset
  1069
hgs
parents:
diff changeset
  1070
void TestWlanWizardEap::tc_eap_sim_finish()
hgs
parents:
diff changeset
  1071
{
hgs
parents:
diff changeset
  1072
#ifdef tc_eap_sim_finish_enabled
hgs
parents:
diff changeset
  1073
    tc_eap_aka_sim(EapQtPluginHandle::PluginEapAka);
hgs
parents:
diff changeset
  1074
    
hgs
parents:
diff changeset
  1075
    QCOMPARE( mouseClickFinish(), true );
hgs
parents:
diff changeset
  1076
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1077
    QCOMPARE( verifyStatus(WizardStatusSignalFinished, 3), true);
hgs
parents:
diff changeset
  1078
#endif
hgs
parents:
diff changeset
  1079
}
hgs
parents:
diff changeset
  1080
hgs
parents:
diff changeset
  1081
void TestWlanWizardEap::tc_eap_sim_cancel()
hgs
parents:
diff changeset
  1082
{
hgs
parents:
diff changeset
  1083
#ifdef tc_eap_sim_cancel_enabled
hgs
parents:
diff changeset
  1084
    tc_eap_aka_sim(EapQtPluginHandle::PluginEapAka);
hgs
parents:
diff changeset
  1085
    
hgs
parents:
diff changeset
  1086
    QCOMPARE( mouseClickCancel(), true );
hgs
parents:
diff changeset
  1087
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1088
    QCOMPARE(verifyStatus(WizardStatusSignalCancelled), true);
hgs
parents:
diff changeset
  1089
#endif
hgs
parents:
diff changeset
  1090
}
hgs
parents:
diff changeset
  1091
hgs
parents:
diff changeset
  1092
void TestWlanWizardEap::tc_eap_fast_confirmed()
hgs
parents:
diff changeset
  1093
{
hgs
parents:
diff changeset
  1094
#ifdef tc_eap_fast_confirmed_enabled
hgs
parents:
diff changeset
  1095
    tc_eap_fast(
hgs
parents:
diff changeset
  1096
        EapQtPacStoreConfig::PacStoreStatePasswordStored,
hgs
parents:
diff changeset
  1097
        true);
hgs
parents:
diff changeset
  1098
#endif
hgs
parents:
diff changeset
  1099
}
hgs
parents:
diff changeset
  1100
hgs
parents:
diff changeset
  1101
void TestWlanWizardEap::tc_eap_fast_new_store()
hgs
parents:
diff changeset
  1102
{
hgs
parents:
diff changeset
  1103
#ifdef tc_eap_fast_new_store_enabled
hgs
parents:
diff changeset
  1104
    tc_eap_fast(
hgs
parents:
diff changeset
  1105
        EapQtPacStoreConfig::PacStoreStateStoreNotExists,
hgs
parents:
diff changeset
  1106
        true);
hgs
parents:
diff changeset
  1107
#endif
hgs
parents:
diff changeset
  1108
}
hgs
parents:
diff changeset
  1109
hgs
parents:
diff changeset
  1110
void TestWlanWizardEap::tc_eap_fast_new_store_save_fails()
hgs
parents:
diff changeset
  1111
{
hgs
parents:
diff changeset
  1112
#ifdef tc_eap_fast_new_store_save_fails_enabled
hgs
parents:
diff changeset
  1113
    tc_eap_fast(
hgs
parents:
diff changeset
  1114
        EapQtPacStoreConfig::PacStoreStateStoreNotExists,
hgs
parents:
diff changeset
  1115
        false);
hgs
parents:
diff changeset
  1116
#endif
hgs
parents:
diff changeset
  1117
}
hgs
parents:
diff changeset
  1118
hgs
parents:
diff changeset
  1119
void TestWlanWizardEap::tc_eap_fast_new_store_and_validators()
hgs
parents:
diff changeset
  1120
{
hgs
parents:
diff changeset
  1121
#ifdef tc_eap_fast_new_store_and_validators_enabled
hgs
parents:
diff changeset
  1122
    const QString ssid("tc_eap_fast_new_store_and_validators");
hgs
parents:
diff changeset
  1123
    const QString username("user");
hgs
parents:
diff changeset
  1124
hgs
parents:
diff changeset
  1125
    mWlanQtUtilsContext->setCreateWlanIapResult(4);
hgs
parents:
diff changeset
  1126
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
  1127
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(4);
hgs
parents:
diff changeset
  1128
    mWlanQtUtilsContext->setSignalIctResult(4, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
  1129
hgs
parents:
diff changeset
  1130
    mEapQtUtilsContext->setConfigurationReference(4, true);
hgs
parents:
diff changeset
  1131
    mEapQtUtilsContext->createEapFast(EapQtPacStoreConfig::PacStoreStateStoreNotExists);
hgs
parents:
diff changeset
  1132
    mEapQtUtilsContext->createInner(
hgs
parents:
diff changeset
  1133
        EapQtPluginHandle::PluginEapFast,
hgs
parents:
diff changeset
  1134
        EapQtPluginHandle::PluginEapMschapv2,
hgs
parents:
diff changeset
  1135
        "u",
hgs
parents:
diff changeset
  1136
        "p");
hgs
parents:
diff changeset
  1137
    
hgs
parents:
diff changeset
  1138
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
  1139
        ssid, 
hgs
parents:
diff changeset
  1140
        CMManagerShim::Infra,
hgs
parents:
diff changeset
  1141
        CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
  1142
        false, false, false);
hgs
parents:
diff changeset
  1143
hgs
parents:
diff changeset
  1144
    mView->showWizard();
hgs
parents:
diff changeset
  1145
    EapQtValidatorStub *validator = (EapQtValidatorStub*)mEapQtUtilsContext->validatorPacStore(
hgs
parents:
diff changeset
  1146
        EapQtPacStoreConfig::PacStorePassword);
hgs
parents:
diff changeset
  1147
    validator->setReturnValue(EapQtValidator::StatusInvalid);
hgs
parents:
diff changeset
  1148
    
hgs
parents:
diff changeset
  1149
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
  1150
    verify_new_pac_store_password_page(ButtonDisabled);
hgs
parents:
diff changeset
  1151
    
hgs
parents:
diff changeset
  1152
    QCOMPARE( mouseClickObject("lineEditUsername"), true );
hgs
parents:
diff changeset
  1153
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1154
    QCOMPARE( insertTextToObject("lineEditUsername", username), true );
hgs
parents:
diff changeset
  1155
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1156
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1157
    
hgs
parents:
diff changeset
  1158
    validator->setReturnValue(EapQtValidator::StatusOk);
hgs
parents:
diff changeset
  1159
    
hgs
parents:
diff changeset
  1160
    QCOMPARE( mouseClickObject("lineEditPassword"), true );
hgs
parents:
diff changeset
  1161
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1162
    QCOMPARE( insertTextToObject("lineEditPassword", username), true );
hgs
parents:
diff changeset
  1163
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1164
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1165
    
hgs
parents:
diff changeset
  1166
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1167
    verify_username_password(EapQtPluginHandle::PluginEapMschapv2);
hgs
parents:
diff changeset
  1168
hgs
parents:
diff changeset
  1169
#endif
hgs
parents:
diff changeset
  1170
}
hgs
parents:
diff changeset
  1171
hgs
parents:
diff changeset
  1172
hgs
parents:
diff changeset
  1173
void TestWlanWizardEap::tc_eap_fast_new_store_back_and_forwards()
hgs
parents:
diff changeset
  1174
{
hgs
parents:
diff changeset
  1175
#ifdef tc_eap_fast_new_store_back_and_forwards_enabled
hgs
parents:
diff changeset
  1176
    const QString ssid("tc_eap_fast_new_store_back_and_forwards");
hgs
parents:
diff changeset
  1177
    const QString username("u");
hgs
parents:
diff changeset
  1178
    const QString password("p");
hgs
parents:
diff changeset
  1179
hgs
parents:
diff changeset
  1180
    mWlanQtUtilsContext->setCreateWlanIapResult(4);
hgs
parents:
diff changeset
  1181
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
  1182
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(4);
hgs
parents:
diff changeset
  1183
    mWlanQtUtilsContext->setSignalIctResult(4, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
  1184
hgs
parents:
diff changeset
  1185
    mEapQtUtilsContext->setConfigurationReference(4, true);
hgs
parents:
diff changeset
  1186
    mEapQtUtilsContext->createEapFast(EapQtPacStoreConfig::PacStoreStateStoreNotExists);
hgs
parents:
diff changeset
  1187
    mEapQtUtilsContext->createInner(
hgs
parents:
diff changeset
  1188
        EapQtPluginHandle::PluginEapFast,
hgs
parents:
diff changeset
  1189
        EapQtPluginHandle::PluginEapMschapv2,
hgs
parents:
diff changeset
  1190
        username,
hgs
parents:
diff changeset
  1191
        password);
hgs
parents:
diff changeset
  1192
    
hgs
parents:
diff changeset
  1193
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
  1194
        ssid, 
hgs
parents:
diff changeset
  1195
        CMManagerShim::Infra,
hgs
parents:
diff changeset
  1196
        CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
  1197
        false, false, false);
hgs
parents:
diff changeset
  1198
hgs
parents:
diff changeset
  1199
    mView->showWizard();
hgs
parents:
diff changeset
  1200
    
hgs
parents:
diff changeset
  1201
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
  1202
    verify_new_pac_store_password_page(ButtonEnabled);
hgs
parents:
diff changeset
  1203
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1204
    verify_username_password(EapQtPluginHandle::PluginEapMschapv2);
hgs
parents:
diff changeset
  1205
    
hgs
parents:
diff changeset
  1206
    // backwards
hgs
parents:
diff changeset
  1207
    QCOMPARE( mouseClickPrevious(), true );
hgs
parents:
diff changeset
  1208
    verify_new_pac_store_password_page(ButtonEnabled);
hgs
parents:
diff changeset
  1209
    QCOMPARE( mouseClickPrevious(), true );
hgs
parents:
diff changeset
  1210
    
hgs
parents:
diff changeset
  1211
    mEapQtUtilsContext->createInnerTypeValidators(EapQtPluginHandle::PluginEapMschapv2);
hgs
parents:
diff changeset
  1212
    
hgs
parents:
diff changeset
  1213
    // forwards
hgs
parents:
diff changeset
  1214
    verify_outertype_select_first(ButtonEnabled);
hgs
parents:
diff changeset
  1215
    verify_new_pac_store_password_page(ButtonEnabled);
hgs
parents:
diff changeset
  1216
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1217
    verify_username_password(EapQtPluginHandle::PluginEapMschapv2);
hgs
parents:
diff changeset
  1218
#endif
hgs
parents:
diff changeset
  1219
}
hgs
parents:
diff changeset
  1220
hgs
parents:
diff changeset
  1221
void TestWlanWizardEap::tc_eap_fast_new_store_read_config_fail()
hgs
parents:
diff changeset
  1222
{
hgs
parents:
diff changeset
  1223
#ifdef tc_eap_fast_new_store_read_config_fail_enabled
hgs
parents:
diff changeset
  1224
    tc_eap_fast(
hgs
parents:
diff changeset
  1225
        EapQtPacStoreConfig::PacStoreStateStoreNotExists,
hgs
parents:
diff changeset
  1226
        true,
hgs
parents:
diff changeset
  1227
        false);
hgs
parents:
diff changeset
  1228
#endif
hgs
parents:
diff changeset
  1229
}
hgs
parents:
diff changeset
  1230
hgs
parents:
diff changeset
  1231
void TestWlanWizardEap::tc_eap_fast_confirm_store()
hgs
parents:
diff changeset
  1232
{
hgs
parents:
diff changeset
  1233
#ifdef tc_eap_fast_confirm_store_enabled
hgs
parents:
diff changeset
  1234
    tc_eap_fast(
hgs
parents:
diff changeset
  1235
        EapQtPacStoreConfig::PacStoreStatePasswordRequired,
hgs
parents:
diff changeset
  1236
        true);
hgs
parents:
diff changeset
  1237
#endif
hgs
parents:
diff changeset
  1238
}
hgs
parents:
diff changeset
  1239
hgs
parents:
diff changeset
  1240
void TestWlanWizardEap::tc_eap_fast_confirm_store_and_validators()
hgs
parents:
diff changeset
  1241
{
hgs
parents:
diff changeset
  1242
#ifdef tc_eap_fast_confirm_store_and_validators_enabled
hgs
parents:
diff changeset
  1243
    const QString ssid("tc_eap_fast_confirm_store_and_validators");
hgs
parents:
diff changeset
  1244
    const QString username_invalid("invalid");
hgs
parents:
diff changeset
  1245
    const QString username_valid("valid");
hgs
parents:
diff changeset
  1246
hgs
parents:
diff changeset
  1247
    mWlanQtUtilsContext->setCreateWlanIapResult(4);
hgs
parents:
diff changeset
  1248
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
  1249
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(4);
hgs
parents:
diff changeset
  1250
    mWlanQtUtilsContext->setSignalIctResult(4, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
  1251
hgs
parents:
diff changeset
  1252
    mEapQtUtilsContext->setConfigurationReference(4, true);
hgs
parents:
diff changeset
  1253
    mEapQtUtilsContext->createEapFast(EapQtPacStoreConfig::PacStoreStatePasswordRequired);
hgs
parents:
diff changeset
  1254
    mEapQtUtilsContext->createInner(
hgs
parents:
diff changeset
  1255
        EapQtPluginHandle::PluginEapFast,
hgs
parents:
diff changeset
  1256
        EapQtPluginHandle::PluginEapMschapv2,
hgs
parents:
diff changeset
  1257
        "u",
hgs
parents:
diff changeset
  1258
        "p");
hgs
parents:
diff changeset
  1259
    
hgs
parents:
diff changeset
  1260
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
  1261
        ssid, 
hgs
parents:
diff changeset
  1262
        CMManagerShim::Infra,
hgs
parents:
diff changeset
  1263
        CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
  1264
        false, false, false);
hgs
parents:
diff changeset
  1265
hgs
parents:
diff changeset
  1266
    mView->showWizard();
hgs
parents:
diff changeset
  1267
    EapQtValidatorStub *validator = (EapQtValidatorStub*)mEapQtUtilsContext->validatorPacStore(
hgs
parents:
diff changeset
  1268
        EapQtPacStoreConfig::PacStorePasswordConfirmation);
hgs
parents:
diff changeset
  1269
    validator->setReturnValue(EapQtValidator::StatusInvalid);
hgs
parents:
diff changeset
  1270
    
hgs
parents:
diff changeset
  1271
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
  1272
    verify_confirm_pac_store_password_page(ButtonEnabled);
hgs
parents:
diff changeset
  1273
    
hgs
parents:
diff changeset
  1274
    QCOMPARE( mouseClickObject("lineEditPasswordConfirm"), true );
hgs
parents:
diff changeset
  1275
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1276
    QCOMPARE( insertTextToObject("lineEditPasswordConfirm", username_invalid), true );
hgs
parents:
diff changeset
  1277
    QCOMPARE( mouseClickObject("labelError"), true );
hgs
parents:
diff changeset
  1278
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1279
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1280
    
hgs
parents:
diff changeset
  1281
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1282
    verify_confirm_pac_store_password_page(ButtonEnabled);
hgs
parents:
diff changeset
  1283
    QCOMPARE( verifyDialogText("labelError", hbTrId("txt_occ_info_incorrect_password")), true);
hgs
parents:
diff changeset
  1284
hgs
parents:
diff changeset
  1285
hgs
parents:
diff changeset
  1286
    validator->setReturnValue(EapQtValidator::StatusOk);
hgs
parents:
diff changeset
  1287
    
hgs
parents:
diff changeset
  1288
    QCOMPARE( mouseClickObject("lineEditPasswordConfirm"), true );
hgs
parents:
diff changeset
  1289
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1290
    QCOMPARE( insertTextToObject("lineEditPasswordConfirm", username_valid), true );
hgs
parents:
diff changeset
  1291
    QCOMPARE( mouseClickObject("labelError"), true );
hgs
parents:
diff changeset
  1292
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1293
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1294
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1295
    QCOMPARE( verifyDialogText("labelError", hbTrId("txt_occ_info_incorrect_password")), false);
hgs
parents:
diff changeset
  1296
    
hgs
parents:
diff changeset
  1297
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1298
    verify_username_password(EapQtPluginHandle::PluginEapMschapv2);
hgs
parents:
diff changeset
  1299
hgs
parents:
diff changeset
  1300
#endif
hgs
parents:
diff changeset
  1301
}
hgs
parents:
diff changeset
  1302
hgs
parents:
diff changeset
  1303
void TestWlanWizardEap::tc_eap_fast_confirm_store_back_and_forwards()
hgs
parents:
diff changeset
  1304
{
hgs
parents:
diff changeset
  1305
#ifdef tc_eap_fast_confirm_store_back_and_forwards_enabled
hgs
parents:
diff changeset
  1306
    const QString ssid("tc_eap_fast_confirm_store_back_and_forwards");
hgs
parents:
diff changeset
  1307
    const QString username("u");
hgs
parents:
diff changeset
  1308
    const QString password("p");
hgs
parents:
diff changeset
  1309
hgs
parents:
diff changeset
  1310
    mWlanQtUtilsContext->setCreateWlanIapResult(4);
hgs
parents:
diff changeset
  1311
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
  1312
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(4);
hgs
parents:
diff changeset
  1313
    mWlanQtUtilsContext->setSignalIctResult(4, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
  1314
hgs
parents:
diff changeset
  1315
    mEapQtUtilsContext->setConfigurationReference(4, true);
hgs
parents:
diff changeset
  1316
    mEapQtUtilsContext->createEapFast(EapQtPacStoreConfig::PacStoreStatePasswordRequired);
hgs
parents:
diff changeset
  1317
    mEapQtUtilsContext->createInner(
hgs
parents:
diff changeset
  1318
        EapQtPluginHandle::PluginEapFast,
hgs
parents:
diff changeset
  1319
        EapQtPluginHandle::PluginEapMschapv2,
hgs
parents:
diff changeset
  1320
        username,
hgs
parents:
diff changeset
  1321
        password);
hgs
parents:
diff changeset
  1322
    
hgs
parents:
diff changeset
  1323
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
  1324
        ssid, 
hgs
parents:
diff changeset
  1325
        CMManagerShim::Infra,
hgs
parents:
diff changeset
  1326
        CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
  1327
        false, false, false);
hgs
parents:
diff changeset
  1328
hgs
parents:
diff changeset
  1329
    mView->showWizard();
hgs
parents:
diff changeset
  1330
    
hgs
parents:
diff changeset
  1331
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
  1332
    verify_confirm_pac_store_password_page(ButtonEnabled);
hgs
parents:
diff changeset
  1333
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1334
    verify_username_password(EapQtPluginHandle::PluginEapMschapv2);
hgs
parents:
diff changeset
  1335
    
hgs
parents:
diff changeset
  1336
    // backwards
hgs
parents:
diff changeset
  1337
    QCOMPARE( mouseClickPrevious(), true );
hgs
parents:
diff changeset
  1338
    verify_confirm_pac_store_password_page(ButtonEnabled);
hgs
parents:
diff changeset
  1339
    QCOMPARE( mouseClickPrevious(), true );
hgs
parents:
diff changeset
  1340
    
hgs
parents:
diff changeset
  1341
    mEapQtUtilsContext->createInnerTypeValidators(EapQtPluginHandle::PluginEapMschapv2);
hgs
parents:
diff changeset
  1342
    
hgs
parents:
diff changeset
  1343
    // forwards
hgs
parents:
diff changeset
  1344
    verify_outertype_select_first(ButtonEnabled);
hgs
parents:
diff changeset
  1345
    verify_confirm_pac_store_password_page(ButtonEnabled);
hgs
parents:
diff changeset
  1346
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1347
    verify_username_password(EapQtPluginHandle::PluginEapMschapv2);
hgs
parents:
diff changeset
  1348
#endif
hgs
parents:
diff changeset
  1349
}
hgs
parents:
diff changeset
  1350
hgs
parents:
diff changeset
  1351
hgs
parents:
diff changeset
  1352
// ---------------------------------------------------------
hgs
parents:
diff changeset
  1353
// HELPPER VERIFICATORS & NAVIGATORS
hgs
parents:
diff changeset
  1354
// ---------------------------------------------------------
hgs
parents:
diff changeset
  1355
hgs
parents:
diff changeset
  1356
void TestWlanWizardEap::verify_outertype_select_first(
hgs
parents:
diff changeset
  1357
    TestWlanWizardContext::ButtonStatus nextButtonStatus)
hgs
parents:
diff changeset
  1358
{
hgs
parents:
diff changeset
  1359
    verify_outertype(nextButtonStatus);
hgs
parents:
diff changeset
  1360
    
hgs
parents:
diff changeset
  1361
    QCOMPARE( selectRadioButton( "list", 0 ), true );
hgs
parents:
diff changeset
  1362
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1363
    QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1364
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1365
}
hgs
parents:
diff changeset
  1366
hgs
parents:
diff changeset
  1367
void TestWlanWizardEap::verify_outertype(
hgs
parents:
diff changeset
  1368
    TestWlanWizardContext::ButtonStatus nextButtonStatus)
hgs
parents:
diff changeset
  1369
{
hgs
parents:
diff changeset
  1370
    QCOMPARE( verifyCurrentPage(EapWizardPage::PageOuterType), true );
hgs
parents:
diff changeset
  1371
    QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, nextButtonStatus, ButtonHidden), true );
hgs
parents:
diff changeset
  1372
}
hgs
parents:
diff changeset
  1373
hgs
parents:
diff changeset
  1374
void TestWlanWizardEap::verify_innertype_select_first(
hgs
parents:
diff changeset
  1375
    int outerType,
hgs
parents:
diff changeset
  1376
    TestWlanWizardContext::ButtonStatus nextButtonStatus)
hgs
parents:
diff changeset
  1377
{
hgs
parents:
diff changeset
  1378
    verify_innertype(outerType, nextButtonStatus);
hgs
parents:
diff changeset
  1379
    
hgs
parents:
diff changeset
  1380
    QCOMPARE( selectRadioButton( "list", 0 ), true );
hgs
parents:
diff changeset
  1381
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1382
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1383
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1384
}
hgs
parents:
diff changeset
  1385
hgs
parents:
diff changeset
  1386
void TestWlanWizardEap::verify_innertype(
hgs
parents:
diff changeset
  1387
    int outerType, 
hgs
parents:
diff changeset
  1388
    TestWlanWizardContext::ButtonStatus nextButtonStatus)
hgs
parents:
diff changeset
  1389
{
hgs
parents:
diff changeset
  1390
    int pageId;
hgs
parents:
diff changeset
  1391
    if (outerType == EapQtPluginHandle::PluginPeap){
hgs
parents:
diff changeset
  1392
        pageId = EapWizardPage::PageInnerTypePeap;
hgs
parents:
diff changeset
  1393
        
hgs
parents:
diff changeset
  1394
    } else {
hgs
parents:
diff changeset
  1395
        Q_ASSERT(outerType == EapQtPluginHandle::PluginEapTtls);
hgs
parents:
diff changeset
  1396
        pageId = EapWizardPage::PageInnerTypeEapTtls;
hgs
parents:
diff changeset
  1397
    }
hgs
parents:
diff changeset
  1398
    QCOMPARE( verifyCurrentPageWithInfo(pageId, eapTypeToString(outerType)), true );
hgs
parents:
diff changeset
  1399
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, nextButtonStatus, ButtonHidden), true );
hgs
parents:
diff changeset
  1400
}
hgs
parents:
diff changeset
  1401
hgs
parents:
diff changeset
  1402
void TestWlanWizardEap::verify_username_password_click_next(
hgs
parents:
diff changeset
  1403
    int type, 
hgs
parents:
diff changeset
  1404
    const QString &username, 
hgs
parents:
diff changeset
  1405
    const QString &password)
hgs
parents:
diff changeset
  1406
{
hgs
parents:
diff changeset
  1407
    verify_username_password(type);
hgs
parents:
diff changeset
  1408
    
hgs
parents:
diff changeset
  1409
    QCOMPARE( mouseClickObject("lineEditUsername"), true );
hgs
parents:
diff changeset
  1410
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1411
    QCOMPARE( insertTextToObject("lineEditUsername", username), true );
hgs
parents:
diff changeset
  1412
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1413
hgs
parents:
diff changeset
  1414
    QCOMPARE( mouseClickObject("lineEditPassword"), true );
hgs
parents:
diff changeset
  1415
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1416
    QCOMPARE( insertTextToObject("lineEditPassword", password), true );
hgs
parents:
diff changeset
  1417
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1418
    
hgs
parents:
diff changeset
  1419
    QCOMPARE( mouseClickObject("setlabel_56"), true );
hgs
parents:
diff changeset
  1420
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1421
}
hgs
parents:
diff changeset
  1422
hgs
parents:
diff changeset
  1423
void TestWlanWizardEap::verify_username_password(int type)
hgs
parents:
diff changeset
  1424
{
hgs
parents:
diff changeset
  1425
    QCOMPARE( verifyCurrentPageWithInfo(EapWizardPage::PageUsernamePassword, eapTypeToString(type)), true );
hgs
parents:
diff changeset
  1426
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1427
}
hgs
parents:
diff changeset
  1428
hgs
parents:
diff changeset
  1429
void TestWlanWizardEap::verify_ca_cert_page_select_and_click_next(bool automatic)
hgs
parents:
diff changeset
  1430
{
hgs
parents:
diff changeset
  1431
    verify_ca_cert_page();
hgs
parents:
diff changeset
  1432
    
hgs
parents:
diff changeset
  1433
    int index = 0;
hgs
parents:
diff changeset
  1434
    if (automatic == false) {
hgs
parents:
diff changeset
  1435
        index = 1;
hgs
parents:
diff changeset
  1436
    }
hgs
parents:
diff changeset
  1437
    QCOMPARE( selectRadioButton( "list", index ), true );
hgs
parents:
diff changeset
  1438
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1439
    
hgs
parents:
diff changeset
  1440
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1441
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1442
}
hgs
parents:
diff changeset
  1443
hgs
parents:
diff changeset
  1444
hgs
parents:
diff changeset
  1445
void TestWlanWizardEap::verify_ca_cert_page()
hgs
parents:
diff changeset
  1446
{
hgs
parents:
diff changeset
  1447
    QCOMPARE( verifyCurrentPage(EapWizardPage::PageCertificateCa), true );
hgs
parents:
diff changeset
  1448
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1449
 
hgs
parents:
diff changeset
  1450
    QCOMPARE( verifyRadioButtonState(
hgs
parents:
diff changeset
  1451
        "list", 
hgs
parents:
diff changeset
  1452
        0, 
hgs
parents:
diff changeset
  1453
        hbTrId("txt_occ_setlabel_val_select_automatically")), true);
hgs
parents:
diff changeset
  1454
}
hgs
parents:
diff changeset
  1455
hgs
parents:
diff changeset
  1456
void TestWlanWizardEap::verify_ca_cert_page(const QString &text, int index)
hgs
parents:
diff changeset
  1457
{
hgs
parents:
diff changeset
  1458
    QCOMPARE( verifyCurrentPage(EapWizardPage::PageCertificateCa), true );
hgs
parents:
diff changeset
  1459
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1460
    
hgs
parents:
diff changeset
  1461
    QCOMPARE( verifyRadioButtonState("list", index, text), true);
hgs
parents:
diff changeset
  1462
}
hgs
parents:
diff changeset
  1463
hgs
parents:
diff changeset
  1464
void TestWlanWizardEap::verify_user_cert_page_select_and_click_next(
hgs
parents:
diff changeset
  1465
    ButtonStatus nextButtonStatus,
hgs
parents:
diff changeset
  1466
    int index)
hgs
parents:
diff changeset
  1467
{
hgs
parents:
diff changeset
  1468
    verify_user_cert_page(nextButtonStatus);
hgs
parents:
diff changeset
  1469
hgs
parents:
diff changeset
  1470
    if (index != -1){
hgs
parents:
diff changeset
  1471
        QCOMPARE( selectRadioButton( "list", index ), true );
hgs
parents:
diff changeset
  1472
        QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1473
    
hgs
parents:
diff changeset
  1474
        QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1475
        QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1476
    } else {
hgs
parents:
diff changeset
  1477
        QCOMPARE( 
hgs
parents:
diff changeset
  1478
            verifyDialogText(
hgs
parents:
diff changeset
  1479
                "errorLabel",
hgs
parents:
diff changeset
  1480
                hbTrId("txt_occ_dialog_no_certificates_installed_wizard_c")), true);
hgs
parents:
diff changeset
  1481
        QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1482
    }
hgs
parents:
diff changeset
  1483
}
hgs
parents:
diff changeset
  1484
hgs
parents:
diff changeset
  1485
void TestWlanWizardEap::verify_user_cert_page(ButtonStatus nextButtonStatus)
hgs
parents:
diff changeset
  1486
{
hgs
parents:
diff changeset
  1487
    QCOMPARE( verifyCurrentPage(EapWizardPage::PageCertificateUser), true );
hgs
parents:
diff changeset
  1488
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, nextButtonStatus, ButtonHidden), true );
hgs
parents:
diff changeset
  1489
}
hgs
parents:
diff changeset
  1490
hgs
parents:
diff changeset
  1491
hgs
parents:
diff changeset
  1492
void TestWlanWizardEap::verify_user_cert_page(
hgs
parents:
diff changeset
  1493
    ButtonStatus nextButtonStatus,
hgs
parents:
diff changeset
  1494
    const QString &text,
hgs
parents:
diff changeset
  1495
    int index)
hgs
parents:
diff changeset
  1496
{
hgs
parents:
diff changeset
  1497
    QCOMPARE( verifyCurrentPage(EapWizardPage::PageCertificateUser), true );
hgs
parents:
diff changeset
  1498
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, nextButtonStatus, ButtonHidden), true );
hgs
parents:
diff changeset
  1499
    
hgs
parents:
diff changeset
  1500
    QCOMPARE( verifyRadioButtonState("list", index, text), true);
hgs
parents:
diff changeset
  1501
}
hgs
parents:
diff changeset
  1502
hgs
parents:
diff changeset
  1503
void TestWlanWizardEap::verify_identity_modify_and_click_next(
hgs
parents:
diff changeset
  1504
    const QString &outerType,
hgs
parents:
diff changeset
  1505
    bool usernameAutomatic,
hgs
parents:
diff changeset
  1506
    const QString &username,
hgs
parents:
diff changeset
  1507
    bool realmAutomatic,
hgs
parents:
diff changeset
  1508
    const QString &realm)
hgs
parents:
diff changeset
  1509
{
hgs
parents:
diff changeset
  1510
    QCOMPARE( verifyCurrentPageWithInfo(EapWizardPage::PageIdentity, outerType), true );
hgs
parents:
diff changeset
  1511
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1512
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1513
    
hgs
parents:
diff changeset
  1514
    QCOMPARE(verifyCheckBoxState("setlabel_53_val", true), true);
hgs
parents:
diff changeset
  1515
    QCOMPARE(verifyCheckBoxState("setlabel_54_val", true), true);
hgs
parents:
diff changeset
  1516
    
hgs
parents:
diff changeset
  1517
    QCOMPARE(selectCheckBoxState("setlabel_53_val", usernameAutomatic), true);
hgs
parents:
diff changeset
  1518
    QCOMPARE(selectCheckBoxState("setlabel_54_val", realmAutomatic), true);
hgs
parents:
diff changeset
  1519
        
hgs
parents:
diff changeset
  1520
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1521
    
hgs
parents:
diff changeset
  1522
    QCOMPARE(verifyCheckBoxState("setlabel_53_val", usernameAutomatic), true);
hgs
parents:
diff changeset
  1523
    QCOMPARE(verifyCheckBoxState("setlabel_54_val", realmAutomatic), true);
hgs
parents:
diff changeset
  1524
    
hgs
parents:
diff changeset
  1525
    QCOMPARE( mouseClickObject("lineEditUsername"), true );
hgs
parents:
diff changeset
  1526
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1527
    QCOMPARE( insertTextToObject("lineEditUsername", username), true );
hgs
parents:
diff changeset
  1528
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1529
hgs
parents:
diff changeset
  1530
    QCOMPARE( mouseClickObject("lineEditRealm"), true );
hgs
parents:
diff changeset
  1531
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1532
    QCOMPARE( insertTextToObject("lineEditRealm", realm), true );
hgs
parents:
diff changeset
  1533
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1534
    
hgs
parents:
diff changeset
  1535
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1536
    QTest::qWait(WaitTimeForUi);
hgs
parents:
diff changeset
  1537
    
hgs
parents:
diff changeset
  1538
    QCOMPARE( mouseClickObject("setlabel_53"), true );
hgs
parents:
diff changeset
  1539
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1540
}
hgs
parents:
diff changeset
  1541
hgs
parents:
diff changeset
  1542
void TestWlanWizardEap::verify_identity_and_click_next(const QString &outerType)
hgs
parents:
diff changeset
  1543
{
hgs
parents:
diff changeset
  1544
    verify_identity_page(outerType);
hgs
parents:
diff changeset
  1545
    
hgs
parents:
diff changeset
  1546
    QCOMPARE(verifyCheckBoxState("setlabel_53_val", true), true);
hgs
parents:
diff changeset
  1547
    QCOMPARE(verifyCheckBoxState("setlabel_54_val", true), true);
hgs
parents:
diff changeset
  1548
    
hgs
parents:
diff changeset
  1549
    QCOMPARE( mouseClickObject("setlabel_53"), true );
hgs
parents:
diff changeset
  1550
    QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1551
}
hgs
parents:
diff changeset
  1552
hgs
parents:
diff changeset
  1553
void TestWlanWizardEap::verify_identity_page(const QString &outerType)
hgs
parents:
diff changeset
  1554
{
hgs
parents:
diff changeset
  1555
    QCOMPARE( verifyCurrentPageWithInfo(EapWizardPage::PageIdentity, outerType), true );
hgs
parents:
diff changeset
  1556
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1557
}
hgs
parents:
diff changeset
  1558
hgs
parents:
diff changeset
  1559
hgs
parents:
diff changeset
  1560
void TestWlanWizardEap::verify_new_pac_store_password_page(
hgs
parents:
diff changeset
  1561
    ButtonStatus nextButtonStatus )
hgs
parents:
diff changeset
  1562
{
hgs
parents:
diff changeset
  1563
    QCOMPARE( verifyCurrentPage(EapWizardPage::PageNewPacStorePassword), true );
hgs
parents:
diff changeset
  1564
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, nextButtonStatus, ButtonHidden), true );
hgs
parents:
diff changeset
  1565
}
hgs
parents:
diff changeset
  1566
hgs
parents:
diff changeset
  1567
hgs
parents:
diff changeset
  1568
void TestWlanWizardEap::verify_confirm_pac_store_password_page(
hgs
parents:
diff changeset
  1569
    ButtonStatus nextButtonStatus)
hgs
parents:
diff changeset
  1570
{
hgs
parents:
diff changeset
  1571
    QCOMPARE( verifyCurrentPage(EapWizardPage::PagePromptPacStorePassword), true );
hgs
parents:
diff changeset
  1572
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, nextButtonStatus, ButtonHidden), true );
hgs
parents:
diff changeset
  1573
}
hgs
parents:
diff changeset
  1574
hgs
parents:
diff changeset
  1575
// ---------------------------------------------------------
hgs
parents:
diff changeset
  1576
// SUBTEST CASES
hgs
parents:
diff changeset
  1577
// ---------------------------------------------------------
hgs
parents:
diff changeset
  1578
hgs
parents:
diff changeset
  1579
hgs
parents:
diff changeset
  1580
void TestWlanWizardEap::tc_eap_aka_sim(int type)
hgs
parents:
diff changeset
  1581
{
hgs
parents:
diff changeset
  1582
    // TODO: verify IAP settings
hgs
parents:
diff changeset
  1583
    // TODO: verify call stack
hgs
parents:
diff changeset
  1584
    
hgs
parents:
diff changeset
  1585
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
  1586
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
  1587
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(3);
hgs
parents:
diff changeset
  1588
    mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
  1589
    
hgs
parents:
diff changeset
  1590
    mEapQtUtilsContext->setConfigurationReference(3, true);
hgs
parents:
diff changeset
  1591
    mEapQtUtilsContext->createEapAkaSim(type);
hgs
parents:
diff changeset
  1592
    
hgs
parents:
diff changeset
  1593
    const QString ssid("tc_eap_aka_sim");
hgs
parents:
diff changeset
  1594
    
hgs
parents:
diff changeset
  1595
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
  1596
        ssid, 
hgs
parents:
diff changeset
  1597
        CMManagerShim::Infra,
hgs
parents:
diff changeset
  1598
        CMManagerShim::WlanSecMode802_1x, 
hgs
parents:
diff changeset
  1599
        false, false, false);
hgs
parents:
diff changeset
  1600
hgs
parents:
diff changeset
  1601
    mView->showWizard();
hgs
parents:
diff changeset
  1602
    
hgs
parents:
diff changeset
  1603
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
  1604
hgs
parents:
diff changeset
  1605
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPage::PageProcessSettings,ssid), true );
hgs
parents:
diff changeset
  1606
    QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1607
hgs
parents:
diff changeset
  1608
    QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
hgs
parents:
diff changeset
  1609
    QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true );
hgs
parents:
diff changeset
  1610
    
hgs
parents:
diff changeset
  1611
    QCOMPARE( verifySummaryPage(
hgs
parents:
diff changeset
  1612
        ssid,
hgs
parents:
diff changeset
  1613
        CMManagerShim::Infra,
hgs
parents:
diff changeset
  1614
        false, 
hgs
parents:
diff changeset
  1615
        CMManagerShim::WlanSecMode802_1x, 
hgs
parents:
diff changeset
  1616
        true,
hgs
parents:
diff changeset
  1617
        hbTrId("txt_occ_dblist_destination_val_internet"),
hgs
parents:
diff changeset
  1618
        type),true);
hgs
parents:
diff changeset
  1619
}
hgs
parents:
diff changeset
  1620
hgs
parents:
diff changeset
  1621
void TestWlanWizardEap::tc_eap_peap_ttls(
hgs
parents:
diff changeset
  1622
    int outerType, 
hgs
parents:
diff changeset
  1623
    int innerType,
hgs
parents:
diff changeset
  1624
    int errorCode,
hgs
parents:
diff changeset
  1625
    const QString &errorString,
hgs
parents:
diff changeset
  1626
    bool saveInnerConfReturn )
hgs
parents:
diff changeset
  1627
{
hgs
parents:
diff changeset
  1628
    // TODO: verify IAP settings
hgs
parents:
diff changeset
  1629
    // TODO: verify call stack
hgs
parents:
diff changeset
  1630
    const QString ssid("tc_eap_peap_ttls");
hgs
parents:
diff changeset
  1631
    const QString username("u");
hgs
parents:
diff changeset
  1632
    const QString password("p");
hgs
parents:
diff changeset
  1633
hgs
parents:
diff changeset
  1634
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
  1635
    
hgs
parents:
diff changeset
  1636
    if (errorCode == KErrNone) {
hgs
parents:
diff changeset
  1637
        mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
  1638
        mWlanQtUtilsContext->setSignalWlanNetworkOpened(3);
hgs
parents:
diff changeset
  1639
        mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
  1640
    } else {
hgs
parents:
diff changeset
  1641
        mWlanQtUtilsContext->setConnectionSuccessed(false);
hgs
parents:
diff changeset
  1642
        mWlanQtUtilsContext->setSignalWlanNetworkClosed(3, errorCode);
hgs
parents:
diff changeset
  1643
    }
hgs
parents:
diff changeset
  1644
    mEapQtUtilsContext->setConfigurationReference(3, true);
hgs
parents:
diff changeset
  1645
    mEapQtUtilsContext->createEapTtlsPeap(
hgs
parents:
diff changeset
  1646
        (EapQtPluginHandle::Plugin)outerType,
hgs
parents:
diff changeset
  1647
        true,
hgs
parents:
diff changeset
  1648
        true,
hgs
parents:
diff changeset
  1649
        QString(), //usernameIdentity,
hgs
parents:
diff changeset
  1650
        true,
hgs
parents:
diff changeset
  1651
        QString(), //realm,
hgs
parents:
diff changeset
  1652
        (EapQtPluginHandle::Plugin)innerType );
hgs
parents:
diff changeset
  1653
hgs
parents:
diff changeset
  1654
    mEapQtUtilsContext->createInner(
hgs
parents:
diff changeset
  1655
        (EapQtPluginHandle::Plugin)outerType,
hgs
parents:
diff changeset
  1656
        (EapQtPluginHandle::Plugin)innerType,
hgs
parents:
diff changeset
  1657
        username,
hgs
parents:
diff changeset
  1658
        password);
hgs
parents:
diff changeset
  1659
    
hgs
parents:
diff changeset
  1660
    mEapQtUtilsContext->setInnerConfigReturn(saveInnerConfReturn);
hgs
parents:
diff changeset
  1661
    
hgs
parents:
diff changeset
  1662
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
  1663
        ssid, 
hgs
parents:
diff changeset
  1664
        CMManagerShim::Infra,
hgs
parents:
diff changeset
  1665
        CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
  1666
        false, false, false);
hgs
parents:
diff changeset
  1667
hgs
parents:
diff changeset
  1668
    mView->showWizard();
hgs
parents:
diff changeset
  1669
    
hgs
parents:
diff changeset
  1670
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
  1671
    verify_ca_cert_page_select_and_click_next(true);
hgs
parents:
diff changeset
  1672
    verify_identity_and_click_next(eapTypeToString((EapQtPluginHandle::Plugin)outerType));
hgs
parents:
diff changeset
  1673
    verify_innertype_select_first(
hgs
parents:
diff changeset
  1674
        (EapQtPluginHandle::Plugin)outerType,
hgs
parents:
diff changeset
  1675
        ButtonDisabled);
hgs
parents:
diff changeset
  1676
    
hgs
parents:
diff changeset
  1677
    verify_username_password_click_next(innerType, username, password);
hgs
parents:
diff changeset
  1678
    
hgs
parents:
diff changeset
  1679
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPage::PageProcessSettings,ssid), true );
hgs
parents:
diff changeset
  1680
    QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1681
hgs
parents:
diff changeset
  1682
    if (errorCode == KErrNone){
hgs
parents:
diff changeset
  1683
        QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
hgs
parents:
diff changeset
  1684
        QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true );
hgs
parents:
diff changeset
  1685
        
hgs
parents:
diff changeset
  1686
        QCOMPARE( verifySummaryPage(
hgs
parents:
diff changeset
  1687
            ssid,
hgs
parents:
diff changeset
  1688
            CMManagerShim::Infra,
hgs
parents:
diff changeset
  1689
            false, 
hgs
parents:
diff changeset
  1690
            CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
  1691
            false,
hgs
parents:
diff changeset
  1692
            hbTrId("txt_occ_dblist_destination_val_internet"),
hgs
parents:
diff changeset
  1693
            (EapQtPluginHandle::Plugin)outerType,
hgs
parents:
diff changeset
  1694
            (EapQtPluginHandle::Plugin)innerType),true);
hgs
parents:
diff changeset
  1695
        
hgs
parents:
diff changeset
  1696
    } else {
hgs
parents:
diff changeset
  1697
        QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageGenericError, errorString), true );
hgs
parents:
diff changeset
  1698
        QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1699
    }
hgs
parents:
diff changeset
  1700
}
hgs
parents:
diff changeset
  1701
hgs
parents:
diff changeset
  1702
void TestWlanWizardEap::tc_eap_aka_connect_error(
hgs
parents:
diff changeset
  1703
    int errorCode, 
hgs
parents:
diff changeset
  1704
    const QString &errorString)
hgs
parents:
diff changeset
  1705
{
hgs
parents:
diff changeset
  1706
    // TODO: verify IAP settings
hgs
parents:
diff changeset
  1707
    // TODO: verify call stack
hgs
parents:
diff changeset
  1708
    
hgs
parents:
diff changeset
  1709
    const QString ssid(errorString);
hgs
parents:
diff changeset
  1710
    
hgs
parents:
diff changeset
  1711
    mWlanQtUtilsContext->setCreateWlanIapResult(3);
hgs
parents:
diff changeset
  1712
    mWlanQtUtilsContext->setConnectionSuccessed(false);
hgs
parents:
diff changeset
  1713
    mWlanQtUtilsContext->setSignalWlanNetworkClosed(3, errorCode);
hgs
parents:
diff changeset
  1714
    
hgs
parents:
diff changeset
  1715
    mEapQtUtilsContext->setConfigurationReference(3, true);
hgs
parents:
diff changeset
  1716
    mEapQtUtilsContext->createEapAkaSim(EapQtPluginHandle::PluginEapAka);
hgs
parents:
diff changeset
  1717
    
hgs
parents:
diff changeset
  1718
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
  1719
        ssid, 
hgs
parents:
diff changeset
  1720
        CMManagerShim::Infra,
hgs
parents:
diff changeset
  1721
        CMManagerShim::WlanSecModeWpa2, 
hgs
parents:
diff changeset
  1722
        false, false, false);
hgs
parents:
diff changeset
  1723
hgs
parents:
diff changeset
  1724
    mView->showWizard();
hgs
parents:
diff changeset
  1725
    
hgs
parents:
diff changeset
  1726
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
  1727
    
hgs
parents:
diff changeset
  1728
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, ssid), true );
hgs
parents:
diff changeset
  1729
    QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1730
hgs
parents:
diff changeset
  1731
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageGenericError, errorString), true );
hgs
parents:
diff changeset
  1732
    QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1733
}
hgs
parents:
diff changeset
  1734
hgs
parents:
diff changeset
  1735
hgs
parents:
diff changeset
  1736
void TestWlanWizardEap::tc_eap_fast(
hgs
parents:
diff changeset
  1737
    int pacStoreState, 
hgs
parents:
diff changeset
  1738
    bool savePacStoreReturn,
hgs
parents:
diff changeset
  1739
    bool readPacStoreReturn)
hgs
parents:
diff changeset
  1740
{
hgs
parents:
diff changeset
  1741
    // TODO: verify IAP settings
hgs
parents:
diff changeset
  1742
    // TODO: verify call stack
hgs
parents:
diff changeset
  1743
    
hgs
parents:
diff changeset
  1744
    const QString ssid("tc_eap_fast");
hgs
parents:
diff changeset
  1745
    const QString username("u");
hgs
parents:
diff changeset
  1746
    const QString password("p");
hgs
parents:
diff changeset
  1747
hgs
parents:
diff changeset
  1748
    mWlanQtUtilsContext->setCreateWlanIapResult(4);
hgs
parents:
diff changeset
  1749
    mWlanQtUtilsContext->setConnectionSuccessed(true);
hgs
parents:
diff changeset
  1750
    mWlanQtUtilsContext->setSignalWlanNetworkOpened(4);
hgs
parents:
diff changeset
  1751
    mWlanQtUtilsContext->setSignalIctResult(4, WlanQtUtils::IctPassed);
hgs
parents:
diff changeset
  1752
hgs
parents:
diff changeset
  1753
    mEapQtUtilsContext->setConfigurationReference(4, true);
hgs
parents:
diff changeset
  1754
    mEapQtUtilsContext->createEapFast(pacStoreState);
hgs
parents:
diff changeset
  1755
    mEapQtUtilsContext->setPacStoreConfigSaveReturn(savePacStoreReturn);
hgs
parents:
diff changeset
  1756
    mEapQtUtilsContext->setPacStoreConfigReadReturn(readPacStoreReturn);
hgs
parents:
diff changeset
  1757
    
hgs
parents:
diff changeset
  1758
    if (!readPacStoreReturn) {
hgs
parents:
diff changeset
  1759
        EapQtPacStoreConfig pacStoreConfig;
hgs
parents:
diff changeset
  1760
        pacStoreConfig.setValue(
hgs
parents:
diff changeset
  1761
            EapQtPacStoreConfig::PacStoreReset, 
hgs
parents:
diff changeset
  1762
            true);
hgs
parents:
diff changeset
  1763
        
hgs
parents:
diff changeset
  1764
        mEapQtUtilsContext->setPacStoreConfigSave(pacStoreConfig, true);
hgs
parents:
diff changeset
  1765
    }
hgs
parents:
diff changeset
  1766
    
hgs
parents:
diff changeset
  1767
    mEapQtUtilsContext->createInner(
hgs
parents:
diff changeset
  1768
        EapQtPluginHandle::PluginEapFast,
hgs
parents:
diff changeset
  1769
        EapQtPluginHandle::PluginEapMschapv2,
hgs
parents:
diff changeset
  1770
        username,
hgs
parents:
diff changeset
  1771
        password);
hgs
parents:
diff changeset
  1772
    
hgs
parents:
diff changeset
  1773
    mView->mWizard->setParameters(
hgs
parents:
diff changeset
  1774
        ssid, 
hgs
parents:
diff changeset
  1775
        CMManagerShim::Infra,
hgs
parents:
diff changeset
  1776
        CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
  1777
        false, false, false);
hgs
parents:
diff changeset
  1778
hgs
parents:
diff changeset
  1779
    mView->showWizard();
hgs
parents:
diff changeset
  1780
    
hgs
parents:
diff changeset
  1781
    verify_outertype_select_first(ButtonDisabled);
hgs
parents:
diff changeset
  1782
    
hgs
parents:
diff changeset
  1783
    if (!readPacStoreReturn) {
hgs
parents:
diff changeset
  1784
        EapQtPacStoreConfig pacStoreConfig;
hgs
parents:
diff changeset
  1785
        
hgs
parents:
diff changeset
  1786
        pacStoreConfig.setValue(
hgs
parents:
diff changeset
  1787
            EapQtPacStoreConfig::PacStorePassword, 
hgs
parents:
diff changeset
  1788
            "");
hgs
parents:
diff changeset
  1789
        
hgs
parents:
diff changeset
  1790
        pacStoreConfig.setValue(
hgs
parents:
diff changeset
  1791
            EapQtPacStoreConfig::PacStoreSavePassword, 
hgs
parents:
diff changeset
  1792
            true);
hgs
parents:
diff changeset
  1793
hgs
parents:
diff changeset
  1794
        
hgs
parents:
diff changeset
  1795
        mEapQtUtilsContext->setPacStoreConfigSave(pacStoreConfig, true);
hgs
parents:
diff changeset
  1796
    }
hgs
parents:
diff changeset
  1797
    
hgs
parents:
diff changeset
  1798
    switch (pacStoreState){
hgs
parents:
diff changeset
  1799
    case EapQtPacStoreConfig::PacStoreStateStoreNotExists:
hgs
parents:
diff changeset
  1800
        verify_new_pac_store_password_page(ButtonEnabled);
hgs
parents:
diff changeset
  1801
        QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1802
        break;
hgs
parents:
diff changeset
  1803
        
hgs
parents:
diff changeset
  1804
    case EapQtPacStoreConfig::PacStoreStatePasswordRequired:
hgs
parents:
diff changeset
  1805
        verify_confirm_pac_store_password_page(ButtonEnabled);
hgs
parents:
diff changeset
  1806
        QCOMPARE( mouseClickNext(), true );
hgs
parents:
diff changeset
  1807
        break;
hgs
parents:
diff changeset
  1808
    }
hgs
parents:
diff changeset
  1809
hgs
parents:
diff changeset
  1810
    verify_username_password_click_next(EapQtPluginHandle::PluginEapMschapv2,username,password);
hgs
parents:
diff changeset
  1811
    
hgs
parents:
diff changeset
  1812
    QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPage::PageProcessSettings,ssid), true );
hgs
parents:
diff changeset
  1813
    QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
hgs
parents:
diff changeset
  1814
hgs
parents:
diff changeset
  1815
    if (savePacStoreReturn) {
hgs
parents:
diff changeset
  1816
        
hgs
parents:
diff changeset
  1817
        QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
hgs
parents:
diff changeset
  1818
        QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true );
hgs
parents:
diff changeset
  1819
        
hgs
parents:
diff changeset
  1820
        QCOMPARE( verifySummaryPage(
hgs
parents:
diff changeset
  1821
            ssid,
hgs
parents:
diff changeset
  1822
            CMManagerShim::Infra,
hgs
parents:
diff changeset
  1823
            false, 
hgs
parents:
diff changeset
  1824
            CMManagerShim::WlanSecModeWpa, 
hgs
parents:
diff changeset
  1825
            false,
hgs
parents:
diff changeset
  1826
            hbTrId("txt_occ_dblist_destination_val_internet"),
hgs
parents:
diff changeset
  1827
            EapQtPluginHandle::PluginEapFast,
hgs
parents:
diff changeset
  1828
            EapQtPluginHandle::PluginEapMschapv2,
hgs
parents:
diff changeset
  1829
            true) ,true);
hgs
parents:
diff changeset
  1830
    } else {
hgs
parents:
diff changeset
  1831
        QCOMPARE( 
hgs
parents:
diff changeset
  1832
            verifyCurrentPageWithInfo(
hgs
parents:
diff changeset
  1833
                WlanWizardPageInternal::PageGenericError, 
hgs
parents:
diff changeset
  1834
                hbTrId("txt_occ_dialog_unable_to_save_settings_please_ret")), true );
hgs
parents:
diff changeset
  1835
        QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );        
hgs
parents:
diff changeset
  1836
    }
hgs
parents:
diff changeset
  1837
}