From e517fc73a976135041ec42e2a3331c04c786bc14 Mon Sep 17 00:00:00 2001 From: Jeonghyun Yun Date: Fri, 27 Nov 2020 13:52:37 +0900 Subject: [PATCH] [ElmSharp][Non-ACR] Updated TC for tv product - Removed scroller DragStart & DragStop TCs due to TV limitation - Polygon TCs are updated to make it more visible for all profiles Change-Id: I34b5d82de40b37832283049908c79e2bed3da1d9 Signed-off-by: Jeonghyun Yun --- .../testcase/TSPolygon.cs | 93 ++++++++++++---------- .../testcase/TSScroller.cs | 60 +++++++++----- 2 files changed, 87 insertions(+), 66 deletions(-) diff --git a/tct-suite-vs/Tizen.ElmSharp.Manual.Tests/testcase/TSPolygon.cs b/tct-suite-vs/Tizen.ElmSharp.Manual.Tests/testcase/TSPolygon.cs index 4f87b33..d6c1b3a 100755 --- a/tct-suite-vs/Tizen.ElmSharp.Manual.Tests/testcase/TSPolygon.cs +++ b/tct-suite-vs/Tizen.ElmSharp.Manual.Tests/testcase/TSPolygon.cs @@ -28,6 +28,7 @@ namespace ElmSharp.Tests public class PolygonTests { private TestPage _testPage = TestPage.GetInstance(); + private Background _bg; private Polygon _polygon; private Window _window = MainWindow.GetInstance(); @@ -42,6 +43,18 @@ namespace ElmSharp.Tests public void Destroy() { LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); + if (_bg != null) + { + _bg.Unrealize(); + _bg = null; + } + var naviPage = _testPage.getNavigationPage(); + if (naviPage != null) + naviPage.Popped -= TSPolygon_Popped; + } + + private void TSPolygon_Popped(object sender, NaviframeEventArgs e) + { if (_polygon != null) { _polygon.Unrealize(); @@ -52,10 +65,25 @@ namespace ElmSharp.Tests private void CreatePolygon() { LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreatePolygon"); + _bg = new Background(_window) + { + AlignmentX = -1, + AlignmentY = -1, + WeightX = 1, + WeightY = 1, + BackgroundColor = Color.Black + }; + _bg.Show(); _polygon = new Polygon(_window); _polygon.Show(); - _testPage.ExecuteTCByPage(_polygon); + _testPage.ExecuteTCByPage(_bg); + + var naviPage = _testPage.getNavigationPage(); + if (naviPage != null) + { + naviPage.Popped += TSPolygon_Popped; + } } [Test] @@ -73,20 +101,13 @@ namespace ElmSharp.Tests [Postcondition(1, "NA")] public async Task AddPoint_INT_LOOK() { - Color color = Color.FromRgb(255, 128, 128); + Color color = Color.Pink; - if (ElmSharpProfile.GetProfile().Equals(ElmSharpProfile.WearableProfile)) - { - _polygon.AddPoint(100, 100); - _polygon.AddPoint(100, 250); - _polygon.AddPoint(250, 250); - } - else - { - _polygon.AddPoint(100, 100); - _polygon.AddPoint(100, 500); - _polygon.AddPoint(500, 500); - } + Size size = _window.ScreenSize; + + _polygon.AddPoint(110, size.Height - 250); + _polygon.AddPoint(110, size.Height - 110); + _polygon.AddPoint(250, size.Height - 110); _polygon.Color = color; @@ -109,20 +130,13 @@ namespace ElmSharp.Tests [Postcondition(1, "NA")] public async Task AddPoint_POINT_LOOK() { - Color color = Color.FromRgb(255, 200, 0); + Color color = Color.Yellow; - if (ElmSharpProfile.GetProfile().Equals(ElmSharpProfile.WearableProfile)) - { - _polygon.AddPoint(new Point { X = 100, Y = 150 }); - _polygon.AddPoint(new Point { X = 250, Y = 150 }); - _polygon.AddPoint(new Point { X = 250, Y = 250 }); - } - else - { - _polygon.AddPoint(new Point { X = 200, Y = 300 }); - _polygon.AddPoint(new Point { X = 500, Y = 300 }); - _polygon.AddPoint(new Point { X = 500, Y = 600 }); - } + Size size = _window.ScreenSize; + + _polygon.AddPoint(new Point { X = 110, Y = size.Height - 250 }); + _polygon.AddPoint(new Point { X = 250, Y = size.Height - 250 }); + _polygon.AddPoint(new Point { X = 250, Y = size.Height - 110 }); _polygon.Color = color; @@ -144,7 +158,9 @@ namespace ElmSharp.Tests [Postcondition(1, "NA")] public async Task ClearPoints_LOOK() { - Color color = Color.FromRgb(255, 128, 128); + Color color = Color.Pink; + + Size size = _window.ScreenSize; _polygon.AddPoint(new Point { X = 200, Y = 300 }); _polygon.AddPoint(new Point { X = 500, Y = 300 }); @@ -153,22 +169,11 @@ namespace ElmSharp.Tests _polygon.ClearPoints(); - if (ElmSharpProfile.GetProfile().Equals(ElmSharpProfile.WearableProfile)) - { - _polygon.AddPoint(new Point { X = 260, Y = 50 }); - _polygon.AddPoint(new Point { X = 350, Y = 130 }); - _polygon.AddPoint(new Point { X = 310, Y = 230 }); - _polygon.AddPoint(new Point { X = 210, Y = 230 }); - _polygon.AddPoint(new Point { X = 160, Y = 130 }); - } - else - { - _polygon.AddPoint(new Point { X = 260, Y = 50 }); - _polygon.AddPoint(new Point { X = 360, Y = 130 }); - _polygon.AddPoint(new Point { X = 310, Y = 230 }); - _polygon.AddPoint(new Point { X = 210, Y = 230 }); - _polygon.AddPoint(new Point { X = 160, Y = 130 }); - } + _polygon.AddPoint(new Point { X = 180, Y = size.Height - 270 }); + _polygon.AddPoint(new Point { X = 270, Y = size.Height - 190 }); + _polygon.AddPoint(new Point { X = 230, Y = size.Height - 90 }); + _polygon.AddPoint(new Point { X = 130, Y = size.Height - 90 }); + _polygon.AddPoint(new Point { X = 90, Y = size.Height - 190 }); _polygon.Show(); diff --git a/tct-suite-vs/Tizen.ElmSharp.Manual.Tests/testcase/TSScroller.cs b/tct-suite-vs/Tizen.ElmSharp.Manual.Tests/testcase/TSScroller.cs index 8e3edb2..2c05517 100755 --- a/tct-suite-vs/Tizen.ElmSharp.Manual.Tests/testcase/TSScroller.cs +++ b/tct-suite-vs/Tizen.ElmSharp.Manual.Tests/testcase/TSScroller.cs @@ -516,28 +516,36 @@ namespace ElmSharp.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "EVL")] [Property("AUTHOR", "Qian Sui, qian.sui@samsung.com")] - [Precondition(1, "NA")] + [Precondition(1, "This test will be automatically passed on TV. (Due to limitation on TV profile)")] [Step(1, "Click run TC")] [Step(2, "Scroll it")] [Step(3, "Testcase result will be shown automatically")] [Postcondition(1, "NA")] public async Task DragStart_CB() { - CreateScroller("Scroll it !! Test: Handle event DragStart"); - _scroller.SetPageSize(1, 1); + if (ElmSharpProfile.GetProfile().CompareTo(ElmSharpProfile.TvProfile) == 0) + { + _testPage.UnlockUIButton(); + Assert.Pass("Not Supported"); + } + else + { + CreateScroller("Scroll it !! Test: Handle event DragStart"); + _scroller.SetPageSize(1, 1); - _testPage.ExecuteTCByPage(_scroller); + _testPage.ExecuteTCByPage(_scroller); - _scroller.DragStart += _Confirm; + _scroller.DragStart += _Confirm; - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); + // Waits for user confirmation. + await ManualTest.WaitForConfirm(); - var niviframe = _testPage.getNavigationPage(); - if (niviframe != null) - niviframe.Pop(); + var niviframe = _testPage.getNavigationPage(); + if (niviframe != null) + niviframe.Pop(); - _scroller.DragStart -= _Confirm; + _scroller.DragStart -= _Confirm; + } } [Test] @@ -547,28 +555,36 @@ namespace ElmSharp.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "EVL")] [Property("AUTHOR", "Qian Sui, qian.sui@samsung.com")] - [Precondition(1, "NA")] + [Precondition(1, "This test will be automatically passed on TV. (Due to limitation on TV profile)")] [Step(1, "Click run TC")] [Step(2, "Drag the page to scroll")] [Step(3, "Testcase result will be shown automatically")] [Postcondition(1, "NA")] public async Task DragStop_CB() { - CreateScroller("Scroll it !! Test: Handle event DragStop"); - _scroller.SetPageSize(1, 1); + if (ElmSharpProfile.GetProfile().CompareTo(ElmSharpProfile.TvProfile) == 0) + { + _testPage.UnlockUIButton(); + Assert.Pass("Not Supported"); + } + else + { + CreateScroller("Scroll it !! Test: Handle event DragStop"); + _scroller.SetPageSize(1, 1); - _testPage.ExecuteTCByPage(_scroller); + _testPage.ExecuteTCByPage(_scroller); - _scroller.DragStop += _Confirm; + _scroller.DragStop += _Confirm; - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); + // Waits for user confirmation. + await ManualTest.WaitForConfirm(); - var niviframe = _testPage.getNavigationPage(); - if (niviframe != null) - niviframe.Pop(); + var niviframe = _testPage.getNavigationPage(); + if (niviframe != null) + niviframe.Pop(); - _scroller.DragStop -= _Confirm; + _scroller.DragStop -= _Confirm; + } } [Test] -- 2.7.4