From f88959219b2b43237fd135a6c9f260a804a08790 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Tue, 3 Nov 2020 10:31:38 +0900 Subject: [PATCH] [Bluetooth][Manual][Non-ACR] Make combine TC for Audio To reduce the time consuming for verifying BT C# Manual TCT, we classify testcases using same senario. And remove the duplicate execution. Change-Id: I82f8df2c8ae0abc6ac0e97234d645fba97703459 Signed-off-by: DoHyun Pyun --- .../TSAudioConnectionStateChangedEventArgs.cs | 463 -------------- .../testcase/TSBluetoothAudio.cs | 684 --------------------- .../testcase/TSBluetoothCombine3_Audio.cs | 306 +++++++++ 3 files changed, 306 insertions(+), 1147 deletions(-) delete mode 100644 tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAudioConnectionStateChangedEventArgs.cs delete mode 100644 tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAudio.cs create mode 100644 tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothCombine3_Audio.cs diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAudioConnectionStateChangedEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAudioConnectionStateChangedEventArgs.cs deleted file mode 100644 index 8ce092d..0000000 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAudioConnectionStateChangedEventArgs.cs +++ /dev/null @@ -1,463 +0,0 @@ -using System; -using System.Threading.Tasks; -using BluetoothNetworkUtils; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Xamarin.Forms; -using Tizen.System; - -namespace Tizen.Network.Bluetooth.Tests -{ - [TestFixture] - [Description("AudioConnectionStateChangedEventArgs Tests")] - public class AudioConnectionStateChangedEventArgsTests - { - static BluetoothAudio audioProfile; - static Array enums = Enum.GetValues(typeof(BluetoothAudioProfileType)); - static bool isBluetoothAudioMediaSupported = false; - static bool isBluetoothAudioCallSupported = false; - - [SetUp] - public static void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST"); - Information.TryGetValue("http://tizen.org/feature/network.bluetooth.audio.media", out isBluetoothAudioMediaSupported); - Information.TryGetValue("http://tizen.org/feature/network.bluetooth.audio.call", out isBluetoothAudioCallSupported); - } - [TearDown] - public static void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST"); - } - - public static async Task SetupCheckAddress(BluetoothAudioProfileType profile) - { - // PRECONDITION - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(profile); - if (audioProfile == null) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "The Audio Profile Not Supported"); - BluetoothHelper.DisplayLabel("The Audio Profile Not Supported"); - Assert.True(true, "Audio Profile is not supported, skip the test case"); - return; - } - } - - EventHandler audioConnectionCallback = null; - // TEST CODE - audioConnectionCallback = (sender, e) => - { - if (e.Address != null) - { - ManualTest.Confirm(); - } - }; - - audioProfile.AudioConnectionStateChanged += audioConnectionCallback; - audioProfile.Connect(profile); - await ManualTest.WaitForConfirm(); - - // POSTCONDITION - BluetoothSetup.RemoveBluetoothDeviceProfileUtil(); - audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; - } - - public static async Task SetupCheckConnected(BluetoothAudioProfileType profile) - { - // PRECONDITION - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(profile); - if (audioProfile == null) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "The Audio Profile Not Supported"); - BluetoothHelper.DisplayLabel("The Audio Profile Not Supported"); - Assert.True(true, "Audio Profile is not supported, skip the test case"); - return; - } - } - - EventHandler audioConnectionCallback = null; - // TEST CODE - audioConnectionCallback = (sender, e) => - { - if (e.IsConnected) - { - ManualTest.Confirm(); - } - }; - - audioProfile.AudioConnectionStateChanged += audioConnectionCallback; - audioProfile.Connect(profile); - await ManualTest.WaitForConfirm(); - - // POSTCONDITION - BluetoothSetup.RemoveBluetoothDeviceProfileUtil(); - audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; - } - - public static async Task SetupCheckResult(BluetoothAudioProfileType profile) - { - // PRECONDITION - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(profile); - if (audioProfile == null) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "The Audio Profile Not Supported"); - BluetoothHelper.DisplayLabel("The Audio Profile Not Supported"); - Assert.True(true, "Audio Profile is not supported, skip the test case"); - return; - } - } - - EventHandler audioConnectionCallback = null; - // TEST CODE - audioConnectionCallback = (sender, e) => - { - if (e.Result == 0) - { - ManualTest.Confirm(); - } - }; - - audioProfile.AudioConnectionStateChanged += audioConnectionCallback; - audioProfile.Connect(profile); - await ManualTest.WaitForConfirm(); - - // POSTCONDITION - BluetoothSetup.RemoveBluetoothDeviceProfileUtil(); - audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; - } - - public static async Task SetupCheckProfileType(BluetoothAudioProfileType profile) - { - // PRECONDITION - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(profile); - if (audioProfile == null) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "The Audio Profile Not Supported"); - BluetoothHelper.DisplayLabel("The Audio Profile Not Supported"); - Assert.True(true, "Audio Profile is not supported, skip the test case"); - return; - } - } - - EventHandler audioConnectionCallback = null; - // TEST CODE - audioConnectionCallback = (sender, e) => - { - if (e.ProfileType == profile) - { - ManualTest.Confirm(); - } - }; - - audioProfile.AudioConnectionStateChanged += audioConnectionCallback; - audioProfile.Connect(profile); - await ManualTest.WaitForConfirm(); - - // POSTCONDITION - BluetoothSetup.RemoveBluetoothDeviceProfileUtil(); - audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; - } - - [Test] - [Category("P1")] - [Description("Test Address. Check if Address has proper value")] - [Property("SPEC", "Tizen.Network.Bluetooth.AudioConnectionStateChangedEventArgs.Address A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task Address_READ_ONLY() - { - try - { - bool isAudioConnected = false; - - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.All); - Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null"); - } - - EventHandler audioConnectionCallback = null; - - audioConnectionCallback = (sender, e) => { - if (e.Address != null) - { - BluetoothHelper.DisplayPassLabel("AudioConnectionStateChangedEventArgs.Address_READ_ONLY"); - audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; - } - }; - - audioProfile.AudioConnectionStateChanged += audioConnectionCallback; - - isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All); - - if (isAudioConnected == false) - audioProfile.Connect(BluetoothAudioProfileType.All); - else - audioProfile.Disconnect(BluetoothAudioProfileType.All); - - await ManualTest.WaitForConfirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) - { - BluetoothHelper.DisplayLabel("Address_READ_ONLY"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Address_READ_ONLY"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Test IsConnected. Check if IsConnected has proper value")] - [Property("SPEC", "Tizen.Network.Bluetooth.AudioConnectionStateChangedEventArgs.IsConnected A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task IsConnected_READ_ONLY() - { - try - { - bool isAudioConnected = false; - - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.All); - Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null"); - } - - EventHandler audioConnectionCallback = null; - - audioConnectionCallback = (sender, e) => { - Assert.IsInstanceOf(e.IsConnected, "IsConnected value is not of type bool"); - BluetoothHelper.DisplayPassLabel("AudioConnectionStateChangedEventArgs.IsConnected_READ_ONLY"); - audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; - }; - - audioProfile.AudioConnectionStateChanged += audioConnectionCallback; - - isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All); - - if (isAudioConnected == false) - audioProfile.Connect(BluetoothAudioProfileType.All); - else - audioProfile.Disconnect(BluetoothAudioProfileType.All); - - await ManualTest.WaitForConfirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) - { - BluetoothHelper.DisplayLabel("IsConnected_READ_ONLY"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("IsConnected_READ_ONLY"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Test ProfileType. Check if ProfileType has proper value")] - [Property("SPEC", "Tizen.Network.Bluetooth.AudioConnectionStateChangedEventArgs.ProfileType A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task ProfileType_READ_ONLY() - { - try - { - bool isAudioConnected = false; - - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.All); - Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null"); - } - - EventHandler audioConnectionCallback = null; - - audioConnectionCallback = (sender, e) => { - Assert.IsInstanceOf(e.ProfileType, "ProfileType parameter should be of type BluetoothAudioProfileType"); - BluetoothHelper.DisplayPassLabel("AudioConnectionStateChangedEventArgs.ProfileType_READ_ONLY"); - audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; - }; - - audioProfile.AudioConnectionStateChanged += audioConnectionCallback; - - isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All); - - if (isAudioConnected == false) - audioProfile.Connect(BluetoothAudioProfileType.All); - else - audioProfile.Disconnect(BluetoothAudioProfileType.All); - - await ManualTest.WaitForConfirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) - { - BluetoothHelper.DisplayLabel("ProfileType_READ_ONLY"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("ProfileType_READ_ONLY"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Test Result. Check if Result has proper value")] - [Property("SPEC", "Tizen.Network.Bluetooth.AudioConnectionStateChangedEventArgs.Result A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task Result_READ_ONLY() - { - try - { - bool isAudioConnected = false; - - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.All); - Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null"); - } - - EventHandler audioConnectionCallback = null; - - audioConnectionCallback = (sender, e) => { - Assert.IsInstanceOf(e.Result, "Result parameter should be of type int"); - BluetoothHelper.DisplayPassLabel("AudioConnectionStateChangedEventArgs.Result_READ_ONLY"); - audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; - }; - - audioProfile.AudioConnectionStateChanged += audioConnectionCallback; - - isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All); - - if (isAudioConnected == false) - audioProfile.Connect(BluetoothAudioProfileType.All); - else - audioProfile.Disconnect(BluetoothAudioProfileType.All); - - await ManualTest.WaitForConfirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) - { - BluetoothHelper.DisplayLabel("Result_READ_ONLY"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Result_READ_ONLY"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - } -} diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAudio.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAudio.cs deleted file mode 100644 index 551363a..0000000 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAudio.cs +++ /dev/null @@ -1,684 +0,0 @@ -using System; -using System.Threading.Tasks; -using BluetoothNetworkUtils; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Tizen.System; -using Xamarin.Forms; - -namespace Tizen.Network.Bluetooth.Tests -{ - [TestFixture] - [Description("BluetoothAudio Tests")] - public class BluetoothAudioTests - { - static BluetoothAudio audioProfile = null; - static bool isConnected = false; - static Array enums = Enum.GetValues(typeof(BluetoothAudioProfileType)); - static bool isBluetoothAudioMediaSupported = false; - static bool isBluetoothAudioCallSupported = false; - - [SetUp] - public static void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST"); - isConnected = false; - Information.TryGetValue("http://tizen.org/feature/network.bluetooth.audio.media", out isBluetoothAudioMediaSupported); - Information.TryGetValue("http://tizen.org/feature/network.bluetooth.audio.call", out isBluetoothAudioCallSupported); - } - [TearDown] - public static void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST"); - } - - public static async Task SetupForConnectAudio(BluetoothAudioProfileType profile) - { - // PRECONDITION - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(profile); - if (audioProfile == null) - { - BluetoothHelper.DisplayLabel("The Audio Profile Not Supported"); - Assert.True(true, "Audio Profile is not supported, skip the test case"); - return; - } - } - EventHandler audioConnectionCallback = null; - - // TEST CODE - audioConnectionCallback = (sender, e) => { - if (e.Result == 0 && e.IsConnected && e.Address != null) - { - isConnected = e.IsConnected; - ManualTest.Confirm(); - } - else if (e.Result == (int)BluetoothError.ServiceNotFound || - e.Result == (int)BluetoothError.NotSupported || - e.Result == (int)BluetoothError.OperationFailed || - e.Result == (int)BluetoothError.TimedOut) - { - BluetoothHelper.DisplayLabel("The Audio Profile Not Supported"); - ManualTest.Confirm(); - // POSTCONDITION - audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; - return; - } - }; - audioProfile.AudioConnectionStateChanged += audioConnectionCallback; - audioProfile.Connect(profile); - await ManualTest.WaitForConfirm(); - - // POSTCONDITION - BluetoothSetup.RemoveBluetoothDeviceProfileUtil(); - audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; - } - - [Test] - [Category("P1")] - [Description("Connect to a device of audio profile All")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Connect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "N/A")] - public static async Task Connect_RETURN_CONNECT_PROFILE_ENUM_ALL() - { - try - { - bool isAudioConnected = false; - - // PRECONDITION - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.All); - Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null"); - } - - isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All); - - if (isAudioConnected == true) { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - - audioProfile.Connect(BluetoothAudioProfileType.All); - - await Task.Delay(3000); - - // Connect method returns without error - BluetoothHelper.DisplayPassLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_ALL"); - - await ManualTest.WaitForConfirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) - { - BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_ALL"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_ALL"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Disconnect the audio profile")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Disconnect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "N/A")] - public static async Task Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL() - { - try - { - bool isAudioConnected = false; - - // PRECONDTION - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.All); - Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null"); - } - - isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All); - - if (isAudioConnected == false) { - audioProfile.Connect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - - // TEST CODE - audioProfile.Disconnect(BluetoothAudioProfileType.All); - - await Task.Delay(3000); - - // Disconnect method returns without error - BluetoothHelper.DisplayPassLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL"); - - await ManualTest.WaitForConfirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) - { - BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Check the Audio connectionstate changed event with the audio profile")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.AudioConnectionStateChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "N/A")] - public static async Task AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL() - { - try - { - bool isAudioConnected = false; - - // PRECONDTION - if (audioProfile == null) - { - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.All); - Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null"); - } - - EventHandler audioConnectionCallback = null; - - audioConnectionCallback = (sender, e) => { - if (e.Result == 0) - { - isConnected = e.IsConnected; - BluetoothHelper.DisplayPassLabel("AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL"); - audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; - } - }; - - audioProfile.AudioConnectionStateChanged += audioConnectionCallback; - - isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All); - - if (isAudioConnected == false) - audioProfile.Connect(BluetoothAudioProfileType.All); - else - audioProfile.Disconnect(BluetoothAudioProfileType.All); - - await ManualTest.WaitForConfirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) - { - BluetoothHelper.DisplayLabel("AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - -// [Test] - [Category("P1")] - [Description("Connect to a device of audio HspHfp profile")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Connect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sandeep H, h.sandeep@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Keep discoverable bluetooth audio profile device near the test device and wait for successfull connection.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task Connect_RETURN_CONNECT_PROFILE_ENUM_HSPHFP() - { - try - { - await SetupForConnectAudio(BluetoothAudioProfileType.HspHfp); - } - catch (NotSupportedException) - { - if (isBluetoothAudioCallSupported == false) - { - BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_HSPHFP"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioCallSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_HSPHFP"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - } - -// [Test] - [Category("P1")] - [Description("Disconnect the audio HspHfp profile")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Disconnect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sandeep H, h.sandeep@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Keep discoverable bluetooth audio profile device near the test device and wait for successfull disconnection.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_HSPHFP() - { - try - { - // PRECONDITION - isConnected = false; - await SetupForConnectAudio(BluetoothAudioProfileType.HspHfp); - - // TEST CODE - if (isConnected) - { - EventHandler audioDisconnectionCallback = null; - audioDisconnectionCallback = (sender, e) => { - if (e.Result == 0 && !e.IsConnected && e.Address != null) - { - ManualTest.Confirm(); - } - }; - audioProfile.AudioConnectionStateChanged += audioDisconnectionCallback; - audioProfile.Disconnect(BluetoothAudioProfileType.HspHfp); - await ManualTest.WaitForConfirm(); - - // POSTCONDITION - audioProfile.AudioConnectionStateChanged -= audioDisconnectionCallback; - } - } - catch (NotSupportedException) - { - if (isBluetoothAudioCallSupported == false) - { - BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_HSPHFP"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioCallSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_HSPHFP"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - } - -// [Test] - [Category("P1")] - [Description("Connect to a device of audio Gateway profile")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Connect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sandeep H, h.sandeep@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Keep discoverable bluetooth audio profile device near the test device and wait for successfull connection.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task Connect_RETURN_CONNECT_PROFILE_ENUM_AG() - { - try - { - await SetupForConnectAudio(BluetoothAudioProfileType.AudioGateway); - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) - { - BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_AG"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_AG"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - } - -// [Test] - [Category("P1")] - [Description("Disconnect the audio Gateway profile")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Disconnect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sandeep H, h.sandeep@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Keep discoverable bluetooth audio profile device near the test device and wait for successfull disconnection.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_AG() - { - try - { - // PRECONDITION - isConnected = false; - await SetupForConnectAudio(BluetoothAudioProfileType.AudioGateway); - - // TEST CODE - if (isConnected) - { - EventHandler audioDisconnectionCallback = null; - audioDisconnectionCallback = (sender, e) => { - if (e.Result == 0 && !e.IsConnected && e.Address != null) - { - ManualTest.Confirm(); - } - }; - audioProfile.AudioConnectionStateChanged += audioDisconnectionCallback; - audioProfile.Disconnect(BluetoothAudioProfileType.AudioGateway); - await ManualTest.WaitForConfirm(); - - // POSTCONDITION - audioProfile.AudioConnectionStateChanged -= audioDisconnectionCallback; - } - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) - { - BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_AG"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_AG"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - } - -// [Test] - [Category("P1")] - [Description("Connect to a device of audio A2DP Source profile")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Connect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sandeep H, h.sandeep@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Keep discoverable bluetooth audio profile device near the test device and wait for successfull connection.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task Connect_RETURN_CONNECT_PROFILE_ENUM_A2DPSRC() - { - try - { - await SetupForConnectAudio(BluetoothAudioProfileType.AdvancedAudioDistribution); - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false) - { - BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_A2DPSRC"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_A2DPSRC"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - } - -// [Test] - [Category("P1")] - [Description("Disconnect the audio A2DP Source profile")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Disconnect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sandeep H, h.sandeep@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Keep discoverable bluetooth audio profile device near the test device and wait for successfull disconnection.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_A2DPSRC() - { - try - { - // PRECONDITION - isConnected = false; - await SetupForConnectAudio(BluetoothAudioProfileType.AdvancedAudioDistribution); - - // TEST CODE - if (isConnected) - { - EventHandler audioDisconnectionCallback = null; - audioDisconnectionCallback = (sender, e) => { - if (e.Result == 0 && !e.IsConnected && e.Address != null) - { - ManualTest.Confirm(); - } - }; - audioProfile.AudioConnectionStateChanged += audioDisconnectionCallback; - audioProfile.Disconnect(BluetoothAudioProfileType.AdvancedAudioDistribution); - await ManualTest.WaitForConfirm(); - - // POSTCONDITION - audioProfile.AudioConnectionStateChanged -= audioDisconnectionCallback; - } - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false) - { - BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_A2DPSRC"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_A2DPSRC"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - } - -// [Test] - [Category("P1")] - [Description("Connect to a device of audio A2DP Sink profile")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Connect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sandeep H, h.sandeep@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Keep discoverable bluetooth audio profile device near the test device and wait for successfull connection.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task Connect_RETURN_CONNECT_PROFILE_ENUM_A2DPSINK() - { - try - { - await SetupForConnectAudio(BluetoothAudioProfileType.AdvancedAudioDistributionSink); - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false) - { - BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_A2DPSINK"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_A2DPSINK"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - } - -// [Test] - [Category("P1")] - [Description("Disconnect the audio A2DP Sink profile")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Disconnect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sandeep H, h.sandeep@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Keep discoverable bluetooth audio profile device near the test device and wait for successfull disconnection.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_A2DPSINK() - { - try - { - // PRECONDITION - isConnected = false; - await SetupForConnectAudio(BluetoothAudioProfileType.AdvancedAudioDistributionSink); - - // TEST CODE - if (isConnected) - { - EventHandler audioDisconnectionCallback = null; - audioDisconnectionCallback = (sender, e) => { - if (e.Result == 0 && !e.IsConnected && e.Address != null) - { - ManualTest.Confirm(); - } - }; - audioProfile.AudioConnectionStateChanged += audioDisconnectionCallback; - audioProfile.Disconnect(BluetoothAudioProfileType.AdvancedAudioDistributionSink); - await ManualTest.WaitForConfirm(); - - // POSTCONDITION - audioProfile.AudioConnectionStateChanged -= audioDisconnectionCallback; - } - } - catch (NotSupportedException) - { - if (isBluetoothAudioMediaSupported == false) - { - BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_A2DPSINK"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioMediaSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_A2DPSINK"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothCombine3_Audio.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothCombine3_Audio.cs new file mode 100644 index 0000000..d58fb97 --- /dev/null +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothCombine3_Audio.cs @@ -0,0 +1,306 @@ +using System; +using System.Threading.Tasks; +using BluetoothNetworkUtils; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.System; +using Xamarin.Forms; + +namespace Tizen.Network.Bluetooth.Tests +{ + [TestFixture] + [Description("BluetoothAudio Tests")] + public class BluetoothAudioTests + { + static BluetoothAudio audioProfile = null; + static Array enums = Enum.GetValues(typeof(BluetoothAudioProfileType)); + static bool isBluetoothAudioMediaSupported = false; + static bool isBluetoothAudioCallSupported = false; + + /* PASS flag Variaibles for TCs */ + static bool pass_Connect_RETURN_CONNECT_PROFILE_ENUM_ALL = false; + static bool pass_Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL = false; + static bool pass_AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL = false; + static bool pass_Address_READ_ONLY = false; + static bool pass_IsConnected_READ_ONLY = false; + static bool pass_ProfileType_READ_ONLY = false; + static bool pass_Result_READ_ONLY = false; + + + [SetUp] + public static void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST"); + Information.TryGetValue("http://tizen.org/feature/network.bluetooth.audio.media", out isBluetoothAudioMediaSupported); + Information.TryGetValue("http://tizen.org/feature/network.bluetooth.audio.call", out isBluetoothAudioCallSupported); + } + [TearDown] + public static void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST"); + } + + public static async Task AudioCombine_TEST() + { + try + { + bool isAudioConnected = false; + + if (audioProfile == null) + { + audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.All); + Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null"); + } + + isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All); + + if (isAudioConnected == true) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + + EventHandler audioConnectionCallback = null; + + audioConnectionCallback = (sender, e) => { + /* PASS condition for AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL */ + pass_AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL = true; + + /* PASS condition for Address_READ_ONLY */ + Assert.IsNotNull(e.Address, "Address should not be Null"); + pass_Address_READ_ONLY = true; + + /* PASS condition for IsConnected_READ_ONLY */ + Assert.IsInstanceOf(e.IsConnected, "IsConnected value is not of type bool"); + pass_IsConnected_READ_ONLY = true; + + /* PASS condition for ProfileType_READ_ONLY */ + Assert.IsInstanceOf(e.ProfileType, "ProfileType parameter should be of type BluetoothAudioProfileType"); + pass_ProfileType_READ_ONLY = true; + + /* PASS condition for Result_READ_ONLY */ + Assert.IsInstanceOf(e.Result, "Result value is not of type int"); + pass_Result_READ_ONLY = true; + }; + audioProfile.AudioConnectionStateChanged += audioConnectionCallback; + + /* PASS condition for Connect_RETURN_CONNECT_PROFILE_ENUM_ALL */ + audioProfile.Connect(BluetoothAudioProfileType.All); + pass_Connect_RETURN_CONNECT_PROFILE_ENUM_ALL = true; + + await Task.Delay(3000); + + /* PASS condition for Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL */ + audioProfile.Disconnect(BluetoothAudioProfileType.All); + pass_Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL = true; + + await Task.Delay(3000); + + audioProfile.AudioConnectionStateChanged -= audioConnectionCallback; + } + catch (NotSupportedException) + { + if (isBluetoothAudioMediaSupported == false) + LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Not Supported"); + } + catch (TypeInitializationException e) + { + if (isBluetoothAudioMediaSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) + LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Not Supported"); + } + catch (Exception ex) + { + Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); + } + } + + [Test] + [Category("P1")] + [Description("Connect to a device of audio profile All")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Connect M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "N/A")] + public static async Task Connect_RETURN_CONNECT_PROFILE_ENUM_ALL() + { + /* We can't occupy the precondition, if AUDIO feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) + { + BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_ALL"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_Connect_RETURN_CONNECT_PROFILE_ENUM_ALL == false) + await AudioCombine_TEST(); + + Assert.True(pass_Connect_RETURN_CONNECT_PROFILE_ENUM_ALL, "[TestCase][Connect_RETURN_CONNECT_PROFILE_ENUM_ALL] Fail"); + } + + [Test] + [Category("P1")] + [Description("Disconnect the audio profile")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.Disconnect M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "N/A")] + public static async Task Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL() + { + /* We can't occupy the precondition, if AUDIO feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) + { + BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL == false) + await AudioCombine_TEST(); + + Assert.True(pass_Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL, "[TestCase][Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL] Fail"); + } + + [Test] + [Category("P1")] + [Description("Check the Audio connectionstate changed event with the audio profile")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAudio.AudioConnectionStateChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "N/A")] + public static async Task AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL() + { + /* We can't occupy the precondition, if AUDIO feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) + { + BluetoothHelper.DisplayLabel("AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL == false) + await AudioCombine_TEST(); + + Assert.True(pass_AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL, "[TestCase][AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL] Fail"); + } + + [Test] + [Category("P1")] + [Description("Test Address. Check if Address has proper value")] + [Property("SPEC", "Tizen.Network.Bluetooth.AudioConnectionStateChangedEventArgs.Address A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public static async Task Address_READ_ONLY() + { + /* We can't occupy the precondition, if AUDIO feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) + { + BluetoothHelper.DisplayLabel("Address_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_Address_READ_ONLY == false) + await AudioCombine_TEST(); + + Assert.True(pass_Address_READ_ONLY, "[TestCase][Address_READ_ONLY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Test IsConnected. Check if IsConnected has proper value")] + [Property("SPEC", "Tizen.Network.Bluetooth.AudioConnectionStateChangedEventArgs.IsConnected A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public static async Task IsConnected_READ_ONLY() + { + /* We can't occupy the precondition, if AUDIO feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) + { + BluetoothHelper.DisplayLabel("IsConnected_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_IsConnected_READ_ONLY == false) + await AudioCombine_TEST(); + + Assert.True(pass_IsConnected_READ_ONLY, "[TestCase][IsConnected_READ_ONLY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Test ProfileType. Check if ProfileType has proper value")] + [Property("SPEC", "Tizen.Network.Bluetooth.AudioConnectionStateChangedEventArgs.ProfileType A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public static async Task ProfileType_READ_ONLY() + { + /* We can't occupy the precondition, if AUDIO feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) + { + BluetoothHelper.DisplayLabel("ProfileType_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_ProfileType_READ_ONLY == false) + await AudioCombine_TEST(); + + Assert.True(pass_ProfileType_READ_ONLY, "[TestCase][ProfileType_READ_ONLY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Test Result. Check if Result has proper value")] + [Property("SPEC", "Tizen.Network.Bluetooth.AudioConnectionStateChangedEventArgs.Result A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public static async Task Result_READ_ONLY() + { + /* We can't occupy the precondition, if AUDIO feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false) + { + BluetoothHelper.DisplayLabel("Result_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_Result_READ_ONLY == false) + await AudioCombine_TEST(); + + Assert.True(pass_Result_READ_ONLY, "[TestCase][Result_READ_ONLY] Fail"); + } + } +} -- 2.7.4