From 65d7baabbcbb394fee7a13f51cd2c41304c222f0 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Tue, 13 Nov 2018 11:13:43 +0900 Subject: [PATCH] [Bluetooth][Non-ACR] Enable Bluetooth Visiable Manual TCs Change-Id: I53893aee2afee4f48f89390893722c3cc98561d5 Signed-off-by: DoHyun Pyun --- .../TSVisibilityDurationChangedEventArgs.cs | 36 +++++------ .../testcase/TSVisibilityModeChangedEventArgs.cs | 70 ++++++++++------------ 2 files changed, 45 insertions(+), 61 deletions(-) diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSVisibilityDurationChangedEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSVisibilityDurationChangedEventArgs.cs index fae48e6..bfffc2a 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSVisibilityDurationChangedEventArgs.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSVisibilityDurationChangedEventArgs.cs @@ -32,7 +32,7 @@ namespace Tizen.Network.Bluetooth.Tests ManualTest.Confirm(); } - //[Test] + [Test] [Category("P1")] [Description("Test Duration. Check if Duration has proper value")] [Property("SPEC", "Tizen.Network.Bluetooth.VisibilityDurationChangedEventArgs.Duration A")] @@ -40,34 +40,28 @@ namespace Tizen.Network.Bluetooth.Tests [Property("CRITERIA", "PRO")] [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Go to Bluetooth in Settings and change Visibility timeout to a value in minutes or hour")] + [Precondition(2, "Sdb is connected as root with the target. \n>sdb root on")] [Step(1, "Tap the Run button")] - [Postcondition(1, "Go to Bluetooth in Settings and set Visibility timeout to Always on")] + [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/adapter org.projectx.bt_event.DiscoverableTimeoutChanged int32:0 int16:0")] + [Step(3, "(Because there is no UX senario or entry point to set the visiable timeout, so we should generate the event using command line to pass this TCT")] + [Postcondition(1, "NA")] public static async Task Duration_READ_ONLY() { try { - BluetoothHelper.LaunchVisiblityAppControl("10"); + EventHandler EventHandlerVisibilityDurationChanged = null; - await Task.Delay(5000); - - // PRECONDITION - VisibilityMode mode = BluetoothAdapter.Visibility; + EventHandlerVisibilityDurationChanged = (sender, e) => { + Assert.IsInstanceOf(e.Duration, "duration parameter should be of type int"); + Log.Debug ("TCT", "[TestCase][VisibilityDurationChangedEventArgs][Duration_READ_ONLY] Pass"); + BluetoothHelper.DisplayPassLabel("VisibilityDurationChangedEventArgs.Duration_READ_ONLY"); + BluetoothAdapter.VisibilityDurationChanged -= EventHandlerVisibilityDurationChanged; + }; - // TEST CODE - if (mode == VisibilityMode.TimeLimitedDiscoverable) - { - BluetoothAdapter.VisibilityDurationChanged += EventHandlerVisibilityDurationChanged; - await ManualTest.WaitForConfirm (); + BluetoothAdapter.VisibilityDurationChanged += EventHandlerVisibilityDurationChanged; - // POSTCONDITON - BluetoothAdapter.VisibilityDurationChanged -= EventHandlerVisibilityDurationChanged; - } - else - { - Assert.Fail("Visibility mode is not properly set on the device"); - } - } + await ManualTest.WaitForConfirm(); + } catch (NotSupportedException) { if (isBluetoothSupported == false) diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSVisibilityModeChangedEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSVisibilityModeChangedEventArgs.cs index 058ac19..6643816 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSVisibilityModeChangedEventArgs.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSVisibilityModeChangedEventArgs.cs @@ -27,31 +27,7 @@ namespace Tizen.Network.Bluetooth.Tests LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST"); } - public static void EventHandlerVisibilityModeChanged(object sender, VisibilityModeChangedEventArgs e) - { - visibility = BluetoothAdapter.Visibility; - if (e.Result == BluetoothError.None) - { - Log.Debug ("TCT", "[TestCase][VisibilityModeChanged][Result_READ_ONLY] Pass"); - BluetoothHelper.DisplayPassLabel("Result_READ_ONLY"); - return; - } - else - { - Assert.Fail("[TestCase][VisibilityModeChanged][Result_READ_ONLY] Failed"); - } - if (visibility == e.Visibility) - { - Log.Debug ("TCT", "[TestCase][VisibilityModeChanged][Visibility_READ_ONLY] Pass"); - BluetoothHelper.DisplayPassLabel("Visibility_READ_ONLY"); - } - else - { - Assert.Fail("[TestCase][VisibilityModeChanged][Visibility_READ_ONLY] Failed"); - } - } - - //[Test] + [Test] [Category("P1")] [Description("Test Result. Check if Result has proper value")] [Property("SPEC", "Tizen.Network.Bluetooth.VisibilityModeChangedEventArgs.Result A")] @@ -59,22 +35,30 @@ namespace Tizen.Network.Bluetooth.Tests [Property("CRITERIA", "PRO")] [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Sdb is connected as root with the target. \n>sdb root on")] [Step(1, "Tap the Run button")] - [Step(2, "Go to Bluetooth in Settings and change Visibility timeout value")] + [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/adapter org.projectx.bt_event.DiscoverableModeChanged int32:0 int16:1")] + [Step(3, "(Because there is no UX senario or entry point to set the visiable mode change, so we should generate the event using command line to pass this TCT")] [Postcondition(1, "NA")] public static async Task Result_READ_ONLY() { try { - BluetoothAdapter.VisibilityModeChanged += EventHandlerVisibilityModeChanged; + EventHandler EventHandlerVisibilityModeChanged = null; - BluetoothHelper.LaunchVisiblityAppControl("10"); + EventHandlerVisibilityModeChanged = (sender, e) => { + if (e.Result == BluetoothError.None) + { + Log.Debug ("TCT", "[TestCase][VisibilityModeChanged][Result_READ_ONLY] Pass"); + BluetoothHelper.DisplayPassLabel("VisibilityModeChangedEventArgs.Result_READ_ONLY"); + BluetoothAdapter.VisibilityModeChanged -= EventHandlerVisibilityModeChanged; + } + }; + + BluetoothAdapter.VisibilityModeChanged += EventHandlerVisibilityModeChanged; await ManualTest.WaitForConfirm(); - - // POSTCONDITON - BluetoothAdapter.VisibilityModeChanged -= EventHandlerVisibilityModeChanged; - } + } catch (NotSupportedException) { if (isBluetoothSupported == false) @@ -97,7 +81,7 @@ namespace Tizen.Network.Bluetooth.Tests } } - //[Test] + [Test] [Category("P1")] [Description("Test Visibility. Check if the Visibility has correct value")] [Property("SPEC", "Tizen.Network.Bluetooth.VisibilityModeChangedEventArgs.Visibility A")] @@ -105,22 +89,28 @@ namespace Tizen.Network.Bluetooth.Tests [Property("CRITERIA", "PRO")] [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Sdb is connected as root with the target. \n>sdb root on")] [Step(1, "Tap the Run button")] - [Step(2, "Go to Bluetooth in Settings and change Visibility timeout value")] + [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/adapter org.projectx.bt_event.DiscoverableModeChanged int32:0 int16:1")] + [Step(3, "(Because there is no UX senario or entry point to set the visiable mode change, so we should generate the event using command line to pass this TCT")] [Postcondition(1, "NA")] public static async Task Visibility_READ_ONLY() { try { - BluetoothAdapter.VisibilityModeChanged += EventHandlerVisibilityModeChanged; + EventHandler EventHandlerVisibilityModeChanged = null; - BluetoothHelper.LaunchVisiblityAppControl("10"); + EventHandlerVisibilityModeChanged = (sender, e) => { + Assert.IsInstanceOf(e.Visibility, "Visibility parameter should be of type VisibilityMode"); + Log.Debug ("TCT", "[TestCase][VisibilityModeChanged][Result_READ_ONLY] Pass"); + BluetoothHelper.DisplayPassLabel("VisibilityModeChangedEventArgs.Result_READ_ONLY"); + BluetoothAdapter.VisibilityModeChanged -= EventHandlerVisibilityModeChanged; + }; - await ManualTest.WaitForConfirm(); + BluetoothAdapter.VisibilityModeChanged += EventHandlerVisibilityModeChanged; - // POSTCONDITON - BluetoothAdapter.VisibilityModeChanged -= EventHandlerVisibilityModeChanged; - } + await ManualTest.WaitForConfirm(); + } catch (NotSupportedException) { if (isBluetoothSupported == false) -- 2.7.4