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()
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);
[SetUp]
public void Init()
{
+ SttUiHelper.CreateLayout();
SttEngineHelper.PrintLog(Type.DLogAndlogUtil, "Executing Init");
string profile;
[TearDown]
public void Destroy()
{
+ SttUiHelper.DestroyLayout();
SttEngineHelper.PrintLog(Type.DLogAndlogUtil, "Executing Destroy");
}
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()
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);
[SetUp]
public void Init()
{
+ TtsUiHelper.CreateLayout();
TtsEngineHelper.PrintLog(Type.DLogAndlogUtil, "Executing Init");
string profile;
[TearDown]
public void Destroy()
{
+ TtsUiHelper.DestroyLayout();
TtsEngineHelper.PrintLog(Type.DLogAndlogUtil, "Executing Destroy");
}