[WiFi][Non-ACR][Don't need to connect an AP to test specific scan] 77/214477/2
authorCheoleun Moon <chleun.moon@samsung.com>
Mon, 23 Sep 2019 07:49:52 +0000 (16:49 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Mon, 23 Sep 2019 07:51:19 +0000 (16:51 +0900)
Change-Id: I035581cd81346a6cf7e96831b3a4d372848fc500
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
tct-suite-vs/Tizen.WiFi.Tests/testcase/TSWiFiManager.cs

index 6b29c8b..140841e 100755 (executable)
@@ -732,37 +732,26 @@ namespace Tizen.Network.WiFi.Tests
         {
             try
             {
-                /*
-                 * PRECONDITION
-                 */
-                await setUp();
+                var count = 0;
 
-                /*
-                 * TEST CODE
-                 */
-                var found = false;
-                const int MAX_SCAN_TRY = 3;
-                for (int i = 0; i < MAX_SCAN_TRY; i++)
+                if (!WiFiManager.IsActive)
                 {
-                    await WiFiManager.ScanSpecificAPAsync(networkParameter.wnPRIVATE1);
-                    var listAp = WiFiManager.GetFoundSpecificAPs();
-                    foreach (WiFiAP item in listAp)
-                    {
-                        if (item.NetworkInformation.Essid == networkParameter.wnPRIVATE1)
-                        {
-                            found = true;
-                        }
-                        item.Dispose();
-                    }
-                    if (found)
-                    {
-                        break;
-                    }
-                    await Task.Delay(1000);
+                    await WiFiManager.ActivateAsync();
+                }
+                await WiFiManager.ScanSpecificAPAsync(networkParameter.wnPRIVATE);
+                var listApp = WiFiManager.GetFoundSpecificAPs();
+                await Task.Delay(1500);
+                foreach (var item in listApp)
+                {
+                    count++;
+                    item.Dispose();
                 }
-                Assert.IsTrue(found, "ScanSpecificApAsync can't scan WiFi private");
+                Assert.Greater(count, 0, "ScanSpecificAPAsync fail");
 
                 Log.Info(Globals.LogTag, "Successfully done");
+
+                // POSTCONDITION
+                await setUp();
             }
             catch (NotSupportedException)
             {