From 03dcc3d0d69f2b7563ebe76e830e94870c99bc07 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Tue, 13 Oct 2020 22:49:08 +0900 Subject: [PATCH] [NUI][Non-ACR][pass testcases if device not support quickpanel] Change-Id: I5dd8f57263695b12395129007ab7271fec810fdc Signed-off-by: Junseok, Kim --- .../ManualTestPage.cs | 25 ++++++++++ .../Tizen.NUI.WindowSystem.Manual.Tests/Utils.cs | 5 ++ .../testcase/TSQuickPanelClient.cs | 56 ++++++++++++++++------ .../testcase/TSQuickPanelClient.cs | 15 ++++++ .../testcase/TSTizenShell.cs | 15 ++++++ 5 files changed, 102 insertions(+), 14 deletions(-) diff --git a/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/ManualTestPage.cs b/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/ManualTestPage.cs index 9b757eb..81ee125 100644 --- a/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/ManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/ManualTestPage.cs @@ -133,6 +133,7 @@ namespace Tizen.NUI.WindowSystem.Tests private FlexibleView _initList; private ListBridge _adapter; private TableView _detailList; + private View _exceptionLabelContainer; private View _buttonContainer; private View _buttonContainer2; private TableView _firstPageContainer; @@ -400,6 +401,21 @@ namespace Tizen.NUI.WindowSystem.Tests CreateTestCase(); } + public void AddExceptionLabel(string info) + { + TextLabel exceptionLabel = new TextLabel(); + exceptionLabel.ParentOrigin = Position.ParentOriginTopLeft; + exceptionLabel.PivotPoint = PivotPoint.TopLeft; + exceptionLabel.Position = new Position(0.0f, 0.0f, 0.0f); + exceptionLabel.Size2D = new Size2D((int)(Window.Instance.Size.Width * 0.9895), (int)(Window.Instance.Size.Height * 0.0462)); + exceptionLabel.HorizontalAlignment = HorizontalAlignment.Begin; + exceptionLabel.PointSize = _pointSize; + exceptionLabel.MultiLine = true; + exceptionLabel.Ellipsis = false; + exceptionLabel.Text = info + " is not support on this profile.\nSo, you can not test this TC. please mark as PASS"; + _exceptionLabelContainer.Add(exceptionLabel); + } + void InitializeDetailPage() { _detailList = new TableView(23, 1); @@ -411,6 +427,15 @@ namespace Tizen.NUI.WindowSystem.Tests CreateDetailList(); _detailView.Add(_detailList); + // label printing view + _exceptionLabelContainer = new View(); + _exceptionLabelContainer.Focusable = true; + _exceptionLabelContainer.PivotPoint = PivotPoint.TopLeft; + _exceptionLabelContainer.ParentOrigin = Position.ParentOriginTopLeft; + _exceptionLabelContainer.Position = new Position(0, Window.Instance.Size.Height * 0.58f, 0); + _exceptionLabelContainer.Size = new Size(Window.Instance.Size.Width * 0.8f, Window.Instance.Size.Height * 0.1f); + _detailView.Add(_exceptionLabelContainer); + //To Place the function button, such as PASS, FAIL..... _buttonContainer = new View(); _buttonContainer.PivotPoint = PivotPoint.TopLeft; diff --git a/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/Utils.cs b/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/Utils.cs index f4e1b51..bb0433a 100644 --- a/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/Utils.cs +++ b/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/Utils.cs @@ -254,6 +254,11 @@ namespace Tizen.NUI.WindowSystem.Tests mLabel.Size2D = new Size2D(300, 50); return mLabel; } + + public static void DisplayExceptionLabel(string info) + { + ManualTestNUI.GetInstance().AddExceptionLabel(info); + } } enum NavigationButton diff --git a/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/testcase/TSQuickPanelClient.cs b/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/testcase/TSQuickPanelClient.cs index 18c7552..09bce3d 100644 --- a/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/testcase/TSQuickPanelClient.cs +++ b/tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/testcase/TSQuickPanelClient.cs @@ -6,9 +6,9 @@ using Tizen.NUI.UIComponents; using Tizen.NUI.BaseComponents; using System.Threading.Tasks; using Tizen.NUI.WindowSystem; -using ElmSharp; -using Microsoft.VisualBasic.FileIO; - +using ElmSharp; +using Microsoft.VisualBasic.FileIO; + namespace Tizen.NUI.WindowSystem.Tests { [TestFixture] @@ -49,20 +49,48 @@ namespace Tizen.NUI.WindowSystem.Tests [Postcondition(1, "N/A")] public async Task OrientationChanged_EVENT() { + string profile; + bool isAvailableFeature = false; + + System.Information.TryGetValue("http://tizen.org/feature/profile", out profile); + if (String.Compare(profile, "mobile", true) == 0 || + String.Compare(profile, "wearable", true) == 0) + { + Tizen.Log.Info(TAG, "Device is support quickpanel : " + profile); + isAvailableFeature = true; + } + else + { + // Common profile could not test Orientation changed event. + Tizen.Log.Info(TAG, "Device is not support quickpanel : " + profile); + isAvailableFeature = false; + } + /* TEST CODE */ - Shell.TizenShell tzsh = new Shell.TizenShell(); - Window win = NUIApplication.GetDefaultWindow(); - var qpClient = new Shell.QuickPanelClient(tzsh, win, Shell.QuickPanelClient.Types.SystemDefault); + try + { + Shell.TizenShell tzsh = new Shell.TizenShell(); + Window win = NUIApplication.GetDefaultWindow(); + var qpClient = new Shell.QuickPanelClient(tzsh, win, Shell.QuickPanelClient.Types.SystemDefault); - if (!ManualTest.IsMobile()) - { - ManualTest.Confirm(); + if (!ManualTest.IsMobile()) + { + ManualTest.Confirm(); + } + else + { + qpClient.OrientationChanged += OnOrientationEvent; + await ManualTest.WaitForConfirm(); + qpClient.OrientationChanged -= OnOrientationEvent; + } } - else - { - qpClient.OrientationChanged += OnOrientationEvent; - await ManualTest.WaitForConfirm(); - qpClient.OrientationChanged -= OnOrientationEvent; + catch (NotSupportedException) + { + if (!isAvailableFeature) + { + ManualTest.DisplayExceptionLabel("OrientationChanged_EVENT"); + await ManualTest.WaitForConfirm(); + } } } } diff --git a/tct-suite-vs/Tizen.NUI.WindowSystem.Tests/testcase/TSQuickPanelClient.cs b/tct-suite-vs/Tizen.NUI.WindowSystem.Tests/testcase/TSQuickPanelClient.cs index da4adfe..cfa2c55 100644 --- a/tct-suite-vs/Tizen.NUI.WindowSystem.Tests/testcase/TSQuickPanelClient.cs +++ b/tct-suite-vs/Tizen.NUI.WindowSystem.Tests/testcase/TSQuickPanelClient.cs @@ -19,7 +19,22 @@ namespace Tizen.NUI.WindowSystem.Tests [SetUp] public void Init() { + string profile; + Tizen.Log.Info(TAG, "Init() is called!"); + + System.Information.TryGetValue("http://tizen.org/feature/profile", out profile); + if (String.Compare(profile, "mobile", true) == 0 || + String.Compare(profile, "wearable", true) == 0 || + String.Compare(profile, "common", true) == 0) + { + Tizen.Log.Info(TAG, "Device is support quickpanel : " + profile); + } + else + { + Tizen.Log.Info(TAG, "Device is not support quickpanel : " + profile); + Assert.Pass("Device is not support Quickpanel. passed."); + } } [TearDown] diff --git a/tct-suite-vs/Tizen.NUI.WindowSystem.Tests/testcase/TSTizenShell.cs b/tct-suite-vs/Tizen.NUI.WindowSystem.Tests/testcase/TSTizenShell.cs index 402faea..6f96f03 100644 --- a/tct-suite-vs/Tizen.NUI.WindowSystem.Tests/testcase/TSTizenShell.cs +++ b/tct-suite-vs/Tizen.NUI.WindowSystem.Tests/testcase/TSTizenShell.cs @@ -18,7 +18,22 @@ namespace Tizen.NUI.WindowSystem.Tests [SetUp] public void Init() { + string profile; + Tizen.Log.Info(TAG, "Init() is called!"); + + System.Information.TryGetValue("http://tizen.org/feature/profile", out profile); + if (String.Compare(profile, "mobile", true) == 0 || + String.Compare(profile, "wearable", true) == 0 || + String.Compare(profile, "common", true) == 0) + { + Tizen.Log.Info(TAG, "Device is support quickpanel : " + profile); + } + else + { + Tizen.Log.Info(TAG, "Device is not support quickpanel : " + profile); + Assert.Pass("Device is not support Quickpanel. passed."); + } } [TearDown] -- 2.7.4