From: Suyeon Hwang Date: Tue, 4 May 2021 09:36:38 +0000 (+0900) Subject: [Non-ACR][TtsEngine/SttEngine] Fix test buttons are not cut X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F57%2F257857%2F2;p=test%2Ftct%2Fcsharp%2Fapi.git [Non-ACR][TtsEngine/SttEngine] Fix test buttons are not cut Change-Id: I44cd10a110beb8a6c78f8f3f7db020ef915e343b Signed-off-by: Suyeon Hwang --- diff --git a/tct-suite-vs/Tizen.SttEngine.Manual.Tests/support/SttUIHelper.cs b/tct-suite-vs/Tizen.SttEngine.Manual.Tests/support/SttUIHelper.cs index eba124e..0a33c50 100755 --- a/tct-suite-vs/Tizen.SttEngine.Manual.Tests/support/SttUIHelper.cs +++ b/tct-suite-vs/Tizen.SttEngine.Manual.Tests/support/SttUIHelper.cs @@ -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); diff --git a/tct-suite-vs/Tizen.SttEngine.Manual.Tests/testcase/TSEngine.cs b/tct-suite-vs/Tizen.SttEngine.Manual.Tests/testcase/TSEngine.cs index b64960b..0dd49d0 100755 --- a/tct-suite-vs/Tizen.SttEngine.Manual.Tests/testcase/TSEngine.cs +++ b/tct-suite-vs/Tizen.SttEngine.Manual.Tests/testcase/TSEngine.cs @@ -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"); } diff --git a/tct-suite-vs/Tizen.TtsEngine.Manual.Tests/support/TtsUIHelper.cs b/tct-suite-vs/Tizen.TtsEngine.Manual.Tests/support/TtsUIHelper.cs index 21d1572..4d7ff02 100755 --- a/tct-suite-vs/Tizen.TtsEngine.Manual.Tests/support/TtsUIHelper.cs +++ b/tct-suite-vs/Tizen.TtsEngine.Manual.Tests/support/TtsUIHelper.cs @@ -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); diff --git a/tct-suite-vs/Tizen.TtsEngine.Manual.Tests/testcase/TSEngine.cs b/tct-suite-vs/Tizen.TtsEngine.Manual.Tests/testcase/TSEngine.cs index ec6566f..d7a0484 100755 --- a/tct-suite-vs/Tizen.TtsEngine.Manual.Tests/testcase/TSEngine.cs +++ b/tct-suite-vs/Tizen.TtsEngine.Manual.Tests/testcase/TSEngine.cs @@ -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"); }