[Non-ACR][TtsEngine/SttEngine] Fix test buttons are not cut 57/257857/2
authorSuyeon Hwang <stom.hwang@samsung.com>
Tue, 4 May 2021 09:36:38 +0000 (18:36 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Tue, 4 May 2021 09:44:10 +0000 (18:44 +0900)
Change-Id: I44cd10a110beb8a6c78f8f3f7db020ef915e343b
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
tct-suite-vs/Tizen.SttEngine.Manual.Tests/support/SttUIHelper.cs
tct-suite-vs/Tizen.SttEngine.Manual.Tests/testcase/TSEngine.cs
tct-suite-vs/Tizen.TtsEngine.Manual.Tests/support/TtsUIHelper.cs
tct-suite-vs/Tizen.TtsEngine.Manual.Tests/testcase/TSEngine.cs

index eba124e..0a33c50 100755 (executable)
@@ -8,12 +8,40 @@ namespace Tizen.Uix.SttEngine.Tests
         private static Button _button_1;
         private static TestPage _testPage = TestPage.GetInstance();
         private static Label _label_1 = null;
+        private static Grid _grid = null;
+        private static int _row = 0;
 
         internal static void UpdateLabel(string text)
         {
             _label_1.Text = text;
         }
 
+        internal static void CreateLayout()
+        {
+            _grid = new Grid()
+            {
+                HorizontalOptions = LayoutOptions.CenterAndExpand,
+                VerticalOptions = LayoutOptions.Start,
+                MinimumHeightRequest = 200,
+                ColumnDefinitions =
+                {
+                    new ColumnDefinition {Width = GridLength.Star},
+                    new ColumnDefinition {Width = GridLength.Star}
+                }
+            };
+            _row = 0;
+
+            _testPage.ExecuteTC(_grid);
+        }
+
+        internal static void DestroyLayout()
+        {
+            _row = 0;
+            _grid = null;
+            _button_1 = null;
+            _label_1 = null;
+        }
+
         internal static void CreateButton(string text)
         {
             _label_1 = new Label()
@@ -21,41 +49,26 @@ namespace Tizen.Uix.SttEngine.Tests
                 Text = "None",
                 HorizontalTextAlignment = TextAlignment.Center,
                 HorizontalOptions = LayoutOptions.CenterAndExpand,
-                VerticalOptions = LayoutOptions.CenterAndExpand,
-                MinimumWidthRequest = 160,
-                MinimumHeightRequest = 45
+                VerticalOptions = LayoutOptions.CenterAndExpand
             };
             _button_1 = new Button()
             {
                 Text = text,
                 HorizontalOptions = LayoutOptions.CenterAndExpand,
-                VerticalOptions = LayoutOptions.CenterAndExpand,
-                MinimumWidthRequest = 160,
-                MinimumHeightRequest = 45
+                VerticalOptions = LayoutOptions.CenterAndExpand
             };
 
-            var layout = new StackLayout()
-            {
-                HorizontalOptions = LayoutOptions.FillAndExpand,
-                VerticalOptions = LayoutOptions.Start,
-                Orientation = StackOrientation.Horizontal,
-                MinimumHeightRequest = 120,
-                Children = {
-                    _label_1,
-                    _button_1
-                },
-                Padding = new Thickness()
-                {
-                    Top = 0,
-                },
-            };
             _button_1.Clicked += (sender, e) => {
                 SttEngineHelper.PrintLog(Type.DLogAndlogUtil, "Button Clicked"+ _button_1.Text);
                 _button_1.IsEnabled = false;
                 ManualTest.Confirm();
             };
-            _testPage.ExecuteTC(layout);
+
+            _grid.Children.Add(_label_1, 0, _row);
+            _grid.Children.Add(_button_1, 1, _row);
+            _row++;
         }
