[WiFi][TCSACR-203][manual][Add testcases for TimeoutException] 10/199410/3
authorCheoleun Moon <chleun.moon@samsung.com>
Mon, 11 Feb 2019 07:47:13 +0000 (16:47 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Tue, 12 Feb 2019 00:37:11 +0000 (09:37 +0900)
Change-Id: Ie34c44a22390aaacfe588e3b31fc3d81ed0ea0df
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
tct-suite-vs/Tizen.WiFi.Manual.Tests/testcase/TSWiFiAP.cs

index 0007b4e..b3ab6f3 100755 (executable)
@@ -254,6 +254,49 @@ namespace Tizen.Network.WiFi.Tests
                 Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
             }
         }
+
+        [Test]
+        [Category("P2")]
+        [Description("Check a connection to a WiFi AP by Wps")]
+        [Property("SPEC", "Tizen.Network.WiFi.WiFiAP.ConnectWpsWithoutSsidAsync M ")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MEX")]
+        [Property("AUTHOR", "Cheoleun Moon chleun.moon@samsung.com")]
+        [Precondition(1, "Activate WiFi")]
+        [Precondition(2, "Check if the device already connect to an AP. If so, forget it. There should not be any connected AP")]
+        [Step(1, "Tap the Run button")]
+        [Step(2, "Wait for TimeoutException (At most 3 minutes)")]
+        [Step(3, "Testcase will pass automatically if TimeoutException is successfully delivered")]
+        [Postcondition(1, "Forget the connected AP")]
+        [Postcondition(2, "Deactivate WiFi")]
+        public async Task ConnectWpsWithoutSsidAsync_TIMEOUT_EXCEPTION()
+        {
+            try
+            {
+                Log.Info(Globals.LogTag, "ConnectWpsWithoutSsidAsync_TIMEOUT_EXCEPTION");
+
+                WpsInfo info = new WpsPbcInfo();
+                await WiFiAP.ConnectWpsWithoutSsidAsync(info);
+
+                Assert.IsTrue(false, "TimeoutException should be thrown");
+            }
+            catch (NotSupportedException)
+            {
+                Assert.IsTrue(isWiFiSupported == false, "Invalid NotSupportedException");
+            }
+            catch (TypeInitializationException e)
+            {
+                Assert.IsTrue(isWiFiSupported == false && e.InnerException.GetType() == typeof(NotSupportedException), "Invalid NotSupportedException or TypeInitializationException");
+            }
+            catch (TimeoutException ex)
+            {
+                Assert.IsTrue(true, "Exception occurs. Msg: " + ex.ToString());
+            }
+            catch (Exception ex)
+            {
+                Assert.IsTrue(false, "Exception occurs. Msg: " + ex.ToString());
+            }
+        }
     }
 }