[NUI][Non-ACR][pass testcases if device not support quickpanel] 19/245619/4
authorJunseok, Kim <juns.kim@samsung.com>
Tue, 13 Oct 2020 13:49:08 +0000 (22:49 +0900)
committerJunseok, Kim <juns.kim@samsung.com>
Wed, 14 Oct 2020 02:20:57 +0000 (11:20 +0900)
Change-Id: I5dd8f57263695b12395129007ab7271fec810fdc
Signed-off-by: Junseok, Kim <juns.kim@samsung.com>
tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/ManualTestPage.cs
tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/Utils.cs
tct-suite-vs/Tizen.NUI.WindowSystem.Manual.Tests/testcase/TSQuickPanelClient.cs
tct-suite-vs/Tizen.NUI.WindowSystem.Tests/testcase/TSQuickPanelClient.cs
tct-suite-vs/Tizen.NUI.WindowSystem.Tests/testcase/TSTizenShell.cs

index 9b757eb..81ee125 100644 (file)
@@ -133,6 +133,7 @@ namespace Tizen.NUI.WindowSystem.Tests
         private FlexibleView _initList;\r
         private ListBridge _adapter;\r
         private TableView _detailList;\r
+        private View _exceptionLabelContainer;\r
         private View _buttonContainer;\r
         private View _buttonContainer2;\r
         private TableView _firstPageContainer;\r
@@ -400,6 +401,21 @@ namespace Tizen.NUI.WindowSystem.Tests
             CreateTestCase();\r
         }\r
 \r
+        public void AddExceptionLabel(string info)\r
+        {\r
+            TextLabel exceptionLabel = new TextLabel();\r
+            exceptionLabel.ParentOrigin = Position.ParentOriginTopLeft;\r
+            exceptionLabel.PivotPoint = PivotPoint.TopLeft;\r
+            exceptionLabel.Position = new Position(0.0f, 0.0f, 0.0f);\r
+            exceptionLabel.Size2D = new Size2D((int)(Window.Instance.Size.Width * 0.9895), (int)(Window.Instance.Size.Height * 0.0462));\r
+            exceptionLabel.HorizontalAlignment = HorizontalAlignment.Begin;\r
+            exceptionLabel.PointSize = _pointSize;\r
+            exceptionLabel.MultiLine = true;\r
+            exceptionLabel.Ellipsis = false;\r
+            exceptionLabel.Text = info + " is not support on this profile.\nSo, you can not test this TC. please mark as PASS";\r
+            _exceptionLabelContainer.Add(exceptionLabel);\r
+        }\r
+\r
         void InitializeDetailPage()\r
         {\r
             _detailList = new TableView(23, 1);\r
@@ -411,6 +427,15 @@ namespace Tizen.NUI.WindowSystem.Tests
             CreateDetailList();\r
             _detailView.Add(_detailList);\r
 \r
+            // label printing view\r
+            _exceptionLabelContainer = new View();\r
+            _exceptionLabelContainer.Focusable = true;\r
+            _exceptionLabelContainer.PivotPoint = PivotPoint.TopLeft;\r
+            _exceptionLabelContainer.ParentOrigin = Position.ParentOriginTopLeft;\r
+            _exceptionLabelContainer.Position = new Position(0, Window.Instance.Size.Height * 0.58f, 0);\r
+            _exceptionLabelContainer.Size = new Size(Window.Instance.Size.Width * 0.8f, Window.Instance.Size.Height * 0.1f);\r
+            _detailView.Add(_exceptionLabelContainer);\r
+\r
             //To Place the function button, such as PASS, FAIL.....\r
             _buttonContainer = new View();\r
             _buttonContainer.PivotPoint = PivotPoint.TopLeft;\r
index f4e1b51..bb0433a 100644 (file)
@@ -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
index 18c7552..09bce3d 100644 (file)
@@ -6,9 +6,9 @@ using Tizen.NUI.UIComponents;
 using Tizen.NUI.BaseComponents;
 using System.Threading.Tasks;
 using Tizen.NUI.WindowSystem;
-using ElmSharp;\r
-using Microsoft.VisualBasic.FileIO;\r
-\r
+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<string>("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())\r
-            {\r
-                ManualTest.Confirm();\r
+                if (!ManualTest.IsMobile())
+                {
+                    ManualTest.Confirm();
+                }
+                else
+                {
+                    qpClient.OrientationChanged += OnOrientationEvent;
+                    await ManualTest.WaitForConfirm();
+                    qpClient.OrientationChanged -= OnOrientationEvent;
+                }
             }
-            else\r
-            {\r
-                qpClient.OrientationChanged += OnOrientationEvent;\r
-                await ManualTest.WaitForConfirm();\r
-                qpClient.OrientationChanged -= OnOrientationEvent;\r
+            catch (NotSupportedException)
+            {
+                if (!isAvailableFeature)
+                {
+                    ManualTest.DisplayExceptionLabel("OrientationChanged_EVENT");
+                    await ManualTest.WaitForConfirm();
+                }
             }
         }
     }
index da4adfe..cfa2c55 100644 (file)
@@ -19,7 +19,22 @@ namespace Tizen.NUI.WindowSystem.Tests
         [SetUp]\r
         public void Init()\r
         {\r
+            string profile;\r
+\r
             Tizen.Log.Info(TAG, "Init() is called!");\r
+\r
+            System.Information.TryGetValue<string>("http://tizen.org/feature/profile", out profile);\r
+            if (String.Compare(profile, "mobile", true) == 0 ||\r
+                String.Compare(profile, "wearable", true) == 0 ||\r
+                String.Compare(profile, "common", true) == 0)\r
+            {\r
+                Tizen.Log.Info(TAG, "Device is support quickpanel : " + profile);\r
+            }\r
+            else\r
+            {\r
+                Tizen.Log.Info(TAG, "Device is not support quickpanel : " + profile);\r
+                Assert.Pass("Device is not support Quickpanel. passed.");\r
+            }\r
         }\r
 \r
         [TearDown]\r
index 402faea..6f96f03 100644 (file)
@@ -18,7 +18,22 @@ namespace Tizen.NUI.WindowSystem.Tests
         [SetUp]\r
         public void Init()\r
         {\r
+            string profile;\r
+\r
             Tizen.Log.Info(TAG, "Init() is called!");\r
+\r
+            System.Information.TryGetValue<string>("http://tizen.org/feature/profile", out profile);\r
+            if (String.Compare(profile, "mobile", true) == 0 ||\r
+                String.Compare(profile, "wearable", true) == 0 ||\r
+                String.Compare(profile, "common", true) == 0)\r
+            {\r
+                Tizen.Log.Info(TAG, "Device is support quickpanel : " + profile);\r
+            }\r
+            else\r
+            {\r
+                Tizen.Log.Info(TAG, "Device is not support quickpanel : " + profile);\r
+                Assert.Pass("Device is not support Quickpanel. passed.");\r
+            }\r
         }\r
 \r
         [TearDown]\r