From b1672f51a66c9b110faaab6a8d8497678e563ded Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Wed, 28 Sep 2022 10:57:26 +0900 Subject: [PATCH] [Device][Non-ACR][Check display.state feature instead of profile for display test] It may be possible for TV profile to control display. Therefore check the tizen.org/feature/display.state is true instead of checking the tizen.org/feature/profile is "tv". Change-Id: Iedd5ea826bdfef3e7de731f61b7fb7ba667b5317 Signed-off-by: Youngjae Cho --- .../testcase/TSDisplay.cs | 12 ++++---- .../testcase/TSDisplayStateChangedEventArgs.cs | 12 ++++---- .../Tizen.Device.Tests/testcase/TSDisplay.cs | 32 +++++++++++++--------- 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/tct-suite-vs/Tizen.Device.Manual.Tests/testcase/TSDisplay.cs b/tct-suite-vs/Tizen.Device.Manual.Tests/testcase/TSDisplay.cs index 0532d4a..7b6f187 100755 --- a/tct-suite-vs/Tizen.Device.Manual.Tests/testcase/TSDisplay.cs +++ b/tct-suite-vs/Tizen.Device.Manual.Tests/testcase/TSDisplay.cs @@ -14,10 +14,10 @@ namespace Tizen.System.Tests { LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); bool ret_value; - string value = null; + bool display_state; - ret_value = Tizen.System.Information.TryGetValue("tizen.org/feature/profile", out value); - if (ret_value == true && value.CompareTo("tv") == 0) + ret_value = Tizen.System.Information.TryGetValue("tizen.org/feature/display.state", out display_state); + if (ret_value && !display_state) { isSupport = 0; return; @@ -55,11 +55,13 @@ namespace Tizen.System.Tests [Property("CRITERIA", "EVL")] [Property("AUTHOR", "Gattu Praveen Kumar, gattu.p@samsung.com")] [Precondition(1, "Device display must be on")] - [Precondition(2, "[Wearable Target] Set the display timeout as 15 seconds. The menu is here at Settings > Display > Screen Timeout.")] + [Precondition(2, "If a target is incapable of turning off the display, such as AlwaysOn, test will pass automatically")] + [Precondition(3, "[Wearable Target] Set the display timeout as 15 seconds. The menu is here at Settings > Display > Screen Timeout.")] [Step(1, "Click run TC")] [Step(2, "[Mobile Target] Press the powerkey button to turn off the display")] [Step(3, "[Wearable Target] Wait until the display is turned off as much time as you set in the Precondition step")] - [Step(4, "If you do not get pass, it is failed.")] + [Step(4, "[TV Target] Press the power button on the remote controller to turn off the display")] + [Step(5, "If you do not get pass, it is failed.")] public async Task StateChanged_EVENT_CHECK() { if (PassForNotSuppot() == 1) return; diff --git a/tct-suite-vs/Tizen.Device.Manual.Tests/testcase/TSDisplayStateChangedEventArgs.cs b/tct-suite-vs/Tizen.Device.Manual.Tests/testcase/TSDisplayStateChangedEventArgs.cs index f6728ed..e229b7a 100755 --- a/tct-suite-vs/Tizen.Device.Manual.Tests/testcase/TSDisplayStateChangedEventArgs.cs +++ b/tct-suite-vs/Tizen.Device.Manual.Tests/testcase/TSDisplayStateChangedEventArgs.cs @@ -14,10 +14,10 @@ namespace Tizen.System.Tests { LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); bool ret_value; - string value = null; + bool display_state; - ret_value = Tizen.System.Information.TryGetValue("tizen.org/feature/profile", out value); - if (ret_value == true && value.CompareTo("tv") == 0) + ret_value = Tizen.System.Information.TryGetValue("tizen.org/feature/display.state", out display_state); + if (ret_value && !display_state) { isSupport = 0; return; @@ -49,11 +49,13 @@ namespace Tizen.System.Tests [Property("CRITERIA", "PRE")] [Property("AUTHOR", "Gattu Praveen Kumar, gattu.p@samsung.com")] [Precondition(1, "Device Display must be on")] - [Precondition(2, "[Wearable Target] Set the display timeout as 15 seconds. The menu is here at Settings > Display > Screen Timeout.")] + [Precondition(2, "If a target is incapable of turning off the display, such as AlwaysOn, test will pass automatically")] + [Precondition(3, "[Wearable Target] Set the display timeout as 15 seconds. The menu is here at Settings > Display > Screen Timeout.")] [Step(1, "Click Run TC")] [Step(2, "[Mobile Target] Press the powerkey button to turn off the display")] [Step(3, "[Wearable Target] Wait until the display is turned off as much time as you set in the Precondition step")] - [Step(4, "If you do not get pass, it is failed.")] + [Step(4, "[TV Target] Press the power button on the remote controller to turn off the display")] + [Step(5, "If you do not get pass, it is failed.")] public async Task State_PROPERTY_READ_ONLY() { if (PassForNotSuppot() == 1) return; diff --git a/tct-suite-vs/Tizen.Device.Tests/testcase/TSDisplay.cs b/tct-suite-vs/Tizen.Device.Tests/testcase/TSDisplay.cs index af5bb5f..64e295e 100755 --- a/tct-suite-vs/Tizen.Device.Tests/testcase/TSDisplay.cs +++ b/tct-suite-vs/Tizen.Device.Tests/testcase/TSDisplay.cs @@ -9,20 +9,26 @@ namespace Tizen.System.Tests [Description("Tizen.System.Display tests")] class DisplayTests { - private int isDisplaySupport = 1; + private int isDisplaySupport = 0; + private int isDisplayStateSupport = 0; private int isDisplayBrightnessSupport = 1; [SetUp] public void Init() { bool ret_value; - string value = null; + bool value; - ret_value = Tizen.System.Information.TryGetValue("tizen.org/feature/profile", out value); - if (ret_value == true && String.Compare(value, "tv", true) == 0) + ret_value = Tizen.System.Information.TryGetValue("tizen.org/feature/display", out value); + if (ret_value && value) { - isDisplaySupport = 0; - return; + isDisplaySupport = 1; + } + + ret_value = Tizen.System.Information.TryGetValue("tizen.org/feature/display.state", out value); + if (ret_value && value) + { + isDisplayStateSupport = 1; } try @@ -59,7 +65,7 @@ namespace Tizen.System.Tests } else { - Assert.IsTrue(true, "display is not supported"); + Assert.Pass("display is not supported"); } } @@ -78,7 +84,7 @@ namespace Tizen.System.Tests } else { - Assert.IsTrue(true, "display is not supported"); + Assert.Pass("display is not supported"); } } @@ -102,7 +108,7 @@ namespace Tizen.System.Tests } else { - Assert.IsTrue(true, "display brightness is not supported"); + Assert.Pass("display brightness is not supported"); } } @@ -115,7 +121,7 @@ namespace Tizen.System.Tests [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")] public void State_PROPERTY_READ_WRITE() { - if (isDisplaySupport == 1) + if (isDisplaySupport == 1 && isDisplayStateSupport == 1) { Display.State = DisplayState.Normal; LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "State_READ Value:" + Display.State); @@ -124,7 +130,7 @@ namespace Tizen.System.Tests } else { - Assert.IsTrue(true, "display is not supported"); + Assert.Pass("display state is not supported"); } } @@ -148,7 +154,7 @@ namespace Tizen.System.Tests } else { - Assert.IsTrue(true, "display brightness is not supported"); + Assert.Pass("display brightness is not supported"); } } @@ -180,7 +186,7 @@ namespace Tizen.System.Tests } else { - Assert.IsTrue(true, "display is not supported"); + Assert.Pass("display is not supported"); } } -- 2.7.4