[Information][Auto/Manual][Non-ACR] Check some features' support before test 90/178790/1
authorKichan Kwon <k_c.kwon@samsung.com>
Mon, 14 May 2018 05:20:26 +0000 (14:20 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Mon, 14 May 2018 05:22:05 +0000 (14:22 +0900)
Change-Id: I2620e0ee43fa092487011694118d78822450c5bf
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
tct-suite-vs/Tizen.Information.Manual.Tests/testcase/TSInformation.cs
tct-suite-vs/Tizen.Information.Tests/testcase/TSInformation.cs

index ceba07f..3c9d4a5 100755 (executable)
@@ -626,11 +626,12 @@ namespace Tizen.System.Tests {
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "EVL")]
         [Property("AUTHOR", "Sehaj Singh Kalra, sehaj.kalra@samsung.com")]
-        [Precondition(1, "Charger should not be connected")]
+        [Precondition(1, "If the test target isn't a battery-powered device, pass is marked automatically as soon as you click Run button")]
+        [Precondition(2, "Charger should not be connected")]
         [Step(1, "Click Run button")]
         [Step(2, "Connect a battery charger to the phone")]
         public static async Task ChargerConnected_CHECK_CONNECTED() {
-            if (!SupportChecker.IsTV())
+            if (!SupportChecker.IsTV() && SupportChecker.IsSupported("http://tizen.org/feature/battery"))
             {
                 Information.SetCallback(Charger, ChargerConnectedCallback);
                 await ManualTest.WaitForConfirm();
@@ -651,11 +652,12 @@ namespace Tizen.System.Tests {
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "EVL")]
         [Property("AUTHOR", "Sehaj Singh Kalra, sehaj.kalra@samsung.com")]
-        [Precondition(1, "Charger should already be connected")]
+        [Precondition(1, "If the test target isn't a battery-powered device, pass is marked automatically as soon as you click Run button")]
+        [Precondition(2, "Charger should already be connected")]
         [Step(1, "Click Run button")]
         [Step(2, "Disonnect a battery charger from the phone")]
         public static async Task ChargerConnected_CHECK_DISCONNECTED() {
-            if (!SupportChecker.IsTV())
+            if (!SupportChecker.IsTV() && SupportChecker.IsSupported("http://tizen.org/feature/battery"))
             {
                 Information.SetCallback(Charger, ChargerDisconnectedCallback);
                 await ManualTest.WaitForConfirm();
index 8a373c0..ee7fad0 100755 (executable)
@@ -60,8 +60,12 @@ namespace Tizen.System.Tests {
                 Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: tethering.usb"));
             }
 
-            isError = Information.TryGetValue<bool>("http://tizen.org/runtimefeature/bluetooth", out keyValueBool);
-            Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: bluetooth"));
+            Information.TryGetValue<bool>("http://tizen.org/feature/network.bluetooth", out supported);
+            if (supported)
+            {\r
+                isError = Information.TryGetValue<bool>("http://tizen.org/runtimefeature/bluetooth", out keyValueBool);
+                Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: bluetooth"));\r
+            }
 
             isError = Information.TryGetValue<bool>("http://tizen.org/runtimefeature/packetdata", out keyValueBool);
             Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: packetdata"));
@@ -77,22 +81,30 @@ namespace Tizen.System.Tests {
 
             Information.TryGetValue<bool>("http://tizen.org/feature/battery", out supported);
             if (supported)
-            {\r
+            {
                 isError = Information.TryGetValue<bool>("http://tizen.org/runtimefeature/battery.charging", out keyValueBool);
                 Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: battery.charging"));
 
                 isError = Information.TryGetValue<bool>("http://tizen.org/runtimefeature/charger", out keyValueBool);
-                Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: charger"));\r
+                Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: charger"));
             }
 
             isError = Information.TryGetValue<bool>("http://tizen.org/runtimefeature/tvout", out keyValueBool);
             Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: tvout"));
 
-            isError = Information.TryGetValue<bool>("http://tizen.org/runtimefeature/autorotation", out keyValueBool);
-            Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: autorotation"));
+            Information.TryGetValue<bool>("http://tizen.org/feature/screen.auto_rotation", out supported);
+            if (supported)
+            {\r
+                isError = Information.TryGetValue<bool>("http://tizen.org/runtimefeature/autorotation", out keyValueBool);
+                Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: autorotation"));\r
+            }
 
-            isError = Information.TryGetValue<int>("http://tizen.org/runtimefeature/gps", out keyValueInt);
-            Assert.IsTrue(isError, string.Format("TryGetValue return false for valid int key: gps"));
+            Information.TryGetValue<bool>("http://tizen.org/feature/location.gps", out supported);
+            if (supported)
+            {\r
+                isError = Information.TryGetValue<int>("http://tizen.org/runtimefeature/gps", out keyValueInt);
+                Assert.IsTrue(isError, string.Format("TryGetValue return false for valid int key: gps"));\r
+            }
 
             isError = Information.TryGetValue<int>("http://tizen.org/runtimefeature/audiojack.type", out keyValueInt);
             Assert.IsTrue(isError, string.Format("TryGetValue return false for valid int key: audiojack.type"));
@@ -125,7 +137,7 @@ namespace Tizen.System.Tests {
         [Property("AUTHOR", "Kichan Kwon, k_c.kwon@samsung.com")]
         public static void SetCallback_RETURN_VALUE()
         {
-            Information.SetCallback("http://tizen.org/runtimefeature/bluetooth", TestCallback);
+            Information.SetCallback("http://tizen.org/runtimefeature/audiojack.connected", TestCallback);
         }
 
         [Test]
@@ -158,7 +170,7 @@ namespace Tizen.System.Tests {
         [Property("AUTHOR", "Kichan Kwon, k_c.kwon@samsung.com")]
         public static void UnsetCallback_RETURN_VALUE()
         {
-            Information.UnsetCallback("http://tizen.org/runtimefeature/bluetooth", TestCallback);
+            Information.UnsetCallback("http://tizen.org/runtimefeature/audiojack.connected", TestCallback);
         }
 
         [Test]