+
         internal static void DisplayLabel(string message)
         {
             ManualTest.DisplayCustomLabel(message);
index b64960b..0dd49d0 100755 (executable)
@@ -15,6 +15,7 @@ namespace Tizen.Uix.SttEngine.Tests
         [SetUp]
         public void Init()
         {
+            SttUiHelper.CreateLayout();
             SttEngineHelper.PrintLog(Type.DLogAndlogUtil, "Executing Init");
 
             string profile;
@@ -25,6 +26,7 @@ namespace Tizen.Uix.SttEngine.Tests
         [TearDown]
         public void Destroy()
         {
+            SttUiHelper.DestroyLayout();
             SttEngineHelper.PrintLog(Type.DLogAndlogUtil, "Executing Destroy");
         }
 
index 21d1572..4d7ff02 100755 (executable)
@@ -8,12 +8,40 @@ namespace Tizen.Uix.TtsEngine.Tests
         private static Button _button_1;
         private static TestPage _testPage = TestPage.GetInstance();
         private static Label _label_1 = null;
+        private static Grid _grid = null;
+        private static int _row = 0;
 
         internal static void UpdateLabel(string text)
         {
             _label_1.Text = text;
         }
 
+        internal static void CreateLayout()
+        {
+            _grid = new Grid()
+            {
+                HorizontalOptions = LayoutOptions.CenterAndExpand,
+                VerticalOptions = LayoutOptions.Start,
+                MinimumHeightRequest = 200,
+                ColumnDefinitions =
+                {
+                    new ColumnDefinition {Width = GridLength.Star},
+                    new ColumnDefinition {Width = GridLength.Star}
+                }
+            };
+            _row = 0;
+
+            _testPage.ExecuteTC(_grid);
+        }
+
+        internal static void DestroyLayout()
+        {
+            _row = 0;
+            _grid = null;
+            _button_1 = null;
+            _label_1 = null;
+        }
+
         internal static void CreateButton(string text)
         {
             _label_1 = new Label()
@@ -21,41 +49,26 @@ namespace Tizen.Uix.TtsEngine.Tests
                 Text = "None",
                 HorizontalTextAlignment = TextAlignment.Center,
                 HorizontalOptions = LayoutOptions.CenterAndExpand,
-                VerticalOptions = LayoutOptions.CenterAndExpand,
-                MinimumWidthRequest = 160,
-                MinimumHeightRequest = 45
+                VerticalOptions = LayoutOptions.CenterAndExpand
             };
             _button_1 = new Button()
             {
                 Text = text,
                 HorizontalOptions = LayoutOptions.CenterAndExpand,
-                VerticalOptions = LayoutOptions.CenterAndExpand,
-                MinimumWidthRequest = 160,
-                MinimumHeightRequest = 45
+                VerticalOptions = LayoutOptions.CenterAndExpand
             };
 
-            var layout = new StackLayout()
-            {
-                HorizontalOptions = LayoutOptions.FillAndExpand,
-                VerticalOptions = LayoutOptions.Start,
-                Orientation = StackOrientation.Horizontal,
-                MinimumHeightRequest = 120,
-                Children = {
-                    _label_1,
-                    _button_1
-                },
-                Padding = new Thickness()
-                {
-                    Top = 0,
-                },
-            };
             _button_1.Clicked += (sender, e) => {
                 TtsEngineHelper.PrintLog(Type.DLogAndlogUtil, "Button Clicked"+ _button_1.Text);
                 _button_1.IsEnabled = false;
                 ManualTest.Confirm();
             };
-            _testPage.ExecuteTC(layout);
+
+            _grid.Children.Add(_label_1, 0, _row);
+            _grid.Children.Add(_button_1, 1, _row);
+            _row++;
         }
+
         internal static void DisplayLabel(string message)
         {
             ManualTest.DisplayCustomLabel(message);
index ec6566f..d7a0484 100755 (executable)
@@ -15,6 +15,7 @@ namespace Tizen.Uix.TtsEngine.Tests
         [SetUp]
         public void Init()
         {
+            TtsUiHelper.CreateLayout();
             TtsEngineHelper.PrintLog(Type.DLogAndlogUtil, "Executing Init");
 
             string profile;
@@ -25,6 +26,7 @@ namespace Tizen.Uix.TtsEngine.Tests
         [TearDown]
         public void Destroy()
         {
+            TtsUiHelper.DestroyLayout();
             TtsEngineHelper.PrintLog(Type.DLogAndlogUtil, "Executing Destroy");
         }