From b89fff1ae00863a562081cf8d49dc20857605971 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Mon, 11 Feb 2019 13:57:44 +0900 Subject: [PATCH] [Non-ACR][Bluetooth][Manual][Disconnect BT headset after running each TC] Change-Id: I3b364939e2edbfc48b1e9b068a67c960d75e3faa Signed-off-by: DoHyun Pyun --- .../TSAudioConnectionStateChangedEventArgs.cs | 48 +++++- .../testcase/TSBluetoothAudio.cs | 28 +++- .../testcase/TSBluetoothAvrcp.cs | 148 ++++++++++++++++-- 3 files changed, 200 insertions(+), 24 deletions(-) diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAudioConnectionStateChangedEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAudioConnectionStateChangedEventArgs.cs index 2e84d2f26..8ce092d08 100644 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAudioConnectionStateChangedEventArgs.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSAudioConnectionStateChangedEventArgs.cs @@ -221,8 +221,8 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { + && e.InnerException.GetType() == typeof(NotSupportedException)) + { BluetoothHelper.DisplayLabel("Address_READ_ONLY"); await ManualTest.WaitForConfirm(); } @@ -231,6 +231,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -286,8 +294,8 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { + && e.InnerException.GetType() == typeof(NotSupportedException)) + { BluetoothHelper.DisplayLabel("IsConnected_READ_ONLY"); await ManualTest.WaitForConfirm(); } @@ -296,6 +304,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -351,8 +367,8 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { + && e.InnerException.GetType() == typeof(NotSupportedException)) + { BluetoothHelper.DisplayLabel("ProfileType_READ_ONLY"); await ManualTest.WaitForConfirm(); } @@ -361,6 +377,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -416,8 +440,8 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { + && e.InnerException.GetType() == typeof(NotSupportedException)) + { BluetoothHelper.DisplayLabel("Result_READ_ONLY"); await ManualTest.WaitForConfirm(); } @@ -426,6 +450,14 @@ namespace Tizen.Network.Bluetooth.Tests { 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 index e35d00d89..551363ac4 100644 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAudio.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAudio.cs @@ -126,8 +126,8 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { + && e.InnerException.GetType() == typeof(NotSupportedException)) + { BluetoothHelper.DisplayLabel("Connect_RETURN_CONNECT_PROFILE_ENUM_ALL"); await ManualTest.WaitForConfirm(); } @@ -136,6 +136,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -190,8 +198,8 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { + && e.InnerException.GetType() == typeof(NotSupportedException)) + { BluetoothHelper.DisplayLabel("Disconnect_RETURN_DISCONNECT_PROFILES_ENUM_ALL"); await ManualTest.WaitForConfirm(); } @@ -259,8 +267,8 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioMediaSupported == false && isBluetoothAudioCallSupported == false - && e.InnerException.GetType() == typeof(NotSupportedException)) - { + && e.InnerException.GetType() == typeof(NotSupportedException)) + { BluetoothHelper.DisplayLabel("AudioConnectionStateChanged_CHECK_EVENT_ENUM_ALL"); await ManualTest.WaitForConfirm(); } @@ -269,6 +277,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } // [Test] diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAvrcp.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAvrcp.cs index 2a9d0133c..b3153d8ea 100644 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAvrcp.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAvrcp.cs @@ -107,7 +107,7 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { + { BluetoothHelper.DisplayLabel("TargetConnectionStateChanged_CHECK_EVENT"); await ManualTest.WaitForConfirm(); } @@ -116,6 +116,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -179,7 +187,7 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { + { BluetoothHelper.DisplayLabel("ShuffleModeChanged_CHECK_EVENT"); await ManualTest.WaitForConfirm(); } @@ -188,6 +196,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -264,6 +280,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -336,6 +360,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -412,6 +444,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -484,6 +524,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -560,6 +608,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -632,6 +688,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -699,7 +763,7 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { + { BluetoothHelper.DisplayLabel("RepeatModeChanged_CHECK_EVENT"); await ManualTest.WaitForConfirm(); } @@ -708,6 +772,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -765,7 +837,7 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { + { BluetoothHelper.DisplayLabel("NotifyEqualizerState_RETURN_VALUE_NOTIFY"); await ManualTest.WaitForConfirm(); } @@ -774,6 +846,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -830,7 +910,7 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { + { BluetoothHelper.DisplayLabel("NotifyRepeatMode_RETURN_VALUE_NOTIFY"); await ManualTest.WaitForConfirm(); } @@ -839,6 +919,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -895,7 +983,7 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { + { BluetoothHelper.DisplayLabel("NotifyShuffleMode_RETURN_VALUE_NOTIFY"); await ManualTest.WaitForConfirm(); } @@ -904,6 +992,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -960,7 +1056,7 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { + { BluetoothHelper.DisplayLabel("NotifyScanMode_RETURN_VALUE_NOTIFY"); await ManualTest.WaitForConfirm(); } @@ -969,6 +1065,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -1025,7 +1129,7 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { + { BluetoothHelper.DisplayLabel("NotifyPlayerState_RETURN_VALUE_NOTIFY"); await ManualTest.WaitForConfirm(); } @@ -1034,6 +1138,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -1091,7 +1203,7 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { + { BluetoothHelper.DisplayLabel("NotifyCurrentPosition_RETURN_VALUE_NOTIFY"); await ManualTest.WaitForConfirm(); } @@ -1100,6 +1212,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } [Test] @@ -1165,7 +1285,7 @@ namespace Tizen.Network.Bluetooth.Tests catch (TypeInitializationException e) { if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { + { BluetoothHelper.DisplayLabel("NotifyTrack_RETURN_VALUE_NOTIFY"); await ManualTest.WaitForConfirm(); } @@ -1174,6 +1294,14 @@ namespace Tizen.Network.Bluetooth.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(3000); + } + } } } } -- 2.34.1