From: Kichan Kwon Date: Mon, 14 May 2018 05:20:26 +0000 (+0900) Subject: [Information][Auto/Manual][Non-ACR] Check some features' support before test X-Git-Tag: public_m1_final~36^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc46b092125bb689c19d5e106651b542bedc8a5d;p=test%2Ftct%2Fcsharp%2Fapi.git [Information][Auto/Manual][Non-ACR] Check some features' support before test Change-Id: I2620e0ee43fa092487011694118d78822450c5bf Signed-off-by: Kichan Kwon --- diff --git a/tct-suite-vs/Tizen.Information.Manual.Tests/testcase/TSInformation.cs b/tct-suite-vs/Tizen.Information.Manual.Tests/testcase/TSInformation.cs index ceba07f..3c9d4a5 100755 --- a/tct-suite-vs/Tizen.Information.Manual.Tests/testcase/TSInformation.cs +++ b/tct-suite-vs/Tizen.Information.Manual.Tests/testcase/TSInformation.cs @@ -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(); diff --git a/tct-suite-vs/Tizen.Information.Tests/testcase/TSInformation.cs b/tct-suite-vs/Tizen.Information.Tests/testcase/TSInformation.cs index 8a373c0..ee7fad0 100755 --- a/tct-suite-vs/Tizen.Information.Tests/testcase/TSInformation.cs +++ b/tct-suite-vs/Tizen.Information.Tests/testcase/TSInformation.cs @@ -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("http://tizen.org/runtimefeature/bluetooth", out keyValueBool); - Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: bluetooth")); + Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out supported); + if (supported) + { + isError = Information.TryGetValue("http://tizen.org/runtimefeature/bluetooth", out keyValueBool); + Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: bluetooth")); + } isError = Information.TryGetValue("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("http://tizen.org/feature/battery", out supported); if (supported) - { + { isError = Information.TryGetValue("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("http://tizen.org/runtimefeature/charger", out keyValueBool); - Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: charger")); + Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: charger")); } isError = Information.TryGetValue("http://tizen.org/runtimefeature/tvout", out keyValueBool); Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: tvout")); - isError = Information.TryGetValue("http://tizen.org/runtimefeature/autorotation", out keyValueBool); - Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: autorotation")); + Information.TryGetValue("http://tizen.org/feature/screen.auto_rotation", out supported); + if (supported) + { + isError = Information.TryGetValue("http://tizen.org/runtimefeature/autorotation", out keyValueBool); + Assert.IsTrue(isError, string.Format("TryGetValue return false for valid bool key: autorotation")); + } - isError = Information.TryGetValue("http://tizen.org/runtimefeature/gps", out keyValueInt); - Assert.IsTrue(isError, string.Format("TryGetValue return false for valid int key: gps")); + Information.TryGetValue("http://tizen.org/feature/location.gps", out supported); + if (supported) + { + isError = Information.TryGetValue("http://tizen.org/runtimefeature/gps", out keyValueInt); + Assert.IsTrue(isError, string.Format("TryGetValue return false for valid int key: gps")); + } isError = Information.TryGetValue("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]