wlanutilities/wlanwizard/tsrc/ut/testwlanwizardmanual.cpp
changeset 56 de27cc8389dd
child 58 301aeb18ae47
equal deleted inserted replaced
50:d4198dcb9983 56:de27cc8389dd
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:
       
    15  */
       
    16 
       
    17 // System includes
       
    18 #include <HbApplication>
       
    19 #include <HbDocumentLoader>
       
    20 #include <HbStackedWidget>
       
    21 #include <HbRadioButtonList>
       
    22 #include <HbAction>
       
    23 #include <HbLineEdit>
       
    24 #include <HbLabel>
       
    25 #include <QGraphicsWidget>
       
    26 #include <QObjectList>
       
    27 #include <QtCore>
       
    28 #include <QTest>
       
    29 #include <QDebug>
       
    30 #include <QList>
       
    31 #include <cmmanagerdefines_shim.h>
       
    32 
       
    33 // User includes
       
    34 #include "testwlanwizardmanual.h"
       
    35 #include "testwlanwizardmanual_conf.h"
       
    36 #include "hbautotest.h"
       
    37 #include "wlanwizard.h"
       
    38 #include "wlanwizard_p.h"
       
    39 #include "wlanwizardpagessid.h"
       
    40 #include "wlanqtutils_context.h"
       
    41 #include "wlanqtutils.h"
       
    42 #include "wlanqtutilsap.h"
       
    43 
       
    44 // External function prototypes
       
    45 
       
    46 // Local constants
       
    47 
       
    48 
       
    49 // ======== LOCAL FUNCTIONS ========
       
    50 
       
    51 // ======== MEMBER FUNCTIONS ========
       
    52 
       
    53 
       
    54 // ---------------------------------------------------------
       
    55 // TEST CASES
       
    56 // ---------------------------------------------------------
       
    57 
       
    58 
       
    59 void TestWlanWizardManual::tcStartWizard()
       
    60 {
       
    61     qDebug("Start TestWlanWizardManual");
       
    62 }
       
    63 
       
    64 /*!
       
    65  * 
       
    66  */
       
    67 void TestWlanWizardManual::tc_open_scan_results_received_at_scan_page()
       
    68 {
       
    69 #ifdef tc_open_scan_results_received_at_scan_page_enabled
       
    70     
       
    71     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false);
       
    72 
       
    73     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
    74     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
    75     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
    76     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
    77     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
    78     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
    79     
       
    80     mWlanQtUtilsContext->setImmediateApScanResult(false);
       
    81     mView->showWizard();
       
    82     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
    83     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
    84     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
    85     QTest::qWait(WaitTimeForUi);
       
    86     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
    87     QTest::qWait(WaitTimeForUi);
       
    88     QCOMPARE( mouseClickObject("dialog"), true );
       
    89     QTest::qWait(WaitTimeForUi);
       
    90     QCOMPARE( mouseClickNext(), true );
       
    91     
       
    92     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
    93     mWlanQtUtilsContext->emitScanApReady();
       
    94     mWlanQtUtilsContext->setImmediateApScanResult(true);
       
    95     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
    96     
       
    97 #endif
       
    98 }
       
    99 
       
   100 /*!
       
   101  * 
       
   102  */ 
       
   103 void TestWlanWizardManual::tc_attempt_to_input_too_long_ssid()
       
   104 {
       
   105 #ifdef tc_attempt_to_input_too_long_ssid_enabled
       
   106     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false);
       
   107 
       
   108     mWlanQtUtilsContext->setScanWlanDirectResult("12345678901234567890123456789012", mApList->List());
       
   109     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   110     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   111     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   112     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   113 
       
   114     mView->showWizard();
       
   115     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   116     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   117     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   118     QTest::qWait(WaitTimeForUi);
       
   119     QCOMPARE( insertTextToObject("lineEditKey", "1234567890123456789012345678901234567890"), true );
       
   120     QTest::qWait(WaitTimeForUi);
       
   121     QCOMPARE( mouseClickObject("dialog"), true );
       
   122     QTest::qWait(WaitTimeForUi);
       
   123     QCOMPARE( mouseClickNext(), true );
       
   124     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "12345678901234567890123456789012"), true );
       
   125     QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );  
       
   126     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   127 #endif
       
   128 }
       
   129 
       
   130 /*!
       
   131  *  
       
   132  */
       
   133 void TestWlanWizardManual::tc_scan_succesful_press_cancel_at_summary()
       
   134 {
       
   135 #ifdef tc_scan_succesful_press_cancel_at_summary_enabled
       
   136     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false);
       
   137 
       
   138     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   139     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   140     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   141     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   142     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   143     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   144 
       
   145     mView->showWizard();
       
   146     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   147     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   148     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   149     QTest::qWait(WaitTimeForUi);
       
   150     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   151     QTest::qWait(WaitTimeForUi);
       
   152     QCOMPARE( mouseClickObject("dialog"), true );
       
   153     QTest::qWait(WaitTimeForUi);
       
   154     QCOMPARE( mouseClickNext(), true );
       
   155 
       
   156     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   157     QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );  
       
   158     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   159     QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   160     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
   161     // Currently against the spec in http://wikis.in.nokia.com/pub/UXD/101ConnectionManager/occ_logical_flows_and_wireframes.pdf
       
   162     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true );
       
   163 
       
   164     QCOMPARE( mouseClickCancel(), true );
       
   165 
       
   166     QTest::qWait(WaitTimeForUi);
       
   167 
       
   168 #endif
       
   169 }
       
   170 
       
   171 /*!
       
   172  * 
       
   173  */
       
   174 void TestWlanWizardManual::tc_press_previous_at_scanning_page()
       
   175 {
       
   176 #ifdef tc_press_previous_at_scanning_page_enabled
       
   177     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false);
       
   178 
       
   179     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   180     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   181     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   182     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   183     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   184     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   185 
       
   186     mView->showWizard();
       
   187     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   188     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   189     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   190     QTest::qWait(WaitTimeForUi);
       
   191     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   192     QTest::qWait(WaitTimeForUi);
       
   193     QCOMPARE( mouseClickObject("dialog"), true );
       
   194     QTest::qWait(WaitTimeForUi);
       
   195     QCOMPARE( mouseClickNext(), true );
       
   196 
       
   197     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   198     QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );  
       
   199 
       
   200     // Click previous button and next again
       
   201     QCOMPARE( mouseClickPrevious(), true );
       
   202     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   203     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
       
   204     QTest::qWait(WaitTimeForUi);
       
   205     QCOMPARE( mouseClickNext(), true );
       
   206 
       
   207     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   208     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   209     QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   210     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
   211     // Currently against the spec in http://wikis.in.nokia.com/pub/UXD/101ConnectionManager/occ_logical_flows_and_wireframes.pdf
       
   212     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true );
       
   213 
       
   214 #endif
       
   215 }
       
   216 
       
   217 /*!
       
   218  * 
       
   219  */
       
   220 void TestWlanWizardManual::tc_scan_succesful_go_to_summary_and_finish()
       
   221 {
       
   222 #ifdef tc_scan_succesful_go_to_summary_and_finish_enabled
       
   223     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false);
       
   224 
       
   225     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   226     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   227     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   228     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   229     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   230 
       
   231     mView->showWizard();
       
   232     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   233     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   234     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   235     QTest::qWait(WaitTimeForUi);
       
   236     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   237     QTest::qWait(WaitTimeForUi);
       
   238     QCOMPARE( mouseClickObject("dialog"), true );
       
   239     QTest::qWait(WaitTimeForUi);
       
   240     QCOMPARE( mouseClickNext(), true );
       
   241 
       
   242     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   243     QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true ); 
       
   244     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   245     QCOMPARE( verifyActionButtons(ButtonDisabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   246     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
   247     // Currently against the spec in http://wikis.in.nokia.com/pub/UXD/101ConnectionManager/occ_logical_flows_and_wireframes.pdf
       
   248     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true );
       
   249     QCOMPARE( mouseClickFinish(), true );
       
   250 #endif
       
   251 }
       
   252 
       
   253 /*!
       
   254  * Stop verifying buttons for views that have been already verified.
       
   255  */
       
   256 void TestWlanWizardManual::tc_wep_pwd_too_short_error_label()
       
   257 {
       
   258 #ifdef tc_wep_pwd_too_short_error_label_enabled
       
   259     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWep, false, false);
       
   260 
       
   261     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   262     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   263     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   264     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   265     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   266     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   267 
       
   268     mView->showWizard();
       
   269     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   270     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   271     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   272     QTest::qWait(WaitTimeForUi);
       
   273     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   274     QTest::qWait(WaitTimeForUi);
       
   275     QCOMPARE( mouseClickObject("dialog"), true );
       
   276     QTest::qWait(WaitTimeForUi);
       
   277     QCOMPARE( mouseClickNext(), true );
       
   278 
       
   279     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   280     
       
   281     // Key query short pwd
       
   282     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageKeyQuery, "huuhaa3421"), true );
       
   283     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   284     QTest::qWait(WaitTimeForUi);
       
   285     QCOMPARE( insertTextToObject("lineEditKey", "password"), true );
       
   286     QTest::qWait(WaitTimeForUi);
       
   287     QCOMPARE( mouseClickNext(), true );
       
   288     QTest::qWait(WaitTimeForUi);
       
   289     QCOMPARE( verifyDialogText("labelErrorNote", hbTrId("txt_occ_dialog_key_is_of_incorrect_length_please")), true );
       
   290     QCOMPARE( mouseClickObject("dialog"), true );
       
   291     QTest::qWait(WaitTimeForUi);
       
   292 
       
   293     // Key query success
       
   294     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   295     QTest::qWait(WaitTimeForUi);
       
   296     QCOMPARE( verifyDialogText("labelErrorNote", ""), true );
       
   297     QCOMPARE( insertTextToObject("lineEditKey", "12345"), true );
       
   298     QTest::qWait(WaitTimeForUi);
       
   299     QCOMPARE( mouseClickNext(), true );
       
   300 
       
   301     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   302     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
   303 #endif
       
   304 }
       
   305 
       
   306 /*!
       
   307  * 
       
   308  */
       
   309 void TestWlanWizardManual::tc_press_previous_at_key_query()
       
   310 {
       
   311 #ifdef tc_press_previous_at_key_query_enabled
       
   312     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWep, false, false);
       
   313 
       
   314     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   315     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   316     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   317     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   318     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   319     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   320 
       
   321     mView->showWizard();
       
   322     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   323     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   324     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   325     QTest::qWait(WaitTimeForUi);
       
   326     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   327     QTest::qWait(WaitTimeForUi);
       
   328     QCOMPARE( mouseClickObject("dialog"), true );
       
   329     QTest::qWait(WaitTimeForUi);
       
   330     QCOMPARE( mouseClickNext(), true );
       
   331 
       
   332     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   333     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageKeyQuery, "huuhaa3421"), true );
       
   334     QCOMPARE( mouseClickPrevious(), true );
       
   335     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   336     QCOMPARE( mouseClickNext(), true );
       
   337 
       
   338     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageKeyQuery, "huuhaa3421"), true );
       
   339 #endif
       
   340 }
       
   341 
       
   342 /*!
       
   343  * 
       
   344  */
       
   345 void TestWlanWizardManual::tc_manual_selection_with_press_previous()
       
   346 {
       
   347 #ifdef tc_manual_selection_with_press_previous_enabled
       
   348 
       
   349     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   350     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   351     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   352     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   353     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   354 
       
   355     mView->showWizard();
       
   356     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   357     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   358     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   359     QTest::qWait(WaitTimeForUi);
       
   360     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   361     QTest::qWait(WaitTimeForUi);
       
   362     QCOMPARE( mouseClickObject("dialog"), true );
       
   363     QTest::qWait(WaitTimeForUi);
       
   364     QCOMPARE( mouseClickNext(), true );
       
   365     QTest::qWait(WaitTimeForUi);
       
   366     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   367     QTest::qWait(WaitTimeForUi);
       
   368     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true );
       
   369     QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   370     QTest::qWait(WaitTimeForUi);
       
   371     QCOMPARE( mouseClickPrevious(), true );
       
   372     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   373     QCOMPARE( mouseClickNext(), true );
       
   374     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageNetworkMode, "huuhaa3421"), true );
       
   375     QCOMPARE( selectRadioButton( "list", 0 ), true );
       
   376     QTest::qWait(WaitTimeForUi);
       
   377     QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
       
   378     QCOMPARE( mouseClickNext(), true );
       
   379 
       
   380     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageNetworkSecurity, "huuhaa3421"), true );
       
   381     QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true ); 
       
   382     QCOMPARE( mouseClickPrevious(), true );
       
   383     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageNetworkMode, "huuhaa3421"), true );
       
   384     QCOMPARE( mouseClickNext(), true );
       
   385     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageNetworkSecurity, "huuhaa3421"), true );
       
   386     QCOMPARE( selectRadioButton( "list", 0 ), true );
       
   387     QTest::qWait(WaitTimeForUi);
       
   388     QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
       
   389     QCOMPARE( mouseClickNext(), true );
       
   390     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
   391     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true );
       
   392 #endif    
       
   393 }
       
   394 
       
   395 /*!
       
   396  * 
       
   397  */
       
   398 void TestWlanWizardManual::tc_illegal_characters_in_wep_key()
       
   399 {
       
   400 #ifdef tc_illegal_characters_in_wep_key_enabled
       
   401     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWep, false, false);
       
   402 
       
   403     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   404     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   405     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   406     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   407     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   408     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   409 
       
   410     mView->showWizard();
       
   411     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   412     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   413     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   414     QTest::qWait(WaitTimeForUi);
       
   415     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   416     QTest::qWait(WaitTimeForUi);
       
   417     QCOMPARE( mouseClickObject("dialog"), true );
       
   418     QTest::qWait(WaitTimeForUi);
       
   419     QCOMPARE( mouseClickNext(), true );
       
   420 
       
   421     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   422     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageKeyQuery, "huuhaa3421"), true );
       
   423     
       
   424     QCOMPARE( insertTextToObject("lineEditKey", "passworddd"), true );
       
   425     QTest::qWait(WaitTimeForUi);
       
   426     QCOMPARE( mouseClickNext(), true );
       
   427     QTest::qWait(WaitTimeForUi);
       
   428     QCOMPARE( verifyDialogText("labelErrorNote", hbTrId("txt_occ_dialog_illegal_characters_in_key_please_c")), true );
       
   429     QTest::qWait(WaitTimeForUi);
       
   430 
       
   431 #endif
       
   432 }
       
   433 
       
   434 /*!
       
   435  * 
       
   436  */
       
   437 void TestWlanWizardManual::tc_too_short_wpa_key()
       
   438 {
       
   439 #ifdef tc_too_short_wpa_key_enabled
       
   440     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, true, false);
       
   441 
       
   442     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   443     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   444     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   445     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   446     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   447     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   448 
       
   449     mView->showWizard();
       
   450     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   451     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   452     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   453     QTest::qWait(WaitTimeForUi);
       
   454     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   455     QTest::qWait(WaitTimeForUi);
       
   456     QCOMPARE( mouseClickObject("dialog"), true );
       
   457     QTest::qWait(WaitTimeForUi);
       
   458     QCOMPARE( mouseClickNext(), true );
       
   459 
       
   460     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   461     QTest::qWait(2000);
       
   462     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageKeyQuery, "huuhaa3421"), true );
       
   463     
       
   464     QCOMPARE( insertTextToObject("lineEditKey", "1234"), true );
       
   465     QTest::qWait(WaitTimeForUi);
       
   466     QCOMPARE( mouseClickNext(), true );
       
   467     QTest::qWait(WaitTimeForUi);
       
   468     QCOMPARE( verifyDialogText("labelErrorNote", hbTrId("txt_occ_dialog_preshared_key_too_short_at_least")), true );
       
   469     QTest::qWait(WaitTimeForUi);
       
   470 #endif
       
   471 }
       
   472 
       
   473 /*!
       
   474  * wpa psk
       
   475  */
       
   476 void TestWlanWizardManual::tc_wpa_psk_success()
       
   477 {
       
   478 #ifdef tc_wpa_psk_success_enabled
       
   479     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, true, false);
       
   480 
       
   481     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   482     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   483     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   484     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   485     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   486     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   487 
       
   488     mView->showWizard();
       
   489     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   490     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   491     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   492     QTest::qWait(WaitTimeForUi);
       
   493     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   494     QTest::qWait(WaitTimeForUi);
       
   495     QCOMPARE( mouseClickObject("dialog"), true );
       
   496     QTest::qWait(WaitTimeForUi);
       
   497     QCOMPARE( mouseClickNext(), true );
       
   498 
       
   499     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   500     QTest::qWait(2000);
       
   501     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageKeyQuery, "huuhaa3421"), true );
       
   502 
       
   503     QCOMPARE( insertTextToObject("lineEditKey", "1234567890"), true );
       
   504     QTest::qWait(WaitTimeForUi);
       
   505     QCOMPARE( mouseClickNext(), true );
       
   506     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   507     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
   508 #endif
       
   509 }
       
   510 
       
   511 /*!
       
   512  * no wpa psk
       
   513  */
       
   514 void TestWlanWizardManual::tc_wpa_no_psk_go_to_eap_start()
       
   515 {
       
   516 #ifdef tc_wpa_no_psk_go_to_eap_start_enabled
       
   517     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false);
       
   518 
       
   519     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   520     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   521     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   522     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   523     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   524     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   525 
       
   526     mView->showWizard();
       
   527     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   528     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   529     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   530     QTest::qWait(WaitTimeForUi);
       
   531     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   532     QTest::qWait(WaitTimeForUi);
       
   533     QCOMPARE( mouseClickObject("dialog"), true );
       
   534     QTest::qWait(WaitTimeForUi);
       
   535     QCOMPARE( mouseClickNext(), true );
       
   536 
       
   537     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   538     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageEapStart), true );
       
   539     QCOMPARE( mouseClickPrevious(), true );
       
   540     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   541     QCOMPARE( mouseClickNext(), true );
       
   542     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   543     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageEapStart), true );    
       
   544 #endif
       
   545 }
       
   546 
       
   547 /*!
       
   548  * wpa2 psk
       
   549  */
       
   550 void TestWlanWizardManual::tc_wpa2_psk_success()
       
   551 {
       
   552 #ifdef tc_wpa2_psk_success_enabled
       
   553     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa2, true, false);
       
   554 
       
   555     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   556     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   557     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   558     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   559     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   560     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   561 
       
   562     mView->showWizard();
       
   563     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   564     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   565     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   566     QTest::qWait(WaitTimeForUi);
       
   567     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   568     QTest::qWait(WaitTimeForUi);
       
   569     QCOMPARE( mouseClickObject("dialog"), true );
       
   570     QTest::qWait(WaitTimeForUi);
       
   571     QCOMPARE( mouseClickNext(), true );
       
   572 
       
   573     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   574     QTest::qWait(2000);
       
   575     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageKeyQuery, "huuhaa3421"), true );
       
   576 
       
   577     QCOMPARE( insertTextToObject("lineEditKey", "1234567890"), true );
       
   578     QTest::qWait(WaitTimeForUi);
       
   579     QCOMPARE( mouseClickNext(), true );
       
   580     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   581     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
   582 #endif
       
   583 }
       
   584 
       
   585 /*!
       
   586  * wpa2 no psk
       
   587  */
       
   588 void TestWlanWizardManual::tc_wpa2_no_psk_go_to_eap_start()
       
   589 {
       
   590 #ifdef tc_wpa2_no_psk_go_to_eap_start_enabled
       
   591     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa2, false, false);
       
   592 
       
   593     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   594     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   595     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   596     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   597     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   598     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   599 
       
   600     mView->showWizard();
       
   601     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   602     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   603     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   604     QTest::qWait(WaitTimeForUi);
       
   605     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   606     QTest::qWait(WaitTimeForUi);
       
   607     QCOMPARE( mouseClickObject("dialog"), true );
       
   608     QTest::qWait(WaitTimeForUi);
       
   609     QCOMPARE( mouseClickNext(), true );
       
   610 
       
   611     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   612     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageEapStart), true );
       
   613 #endif
       
   614 }
       
   615 
       
   616 /*!
       
   617  * Wlan network closed -> generic error
       
   618  */
       
   619 void TestWlanWizardManual::tc_network_closed_generic_error()
       
   620 {
       
   621 #ifdef tc_network_closed_generic_error_enabled
       
   622     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false);
       
   623 
       
   624     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   625     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   626     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   627     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   628     mWlanQtUtilsContext->setSignalWlanNetworkClosed(100, 1);
       
   629     mWlanQtUtilsContext->setConnectionSuccessed(false);
       
   630 
       
   631     mView->showWizard();
       
   632     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   633     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   634     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   635     QTest::qWait(WaitTimeForUi);
       
   636     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   637     QTest::qWait(WaitTimeForUi);
       
   638     QCOMPARE( mouseClickObject("dialog"), true );
       
   639     QTest::qWait(WaitTimeForUi);
       
   640     QCOMPARE( mouseClickNext(), true );
       
   641 
       
   642     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   643     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   644     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageGenericError, hbTrId("txt_occ_dialog_connection_failed")), true );
       
   645     
       
   646 #endif
       
   647 }
       
   648 
       
   649 /*!
       
   650  * adhoc no psk
       
   651  */
       
   652 void TestWlanWizardManual::tc_adhoc_network_no_psk()
       
   653 {
       
   654 #ifdef tc_adhoc_network_no_psk_enabled
       
   655     mApList->Add("huuhaa3421", CMManagerShim::Adhoc, CMManagerShim::WlanSecModeOpen, false, false);
       
   656 
       
   657     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   658     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   659     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   660     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   661     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   662     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   663 
       
   664     mView->showWizard();
       
   665     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   666     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   667     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   668     QTest::qWait(WaitTimeForUi);
       
   669     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   670     QTest::qWait(WaitTimeForUi);
       
   671     QCOMPARE( mouseClickObject("dialog"), true );
       
   672     QTest::qWait(WaitTimeForUi);
       
   673     QCOMPARE( mouseClickNext(), true );
       
   674 
       
   675     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   676     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   677     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
   678     
       
   679 #endif
       
   680 }
       
   681 
       
   682 /*!
       
   683  * 802_1x
       
   684  */
       
   685 void TestWlanWizardManual::tc_secmode_802_1x_go_to_eap_start()
       
   686 {
       
   687 #ifdef tc_secmode_802_1x_go_to_eap_start_enabled
       
   688     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecMode802_1x, false, false);
       
   689 
       
   690     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   691     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   692     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   693     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   694     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   695     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   696 
       
   697     mView->showWizard();
       
   698     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   699     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   700     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   701     QTest::qWait(WaitTimeForUi);
       
   702     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   703     QTest::qWait(WaitTimeForUi);
       
   704     QCOMPARE( mouseClickObject("dialog"), true );
       
   705     QTest::qWait(WaitTimeForUi);
       
   706     QCOMPARE( mouseClickNext(), true );
       
   707 
       
   708     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   709     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageEapStart), true );
       
   710 #endif
       
   711 }
       
   712 
       
   713 /*!
       
   714  * Wapi
       
   715  */
       
   716 void TestWlanWizardManual::tc_sec_mode_wapi()
       
   717 {
       
   718 #ifdef tc_sec_mode_wapi_enabled
       
   719     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWapi, false, false);
       
   720 
       
   721     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   722     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   723     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   724     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   725     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   726     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   727 
       
   728     mView->showWizard();
       
   729     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   730     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   731     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   732     QTest::qWait(WaitTimeForUi);
       
   733     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   734     QTest::qWait(WaitTimeForUi);
       
   735     QCOMPARE( mouseClickObject("dialog"), true );
       
   736     QTest::qWait(WaitTimeForUi);
       
   737     QCOMPARE( mouseClickNext(), true );
       
   738 
       
   739     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   740     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   741     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
   742 #endif
       
   743 }
       
   744 
       
   745 /*!
       
   746  * Multiple AP scan match results
       
   747  */
       
   748 void TestWlanWizardManual::tc_multiple_open_scan_results_single_match()
       
   749 {
       
   750 #ifdef tc_multiple_open_scan_results_single_match_enabled
       
   751     mApOpenList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
   752     mApOpenList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false, 400);
       
   753     mApOpenList->Add("foobar", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false, 300);
       
   754     mApOpenList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false, 200);
       
   755 
       
   756     mApList->Add("foobar", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false, 300);
       
   757     
       
   758     mWlanQtUtilsContext->setScanWlanApsResult(mApOpenList->List());
       
   759     mWlanQtUtilsContext->setScanWlanDirectResult("foobar", mApList->List());
       
   760     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   761     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   762     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   763     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   764 
       
   765     mView->showWizard();
       
   766     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   767     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   768     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   769     QTest::qWait(WaitTimeForUi);
       
   770     QCOMPARE( insertTextToObject("lineEditKey", "foobar"), true );
       
   771     QTest::qWait(WaitTimeForUi);
       
   772     QCOMPARE( mouseClickObject("dialog"), true );
       
   773     QTest::qWait(WaitTimeForUi);
       
   774     QCOMPARE( mouseClickNext(), true );
       
   775 
       
   776     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "foobar"), true );
       
   777     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "foobar"), true );
       
   778     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
   779 #endif
       
   780 }
       
   781 
       
   782 /*!
       
   783  * 
       
   784  */
       
   785 void TestWlanWizardManual::tc_iap_creation_fail()
       
   786 {
       
   787 #ifdef tc_iap_creation_fail_enabled
       
   788     
       
   789     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   790     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   791     mWlanQtUtilsContext->setCreateWlanIapResult(-1);
       
   792     
       
   793     mView->showWizard();
       
   794     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   795     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   796     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   797     QTest::qWait(WaitTimeForUi);
       
   798     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   799     QTest::qWait(WaitTimeForUi);
       
   800     QCOMPARE( mouseClickObject("dialog"), true );
       
   801     QTest::qWait(WaitTimeForUi);
       
   802     QCOMPARE( mouseClickNext(), true );
       
   803 
       
   804     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   805     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true );
       
   806     
       
   807     QStringList buttons;
       
   808     buttons << hbTrId("txt_occ_dblist_val_infrastructure_public") 
       
   809             << hbTrId("txt_occ_list_infrastructure_hidden") 
       
   810             << hbTrId("txt_occ_list_adhoc_1");
       
   811     QCOMPARE( verifyRadioButtons("list"), buttons );
       
   812 
       
   813     QCOMPARE( selectRadioButton( "list", 2 ), true );
       
   814     QTest::qWait(WaitTimeForUi);
       
   815     QCOMPARE( mouseClickPrevious(), true );
       
   816     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   817     QCOMPARE( mouseClickNext(), true );
       
   818     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   819     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true );
       
   820     QCOMPARE( verifySelectedRadioButton("list"), ListNoneSelected );
       
   821     QCOMPARE( selectRadioButton( "list", 2 ), true );
       
   822     QTest::qWait(WaitTimeForUi);
       
   823     QCOMPARE( mouseClickNext(), true );
       
   824     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageNetworkSecurity, "huuhaa3421"), true );
       
   825     
       
   826     buttons.clear();
       
   827     buttons << hbTrId("txt_occ_list_open") 
       
   828             << hbTrId("txt_occ_list_wep_1");
       
   829     QCOMPARE( verifyRadioButtons("list"), buttons );
       
   830     
       
   831     QCOMPARE( selectRadioButton( "list", 0 ), true );
       
   832     QTest::qWait(WaitTimeForUi);
       
   833     QCOMPARE( mouseClickNext(), true );
       
   834     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageGenericError, hbTrId("txt_occ_dialog_unable_to_save_settings_please_ret")), true );
       
   835 #endif
       
   836 }
       
   837 
       
   838 /*!
       
   839  * 
       
   840  */
       
   841 void TestWlanWizardManual::tc_scan_ap_status_not_ok()
       
   842 {
       
   843 #ifdef tc_scan_ap_status_not_ok_enabled
       
   844     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false);
       
   845 
       
   846     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   847     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   848     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   849     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   850     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   851     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   852 
       
   853     mWlanQtUtilsContext->setScanApStatus(WlanQtUtils::ScanStatusError);
       
   854     mView->showWizard();
       
   855     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   856     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   857     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   858     QTest::qWait(WaitTimeForUi);
       
   859     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   860     QTest::qWait(WaitTimeForUi);
       
   861     QCOMPARE( mouseClickObject("dialog"), true );
       
   862     QTest::qWait(WaitTimeForUi);
       
   863     QCOMPARE( mouseClickNext(), true );
       
   864 
       
   865     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   866     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true );
       
   867 #endif
       
   868 }
       
   869     
       
   870 /*!
       
   871  * 
       
   872  */
       
   873 void TestWlanWizardManual::tc_scan_direct_status_not_ok()
       
   874 {
       
   875 #ifdef tc_scan_direct_status_not_ok_enabled
       
   876     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false);
       
   877 
       
   878     mWlanQtUtilsContext->setScanWlanApsResult(mApList->List());
       
   879     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   880     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   881     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
   882     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   883     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   884 
       
   885     //mWlanQtUtilsContext->setImmediateApScanResult(false);
       
   886     mWlanQtUtilsContext->setScanDirectStatus(WlanQtUtils::ScanStatusError);
       
   887     mView->showWizard();
       
   888     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   889     QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
       
   890     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   891     QTest::qWait(WaitTimeForUi);
       
   892     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   893     QTest::qWait(WaitTimeForUi);
       
   894     QCOMPARE( mouseClickObject("dialog"), true );
       
   895     QTest::qWait(WaitTimeForUi);
       
   896     QCOMPARE( mouseClickNext(), true );
       
   897 
       
   898     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   899     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true );
       
   900 #endif
       
   901 }
       
   902 
       
   903 /*!
       
   904  * Ict Result enumerator used. Hotspot.
       
   905  */
       
   906 void TestWlanWizardManual::tc_ictresult_enumerated_hotspot()
       
   907 {
       
   908 #ifdef tc_ictresult_enumerated_hotspot_enabled
       
   909     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false, 400);
       
   910     
       
   911     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   912     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   913     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctHotspotPassed);
       
   914     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   915     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   916 
       
   917     mView->showWizard();
       
   918     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   919     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   920     QTest::qWait(1000);
       
   921     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   922     QTest::qWait(1000);
       
   923     QCOMPARE( mouseClickObject("dialog"), true );
       
   924     QTest::qWait(1000);
       
   925     QCOMPARE( mouseClickNext(), true );
       
   926 
       
   927     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   928     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   929     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
   930     QTest::qWait(5000);
       
   931 #endif
       
   932 }
       
   933 
       
   934 /*!
       
   935  * Ict Result enumerator used. Ict canceled.
       
   936  */
       
   937 void TestWlanWizardManual::tc_ictresult_enumerated_cancel()
       
   938 {
       
   939 #ifdef tc_ictresult_enumerated_cancel_enabled
       
   940     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false, 400);
       
   941     
       
   942     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   943     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   944     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctCancelled);
       
   945     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   946     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   947 
       
   948     mView->showWizard();
       
   949     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   950     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   951     QTest::qWait(1000);
       
   952     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   953     QTest::qWait(1000);
       
   954     QCOMPARE( mouseClickObject("dialog"), true );
       
   955     QTest::qWait(1000);
       
   956     QCOMPARE( mouseClickNext(), true );
       
   957 
       
   958     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
   959     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
   960 #endif
       
   961 }
       
   962 
       
   963 /*!
       
   964  * Ict fails in this case
       
   965  */
       
   966 void TestWlanWizardManual::tc_multiple_ssids_with_same_name_2_netmode_options()
       
   967 {
       
   968 #ifdef tc_multiple_ssids_with_same_name_2_netmode_options_enabled
       
   969     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
   970     // Add duplicates
       
   971     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
   972     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
   973     
       
   974     // Add all five kinds of security modes.
       
   975     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, true, false, 500);
       
   976     mApList->Add("huuhaa3421", CMManagerShim::Adhoc, CMManagerShim::WlanSecModeOpen, false, false, 400);
       
   977     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWep, false, false, 300);
       
   978     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecMode802_1x, false, false, 200);
       
   979     
       
   980     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
   981     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
   982     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctFailed);
       
   983     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
   984     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
   985     
       
   986     mView->showWizard();
       
   987 
       
   988     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
   989     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
   990     QTest::qWait(WaitTimeForUi);
       
   991     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
   992     QTest::qWait(WaitTimeForUi);
       
   993     QCOMPARE( mouseClickObject("dialog"), true );
       
   994     QTest::qWait(WaitTimeForUi);
       
   995     QCOMPARE( mouseClickNext(), true );
       
   996 
       
   997     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true );
       
   998     QStringList buttons;
       
   999     buttons << hbTrId("txt_occ_list_infrastructure_hidden") 
       
  1000             << hbTrId("txt_occ_list_adhoc_1");
       
  1001     QCOMPARE( verifyRadioButtons("list"), buttons );
       
  1002     
       
  1003     QTest::qWait(WaitTimeForUi);
       
  1004     QCOMPARE( selectRadioButton( "list", 1 ), true );
       
  1005     QTest::qWait(WaitTimeForUi);
       
  1006     QCOMPARE( mouseClickNext(), true );
       
  1007     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, "huuhaa3421"), true );
       
  1008     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
       
  1009 #endif
       
  1010 }
       
  1011 
       
  1012 /*!
       
  1013  * 
       
  1014  */
       
  1015 void TestWlanWizardManual::tc_multiple_ssids_with_same_name_press_previous()
       
  1016 {
       
  1017 #ifdef tc_multiple_ssids_with_same_name_press_previous_enabled
       
  1018     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1019     // Add duplicates
       
  1020     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1021     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1022 
       
  1023     // Add all five kinds of security modes.
       
  1024     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, true, false, 500);
       
  1025     mApList->Add("huuhaa3421", CMManagerShim::Adhoc, CMManagerShim::WlanSecModeOpen, false, false, 400);
       
  1026     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWep, true, false, 300);
       
  1027     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecMode802_1x, false, false, 200);
       
  1028 
       
  1029     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
  1030     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
  1031     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
  1032     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
  1033     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
  1034 
       
  1035     mView->showWizard();
       
  1036 
       
  1037     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
  1038     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
  1039     QTest::qWait(WaitTimeForUi);
       
  1040     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
  1041     QTest::qWait(WaitTimeForUi);
       
  1042     QCOMPARE( mouseClickObject("dialog"), true );
       
  1043     QTest::qWait(WaitTimeForUi);
       
  1044     QCOMPARE( mouseClickNext(), true );
       
  1045 
       
  1046     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true );
       
  1047     QTest::qWait(WaitTimeForUi);
       
  1048     QCOMPARE( selectRadioButton( "list", 0 ), true );
       
  1049     QTest::qWait(WaitTimeForUi);
       
  1050     QCOMPARE( mouseClickNext(), true );
       
  1051 
       
  1052     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkSecurity), true );
       
  1053     QCOMPARE( mouseClickPrevious(), true );
       
  1054     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true );
       
  1055     QCOMPARE( mouseClickNext(), true );
       
  1056     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkSecurity), true );
       
  1057     QCOMPARE( selectRadioButton( "list", 1 ), true );
       
  1058     QTest::qWait(WaitTimeForUi);
       
  1059     QCOMPARE( mouseClickNext(), true );
       
  1060 
       
  1061     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageKeyQuery, "huuhaa3421"), true );
       
  1062 #endif
       
  1063 }
       
  1064 
       
  1065 /*!
       
  1066  * 
       
  1067  */
       
  1068 void TestWlanWizardManual::tc_multiple_ssids_with_same_name_all_sec_modes()
       
  1069 {
       
  1070 #ifdef tc_multiple_ssids_with_same_name_all_sec_modes_enabled
       
  1071     mApOpenList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1072     // Add duplicates
       
  1073     mApOpenList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1074 
       
  1075     // Add all five kinds of security modes.
       
  1076     mApOpenList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, true, false, 500);
       
  1077     mApOpenList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa2, true, false, 500);
       
  1078     mApOpenList->Add("huuhaa3421", CMManagerShim::Adhoc, CMManagerShim::WlanSecModeOpen, false, false, 400);
       
  1079     mApOpenList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecMode802_1x, false, false, 200);
       
  1080     mApOpenList->Add("dippadappa", CMManagerShim::Infra, CMManagerShim::WlanSecModeOpen, false, false, 200);
       
  1081     
       
  1082     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1083     // Add duplicates
       
  1084     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1085     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1086 
       
  1087     // Add all five kinds of security modes.
       
  1088     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, true, false, 500);
       
  1089     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa2, true, false, 500);
       
  1090     mApList->Add("huuhaa3421", CMManagerShim::Adhoc, CMManagerShim::WlanSecModeOpen, false, false, 400);
       
  1091     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWep, true, false, 300);
       
  1092     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecMode802_1x, false, false, 200);
       
  1093 
       
  1094     mWlanQtUtilsContext->setScanWlanApsResult(mApOpenList->List());
       
  1095     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
  1096     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
  1097     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
  1098     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
  1099     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
  1100 
       
  1101     mView->showWizard();
       
  1102 
       
  1103     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
  1104     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
  1105     QTest::qWait(WaitTimeForUi);
       
  1106     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
  1107     QTest::qWait(WaitTimeForUi);
       
  1108     QCOMPARE( mouseClickObject("dialog"), true );
       
  1109     QTest::qWait(WaitTimeForUi);
       
  1110     QCOMPARE( mouseClickNext(), true );
       
  1111 
       
  1112     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true );
       
  1113     QStringList buttons;
       
  1114     buttons << hbTrId("txt_occ_dblist_val_infrastructure_public") 
       
  1115             << hbTrId("txt_occ_list_infrastructure_hidden") 
       
  1116             << hbTrId("txt_occ_list_adhoc_1");
       
  1117     QCOMPARE( verifyRadioButtons("list"), buttons );
       
  1118     QTest::qWait(WaitTimeForUi);
       
  1119     QCOMPARE( selectRadioButton( "list", 0 ), true );
       
  1120     QTest::qWait(WaitTimeForUi);
       
  1121     QCOMPARE( mouseClickNext(), true );
       
  1122 
       
  1123     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkSecurity), true );
       
  1124     QCOMPARE( mouseClickPrevious(), true );
       
  1125     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true );
       
  1126     QCOMPARE( mouseClickNext(), true );
       
  1127     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkSecurity), true );
       
  1128     QCOMPARE( selectRadioButton( "list", 0 ), true );
       
  1129     QTest::qWait(WaitTimeForUi);
       
  1130     QCOMPARE( mouseClickNext(), true );
       
  1131 
       
  1132     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageKeyQuery, "huuhaa3421"), true );
       
  1133 #endif
       
  1134 }
       
  1135    
       
  1136 /*!
       
  1137  * 
       
  1138  */
       
  1139 void TestWlanWizardManual::tc_multiple_ssids_with_same_name_orientation_switch()
       
  1140 {
       
  1141 #ifdef tc_multiple_ssids_with_same_name_orientation_switch_enabled
       
  1142     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1143     // Add duplicates
       
  1144     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1145     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1146 
       
  1147     // Add all five kinds of security modes.
       
  1148     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, true, false, 500);
       
  1149     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecModeWep, true, false, 300);
       
  1150     mApList->Add("huuhaa3421", CMManagerShim::Infra, CMManagerShim::WlanSecMode802_1x, false, false, 200);
       
  1151 
       
  1152     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa3421", mApList->List());
       
  1153     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
  1154     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
  1155     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
  1156     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
  1157 
       
  1158     mView->showWizard();
       
  1159 
       
  1160     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
  1161     
       
  1162     mMainWindow->setOrientation(Qt::Horizontal, false);
       
  1163     QTest::qWait(WaitTimeForUi);
       
  1164     mMainWindow->setOrientation(Qt::Vertical, false);
       
  1165     QTest::qWait(WaitTimeForUi);
       
  1166 
       
  1167     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
  1168     QTest::qWait(WaitTimeForUi);
       
  1169     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa3421"), true );
       
  1170     QTest::qWait(WaitTimeForUi);
       
  1171     QCOMPARE( mouseClickObject("dialog"), true );
       
  1172     QTest::qWait(WaitTimeForUi);
       
  1173     QCOMPARE( mouseClickNext(), true );
       
  1174 
       
  1175     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true );
       
  1176     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkSecurity), true );
       
  1177     QCOMPARE( selectRadioButton( "list", 0 ), true );
       
  1178     QTest::qWait(WaitTimeForUi);
       
  1179     QCOMPARE( mouseClickNext(), true );
       
  1180     
       
  1181     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageKeyQuery, "huuhaa3421"), true );
       
  1182 #endif
       
  1183 }
       
  1184 
       
  1185 /*!
       
  1186  * 
       
  1187  */
       
  1188 void TestWlanWizardManual::tc_multiple_ssids_with_same_name_wps_and_nonwps()
       
  1189 {
       
  1190 #ifdef tc_multiple_ssids_with_same_name_wps_and_nonwps_enabled
       
  1191     mApList->Add("huuhaa", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100);
       
  1192     
       
  1193     // Add all five kinds of security modes.
       
  1194     mApList->Add("huuhaa", CMManagerShim::Infra, CMManagerShim::WlanSecModeWep, true, true, 300);
       
  1195     
       
  1196     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa", mApList->List());
       
  1197     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
  1198     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
  1199     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
  1200     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
  1201 
       
  1202     mView->showWizard();
       
  1203 
       
  1204     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
  1205 
       
  1206     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
  1207     QTest::qWait(WaitTimeForUi);
       
  1208     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa"), true );
       
  1209     QTest::qWait(WaitTimeForUi);
       
  1210     QCOMPARE( mouseClickObject("dialog"), true );
       
  1211     QTest::qWait(WaitTimeForUi);
       
  1212     QCOMPARE( mouseClickNext(), true );
       
  1213 
       
  1214     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa"), true );
       
  1215     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true );
       
  1216     QStringList buttons;
       
  1217     buttons << hbTrId("txt_occ_list_infrastructure_hidden") 
       
  1218             << hbTrId("txt_occ_list_wifi_protected_setup");
       
  1219     QCOMPARE( verifyRadioButtons("list"), buttons );
       
  1220     QCOMPARE( selectRadioButton( "list", 1 ), true );
       
  1221     QTest::qWait(WaitTimeForUi);
       
  1222     QCOMPARE( mouseClickNext(), true );
       
  1223 
       
  1224     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageWpsStart), true );
       
  1225 #endif 
       
  1226 }
       
  1227 
       
  1228 /*!
       
  1229  * 
       
  1230  */
       
  1231 void TestWlanWizardManual::tc_multiple_ssids_with_same_name_two_wps_aps()
       
  1232 {
       
  1233 #ifdef tc_multiple_ssids_with_same_name_two_wps_aps_enabled
       
  1234     mApList->Add("huuhaa", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, true, 100);
       
  1235 
       
  1236     // Add all five kinds of security modes.
       
  1237     mApList->Add("huuhaa", CMManagerShim::Infra, CMManagerShim::WlanSecModeWep, true, true, 300);
       
  1238 
       
  1239     mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa", mApList->List());
       
  1240     mWlanQtUtilsContext->setCreateWlanIapResult(100);
       
  1241     mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed);
       
  1242     mWlanQtUtilsContext->setSignalWlanNetworkOpened(100);
       
  1243     mWlanQtUtilsContext->setConnectionSuccessed(true);
       
  1244 
       
  1245     mView->showWizard();
       
  1246 
       
  1247     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true );
       
  1248 
       
  1249     QCOMPARE( mouseClickObject("lineEditKey"), true );
       
  1250     QTest::qWait(WaitTimeForUi);
       
  1251     QCOMPARE( insertTextToObject("lineEditKey", "huuhaa"), true );
       
  1252     QTest::qWait(WaitTimeForUi);
       
  1253     QCOMPARE( mouseClickObject("dialog"), true );
       
  1254     QTest::qWait(WaitTimeForUi);
       
  1255     QCOMPARE( mouseClickNext(), true );
       
  1256 
       
  1257     QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa"), true );
       
  1258     QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageWpsStart), true );
       
  1259 #endif
       
  1260 }