using NUnit.Framework.TUnit;
using System.Reflection;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
using Tizen.Applications;
namespace Tizen.NUI.Tests
{
class ManualTestNUI
{
+ class ListBridge : FlexibleView.Adapter
+ {
+ private List<string> _mDatas;
+ private List<ItemData> _mlistItem;
+
+ public ListBridge(List<string> datas, List<ItemData> item)
+ {
+ _mDatas = datas;
+ _mlistItem = item;
+ }
+
+ public void UpdateItemData(int position, List<ItemData> item)
+ {
+ _mlistItem = item;
+ }
+
+ public override FlexibleView.ViewHolder OnCreateViewHolder(int viewType)
+ {
+ FlexibleView.ViewHolder viewHolder = new FlexibleView.ViewHolder(new Button());
+ return viewHolder;
+ }
+
+ public override void OnBindViewHolder(FlexibleView.ViewHolder holder, int position)
+ {
+ string testcaseName = "#." + (position + 1).ToString() + _mDatas[position];
+ string resultText = "[" + _mlistItem[(int)position].Result + "]";
+ string text = testcaseName + resultText;
+
+ Button btn = holder.ItemView as Button;
+ if (btn)
+ {
+ btn.Focusable = true;
+ btn.Text = text;
+ btn.Name = position.ToString();
+ btn.PointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f;
+ btn.Size = new Size(Window.Instance.Size.Width * 0.4f, Window.Instance.Size.Height * 0.046f);
+ btn.Style.Text.TextColor = new Color(0, 0, 0, 1);
+ btn.Style.ImageShadow = new ImageShadow
+ {
+ Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png",
+ Border = new Rectangle(5, 5, 5, 5)
+ };
+ btn.Style.BackgroundImage = new Selector<string>
+ {
+ Focused = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png",
+ Other = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"
+ };
+ btn.FocusGained += (obj, e) =>
+ {
+ btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
+ };
+ btn.FocusLost += (obj, e) =>
+ {
+ btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
+ };
+ btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
+ btn.ParentOrigin = Position.ParentOriginTopLeft;
+ btn.PivotPoint = PivotPoint.TopLeft;
+ btn.TextAlignment = HorizontalAlignment.Begin;
+ btn.CellIndex = new Vector2(position, 0);
+ }
+ }
+
+ public override void OnDestroyViewHolder(FlexibleView.ViewHolder holder)
+ {
+ if (holder.ItemView != null)
+ {
+ holder.ItemView.Dispose();
+ }
+ }
+
+ public override int GetItemCount()
+ {
+ return _mDatas.Count;
+ }
+ }
+
private List<string> _tcIDList;
private List<ItemData> _listItem;
private TSettings _tsettings;
private TRunner _tRunner;
- private NavigationButton _pressButton = NavigationButton.NA;
- private PushButton passButton, failButton, blockButton, homeButton, preButton, nextButton, doneButton;
- private TextLabel notRun;
+ private Button _passButton, _failButton, _blockButton, _homeButton, _preButton, _nextButton, _doneButton;
+ private TextLabel _notRun;
private const string STEP_ATTRIBUTE_NAME = "NUnit.Framework.StepAttribute";
private const string PRECONDITION_ATTRIBUTE_NAME = "NUnit.Framework.PreconditionAttribute";
private const string POSTCONDITION_ATTRIBUTE_NAME = "NUnit.Framework.PostconditionAttribute";
//For TV KantM
//private static float PointSize = 30.0f;
//private static float ButtonSizeWidth = 200;
- private static float PointSize = 5.0f;
- private static float PixelSize = 20.0f;
-
+ private float _pointSize = 20.0f;
//Save the information of every single test case
- private List<TestcaseInfo> TCInfoList;
- private List<string> CurrentTCInfo;
+ private List<TestcaseInfo> _tcInfoList;
+ private List<string> _currentTCInfo;
- private static ManualTestNUI instance;
- private static Object lockObject = new object();
+ private static ManualTestNUI _instance;
+ private static Object _lockObject = new object();
//Show the result of all the test case
private TextLabel _summaryLabel;
- ScrollView _scrollView;
private View _initView;
private View _detailView;
- private TableView _initList;
- private TableView _detailList;
private View _caseView;
- private TableView _buttonContainer;
+ private FlexibleView _initList;
+ private ListBridge _adapter;
+ private TableView _detailList;
+ private View _buttonContainer;
+ private View _buttonContainer2;
private TableView _firstPageContainer;
- private PushButton run;
- private PushButton runButton;
- private PushButton[] buttonList;
+ private Button _run;
+ private Button _runButton;
//Always save the current TC number;
- private int CurrentTCNum = 0;
+ private int _currentTCNum = 0;
- private const float RowSpacing = 0.0f;
- private const float TopMargin = 0.0f;
- private const float BottomMargin = 0.0f;
- private const float SideMargin = 5.0f;
- private const float ItemHeight = 30.0f;
public static ManualTestNUI GetInstance()
{
- lock (lockObject)
+ lock (_lockObject)
{
- if (instance == null)
+ if (_instance == null)
{
- instance = new ManualTestNUI();
+ _instance = new ManualTestNUI();
}
}
- return instance;
+ return _instance;
}
private ManualTestNUI()
}
public void Initialize()
{
- Tizen.Log.Fatal("NUI", "Initialize=========================================");
+ Tizen.Log.Fatal("NUI", "Initialize window's width is " + Window.Instance.Size.Width + " Dpi is " + Window.Instance.Dpi.Length());
+ Window.Instance.BackgroundColor = Color.White;
+
_toastMessage = new ToastMessage();
- PointSize = (1.0f / Window.Instance.Dpi.Length()) * 2000.0f;
+ _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f;
RunType.Value = RunType.MANUAL;
_tRunner = new TRunner();
_tRunner.LoadTestsuite();
Tizen.Log.Fatal("NUI", "TCT : TCName:" + nameTc.ToString());
}
-
_tsettings = TSettings.GetInstance();
_tsettings.IsManual = true;
InitData();
_caseView = new View();
- Window.Instance.GetDefaultLayer().Add(_caseView);
- Window window = Window.Instance;
- window.BackgroundColor = Color.White;
_summaryLabel = new TextLabel();
- _summaryLabel.PixelSize = PixelSize;
- _summaryLabel.Size2D = new Size2D((int)Window.Instance.Size.Width, 60);
+ _summaryLabel.PointSize = _pointSize;
+ _summaryLabel.Size = new Size(Window.Instance.Size.Width, Window.Instance.Size.Height * 0.055f);
_summaryLabel.ParentOrigin = Position.ParentOriginTopLeft;
_summaryLabel.PivotPoint = PivotPoint.TopLeft;
- _summaryLabel.Position = new Position(0, 5, 0);
_summaryLabel.HorizontalAlignment = HorizontalAlignment.Center;
_summaryLabel.VerticalAlignment = VerticalAlignment.Center;
-
+ Window.Instance.GetDefaultLayer().Add(_summaryLabel);
SetSummaryResult();
- window.GetDefaultLayer().Add(_summaryLabel);
_initView = new View();
- _initView.Size2D = new Size2D((int)Window.Instance.Size.Width, (int)Window.Instance.Size.Height - 65);
+ _initView.Size = new Size(Window.Instance.Size.Width, Window.Instance.Size.Height * 0.9f);
+ _initView.Position = new Position(0.0f, (int)(Window.Instance.Size.Height * 0.0648), 0.0f);
_initView.ParentOrigin = Position.ParentOriginTopLeft;
_initView.PivotPoint = PivotPoint.TopLeft;
- _initView.Position = new Position(0.0f, 70.0f, 0.0f);
InitializeFirstPage();
_initView.Show();
+ Window.Instance.GetDefaultLayer().Add(_initView);
_detailView = new View();
- _initView.Size2D = new Size2D((int)Window.Instance.Size.Width, (int)Window.Instance.Size.Height - 65);
+ _detailView.Size = new Size(Window.Instance.Size.Width, Window.Instance.Size.Height * 0.9f);
+ _detailView.Position = new Position(0.0f, (int)(Window.Instance.Size.Height * 0.0648), 0.0f);
_detailView.ParentOrigin = Position.ParentOriginTopLeft;
_detailView.PivotPoint = PivotPoint.TopLeft;
- _detailView.Position = new Position(0.0f, 70.0f, 0.0f);
InitializeDetailPage();
_detailView.Hide();
+ Window.Instance.GetDefaultLayer().Add(_detailView);
- window.GetDefaultLayer().Add(_initView);
- window.GetDefaultLayer().Add(_detailView);
+ FocusManager.Instance.SetCurrentFocusView(_run);
+ }
- FocusManager.Instance.SetCurrentFocusView(run);
+ void SetCommonButtonStyle(Button btn, string text)
+ {
+ if (!btn) return;
+ btn.Focusable = true;
+ btn.Text = text;
+ btn.PointSize = _pointSize;
+ btn.Size = new Size(Window.Instance.Size.Width * 0.06f, Window.Instance.Size.Height * 0.046f);
+ btn.Style.Text.TextColor = new Color(0, 0, 0, 1);
+ btn.Style.ImageShadow = new ImageShadow
+ {
+ Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png",
+ Border = new Rectangle(5, 5, 5, 5)
+ };
+ btn.Style.BackgroundImage = new Selector<string>
+ {
+ Focused = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png",
+ Other = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"
+ };
+ btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
+ btn.ParentOrigin = Position.ParentOriginTopLeft;
+ btn.PivotPoint = PivotPoint.TopLeft;
+ btn.FocusGained += (obj, e) =>
+ {
+ btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
+ };
+ btn.FocusLost += (obj, e) =>
+ {
+ btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
+ };
}
void InitializeFirstPage()
{
//Create Run Button, when you Click it, then the first test case will be executed.
- doneButton = new PushButton();
- doneButton.Focusable = true;
- doneButton.LabelText = "Done";
- doneButton.Clicked += (obj, ee) =>
+ _doneButton = new Button();
+ SetCommonButtonStyle(_doneButton, "Done");
+ _doneButton.ClickEvent += (obj, ee) =>
{
TSettings.GetInstance().SubmitManualResult();
- return false;
};
- run = new PushButton();
- run.LabelText = "Runner";
- run.Clicked += (obj, ee) =>
+ _run = new Button();
+ SetCommonButtonStyle(_run, "Runner");
+ _run.ClickEvent += (obj, ee) =>
{
Tizen.Log.Fatal("NUI", "Check all the test case from the first one.");
- CurrentTCNum = 0;
+ _currentTCNum = 0;
_initView.Hide();
_caseView.Hide();
UpdateDetailPage();
_detailView.Show();
- FocusManager.Instance.SetCurrentFocusView(runButton);
- return false;
+ FocusManager.Instance.SetCurrentFocusView(_runButton);
};
-
- run.RightFocusableView = doneButton;
- doneButton.LeftFocusableView = run;
+ _run.RightFocusableView = _doneButton;
+ _doneButton.LeftFocusableView = _run;
//To show all the test case information(Number _className._TCName [result]).
- _initList = new TableView((uint)_tcIDList.Count, 1);
+ _initList = new FlexibleView();
+ _initList.Position = new Position(0, Window.Instance.Size.Height * 0.0925f);
+ _initList.Size = new Size(Window.Instance.Size.Width * 0.5f, Window.Instance.Size.Height * 0.79f);
+ _adapter = new ListBridge(_tcIDList, _listItem);
+ _initList.SetAdapter(_adapter);
+ LinearLayoutManager layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL);
+ _initList.SetLayoutManager(layoutManager);
+ _initList.FocusedItemIndex = 0;
_initList.Focusable = true;
- _initList.CellPadding = new Vector2(0, 0);
- _initList.Size2D = new Size2D(Window.Instance.Size.Width - 50, _tcIDList.Count * 50);
- _initList.ParentOrigin = Position.ParentOriginTopLeft;
- _initList.PivotPoint = PivotPoint.TopLeft;
- _initList.Position = new Position(0.0f, 0.0f, 0.0f);
- CreateInitList();
-
- run.DownFocusableView = _initList;
- doneButton.DownFocusableView = _initList;
- _initList.UpFocusableView = run;
-
- _firstPageContainer = new TableView(2, 2);
+ _initList.ItemClickEvent += (obj, e) =>
+ {
+ Button button = e.ClickedView.ItemView as Button;
+ if (button)
+ {
+ Tizen.Log.Fatal("NUI", "Item clicked!!::" + button.Name);
+ _currentTCNum = int.Parse(button.Name);
+ _initView.Hide();
+ UpdateDetailPage();
+ _caseView.Hide();
+ _detailView.Show();
+ FocusManager.Instance.SetCurrentFocusView(_runButton);
+ }
+ };
+ _initList.FocusGained += (obj, e) =>
+ {
+ FlexibleView.ViewHolder holder = _initList?.FindViewHolderForAdapterPosition(0);
+ if (holder != null && holder.ItemView != null)
+ {
+ FocusManager.Instance.SetCurrentFocusView(holder.ItemView);
+ _currentTCNum = 0;
+ }
+ };
+ _initList.FocusLost += (obj, e) =>
+ {
+ _currentTCNum = 0;
+ };
+ _initList.KeyEvent += (obj, e) =>
+ {
+ if (e.Key.State == Key.StateType.Down)
+ {
+ Tizen.Log.Fatal("NUI", "KeyEvent~KeyPressedName = " + e.Key.KeyPressedName + ",KeyCode = " + e.Key.KeyCode);
+ if (e.Key.KeyPressedName == "Up")
+ {
+ if (_currentTCNum == 0)
+ {
+ FocusManager.Instance.SetCurrentFocusView(_run);
+ }
+ else
+ {
+ FlexibleView.ViewHolder holder = _initList?.FindViewHolderForAdapterPosition(_currentTCNum - 1);
+ if (holder != null && holder.ItemView != null)
+ {
+ FocusManager.Instance.SetCurrentFocusView(holder.ItemView);
+ _currentTCNum--;
+ }
+ }
+ }
+ else if (e.Key.KeyPressedName == "Down")
+ {
+ if (_currentTCNum == _initList.ChildCount - 1)
+ {
+ _currentTCNum = 0;
+ }
+ else
+ {
+ _currentTCNum++;
+ }
+ FlexibleView.ViewHolder holder = _initList?.FindViewHolderForAdapterPosition(_currentTCNum);
+ if (holder != null && holder.ItemView != null)
+ {
+ FocusManager.Instance.SetCurrentFocusView(holder.ItemView);
+ }
+ }
+ else if (e.Key.KeyPressedName == "Return")
+ {
+ _initView.Hide();
+ UpdateDetailPage();
+ _caseView.Hide();
+ _detailView.Show();
+ FocusManager.Instance.SetCurrentFocusView(_runButton);
+ }
+ }
+ return true;
+ };
+
+ _firstPageContainer = new TableView(1, 2);
_firstPageContainer.PivotPoint = Position.PivotPointTopLeft;
_firstPageContainer.ParentOrigin = Position.ParentOriginTopLeft;
- _firstPageContainer.Position = new Position(0, 3, 0);
- _firstPageContainer.Size2D = new Size2D((int)Window.Instance.Size.Width - 200, 200);
- _firstPageContainer.Focusable = (true);
+ _firstPageContainer.Size = new Size(Window.Instance.Size.Width, Window.Instance.Size.Height * 0.1f);
+ _firstPageContainer.Focusable = true;
_firstPageContainer.SetCellAlignment(new TableView.CellPosition(0, 0), HorizontalAlignmentType.Right, VerticalAlignmentType.Center);
_firstPageContainer.SetCellAlignment(new TableView.CellPosition(0, 1), HorizontalAlignmentType.Center, VerticalAlignmentType.Center);
- _firstPageContainer.SetCellAlignment(new TableView.CellPosition(1), HorizontalAlignmentType.Center, VerticalAlignmentType.Center);
- _firstPageContainer.CellPadding = new Vector2(0, 0);
-
- _firstPageContainer.AddChild(doneButton, new TableView.CellPosition(0, 0));
- _firstPageContainer.AddChild(run, new TableView.CellPosition(0, 1));
-
-
- _scrollView = new ScrollView();
- _scrollView.ClippingMode = ClippingModeType.ClipChildren;
- _scrollView.BackgroundColor = Color.Transparent;
- _scrollView.Size2D = new Size2D(Window.Instance.Size.Width, Window.Instance.Size.Height);
- _scrollView.Position2D = new Position2D(0, 0);
- _scrollView.Scrolling = true;
-
- PropertyMap rulerMap = new PropertyMap();
- rulerMap.Add((int)ScrollModeType.XAxisScrollEnabled, new PropertyValue(false));
- rulerMap.Add((int)ScrollModeType.YAxisScrollEnabled, new PropertyValue(true));
- rulerMap.Add((int)ScrollModeType.YAxisSnapToInterval, new PropertyValue(100));
- rulerMap.Add((int)ScrollModeType.YAxisScrollBoundary, new PropertyValue(60 * (_tcIDList.Count+1)));
- _scrollView.ScrollMode = rulerMap;
-
- _scrollView.Add(_initList);
- _firstPageContainer.AddChild(_scrollView, new TableView.CellPosition(1, 0, 1, 2));
+ _firstPageContainer.AddChild(_doneButton, new TableView.CellPosition(0, 0));
+ _firstPageContainer.AddChild(_run, new TableView.CellPosition(0, 1));
+ _run.DownFocusableView = _initList;
+ _doneButton.DownFocusableView = _initList;
_initView.Add(_firstPageContainer);
+ _initView.Add(_initList);
Tizen.Log.Fatal("NUI", "TCT : InitializeFirstPage:");
- FocusManager.Instance.SetCurrentFocusView(run);
+ FocusManager.Instance.SetCurrentFocusView(_run);
}
//Update the Test Page before you want to show it(Click Run/Pre/nect Button, or Click on item in the List).
{
_detailList = new TableView(23, 1);
_detailList.Focusable = true;
- _detailList.Size2D = new Size2D(Window.Instance.Size.Width - 50, 500);
+ _detailList.Size = new Size(Window.Instance.Size.Width * 0.9739f, Window.Instance.Size.Height * 0.4629f);
_detailList.ParentOrigin = Position.ParentOriginTopLeft;
_detailList.PivotPoint = PivotPoint.TopLeft;
_detailList.Position = new Position(0.0f, 0.0f, 0.0f);
_detailView.Add(_detailList);
//To Place the function button, such as PASS, FAIL.....
- _buttonContainer = new TableView(2, 4);
- _buttonContainer.SetSizeModeFactor(new Vector3(0.0f, 0.9f, 0.0f));
- _buttonContainer.PivotPoint = PivotPoint.TopCenter;
+ _buttonContainer = new View();
+ _buttonContainer.PivotPoint = PivotPoint.TopLeft;
_buttonContainer.ParentOrigin = Position.ParentOriginTopLeft;
- _buttonContainer.Position = new Position(0, Window.Instance.Size.Height * 0.6f, 0);
- _buttonContainer.Size2D = new Size2D((int)Window.Instance.Size.Width, 300);
- _buttonContainer.Focusable = (true);
+ _buttonContainer.Position = new Position(0, Window.Instance.Size.Height * 0.68f, 0);
+ _buttonContainer.Size = new Size(Window.Instance.Size.Width * 0.8f, Window.Instance.Size.Height * 0.1f);
+ _buttonContainer.Focusable = true;
+
+ _buttonContainer2 = new View();
+ _buttonContainer2.PivotPoint = PivotPoint.TopLeft;
+ _buttonContainer2.ParentOrigin = Position.ParentOriginTopLeft;
+ _buttonContainer2.Position = new Position(0, Window.Instance.Size.Height * 0.8f, 0);
+ _buttonContainer2.Size = new Size(Window.Instance.Size.Width * 0.8f, Window.Instance.Size.Height * 0.1f);
+ _buttonContainer2.Focusable = true;
+
+ var flexlayout = new FlexLayout();
+ flexlayout.Direction = FlexLayout.FlexDirection.Row;
+ flexlayout.Justification = FlexLayout.FlexJustification.SpaceBetween;
+ _buttonContainer.Layout = flexlayout;
+ var flexlayout2 = new FlexLayout();
+ flexlayout2.Direction = FlexLayout.FlexDirection.Row;
+ flexlayout2.Justification = FlexLayout.FlexJustification.SpaceBetween;
+ _buttonContainer2.Layout = flexlayout2;
CreateButtons();
_detailView.Add(_buttonContainer);
+ _detailView.Add(_buttonContainer2);
}
//To show the detail information of the test case
_detailView.Remove(_detailList);
_detailList.Dispose();
}
- Tizen.Log.Fatal("NUI", "Print the CurrentTCNum here::" + CurrentTCNum);
+ Tizen.Log.Fatal("NUI", "Print the CurrentTCNum here::" + _currentTCNum);
_detailList = new TableView(10, 1);
_detailList.Focusable = true;
- _detailList.Size2D = new Size2D(Window.Instance.Size.Width - 50, 400);
+ _detailList.Size = new Size(Window.Instance.Size.Width * 0.9739f, Window.Instance.Size.Height * 0.3703f);
_detailList.ParentOrigin = Position.ParentOriginTopLeft;
_detailList.PivotPoint = PivotPoint.TopLeft;
_detailList.Position = new Position(0.0f, 0.0f, 0.0f);
CreateDetailList();
_detailView.Add(_detailList);
- if (notRun)
+ if (_notRun)
{
- notRun.Text = _listItem[CurrentTCNum].Result;
+ _notRun.Text = _listItem[_currentTCNum].Result;
}
}
//Create all the function buttons here, such as PASS, FAIL.....
void CreateButtons()
{
-
- notRun = new TextLabel();
- notRun.SizeWidth = 200;
- notRun.PixelSize = PixelSize;
- notRun.HorizontalAlignment = HorizontalAlignment.Begin;
- notRun.Text = "Not Run";
-
- passButton = new PushButton();
- passButton.Focusable = true;
- passButton.LabelText = "Pass";
- passButton.Clicked += (obj, ee) =>
+ _notRun = new TextLabel();
+ _notRun.HorizontalAlignment = HorizontalAlignment.Begin;
+ _notRun.PointSize = _pointSize;
+ _notRun.Text = "Not Run";
+ _notRun.Size = new Size(Window.Instance.Size.Width * 0.06f, Window.Instance.Size.Height * 0.046f);
+
+ _passButton = new Button();
+ SetCommonButtonStyle(_passButton, "Pass");
+ _passButton.ClickEvent += (obj, ee) =>
{
-
Clear();
if (!ManualTest.IsConfirmed())
{
ManualTest.Confirm();
}
Tizen.Log.Fatal("TBT", "Pass Button clicked!");
- return true;
};
- failButton = new PushButton();
- failButton.Focusable = true;
- failButton.LabelText = "Fail";
- failButton.Clicked += (obj, ee) =>
+ _failButton = new Button();
+ SetCommonButtonStyle(_failButton, "Fail");
+ _failButton.ClickEvent += (obj, ee) =>
{
Clear();
if (!ManualTest.IsConfirmed())
ManualTest.Confirm();
}
Tizen.Log.Fatal("TBT", "Fail Button clicked!");
- return true;
};
- blockButton = new PushButton();
- blockButton.Focusable = true;
- blockButton.LabelText = "Block";
- blockButton.Clicked += (obj, ee) =>
+ _blockButton = new Button();
+ SetCommonButtonStyle(_blockButton, "Block");
+ _blockButton.ClickEvent += (obj, ee) =>
{
Clear();
if (!ManualTest.IsConfirmed())
_tsettings.TCResult = StrResult.BLOCK;
ManualTest.Confirm();
}
- return true;
};
- runButton = new PushButton();
- runButton.Focusable = true;
- runButton.LabelText = "Run";
- runButton.Clicked += (obj, ee) =>
+ _runButton = new Button();
+ SetCommonButtonStyle(_runButton, "Run");
+ _runButton.ClickEvent += (obj, ee) =>
{
Clear();
//should update the _caseView by the test case
- _pressButton = NavigationButton.NA;
- _tsettings.Testcase_ID = _tcIDList[CurrentTCNum];
+ _tsettings.Testcase_ID = _tcIDList[_currentTCNum];
_tsettings.TCResult = "";
_tRunner.Execute();
- return true;
};
- homeButton = new PushButton();
- homeButton.Focusable = true;
- homeButton.LabelText = "Home";
- homeButton.Clicked += (obj, ee) =>
+ _homeButton = new Button();
+ SetCommonButtonStyle(_homeButton, "Home");
+ _homeButton.ClickEvent += (obj, ee) =>
{
Clear();
- _pressButton = NavigationButton.Home;
if (!ManualTest.IsConfirmed())
{
_tsettings.TCResult = StrResult.NOTRUN;
{
_detailView.Hide();
_initView.Show();
- FocusManager.Instance.SetCurrentFocusView(run);
+ FocusManager.Instance.SetCurrentFocusView(_run);
}
- return true;
};
- preButton = new PushButton();
- preButton.Focusable = true;
- preButton.LabelText = "<<";
- preButton.Clicked += (obj, ee) =>
+ _preButton = new Button();
+ SetCommonButtonStyle(_preButton, "<<");
+ _preButton.ClickEvent += (obj, ee) =>
{
Clear();
if (!ManualTest.IsConfirmed())
}
else
{
- if (CurrentTCNum != 0)
+ if (_currentTCNum != 0)
{
- CurrentTCNum--;
- notRun.Text = _listItem[CurrentTCNum].Result;
+ _currentTCNum--;
+ _notRun.Text = _listItem[_currentTCNum].Result;
ManualTest.Confirm();
UpdateDetailPage();
}
- else if (CurrentTCNum == 0)
+ else if (_currentTCNum == 0)
{
_toastMessage.Message = "This is first testcase";
_toastMessage.Post();
}
}
- return true;
};
- nextButton = new PushButton();
- nextButton.Focusable = true;
- nextButton.LabelText = ">>";
- nextButton.Clicked += (obj, ee) =>
+
+ _nextButton = new Button();
+ SetCommonButtonStyle(_nextButton, ">>");
+ _nextButton.ClickEvent += (obj, ee) =>
{
Clear();
if (!ManualTest.IsConfirmed())
_tsettings.TCResult = StrResult.NOTRUN;
ManualTest.Confirm();
}
- if (CurrentTCNum + 1 != ResultNumber.Total)
+ if (_currentTCNum + 1 != ResultNumber.Total)
{
- Tizen.Log.Fatal("NUI", "Print the [not run] CurrentTCNum::" + CurrentTCNum);
- CurrentTCNum++;
- notRun.Text = _listItem[CurrentTCNum].Result;
+ Tizen.Log.Fatal("NUI", "Print the [not run] CurrentTCNum::" + _currentTCNum);
+ _currentTCNum++;
+ _notRun.Text = _listItem[_currentTCNum].Result;
UpdateDetailPage();
}
- else if (CurrentTCNum + 1 == ResultNumber.Total)
+ else if (_currentTCNum + 1 == ResultNumber.Total)
{
_toastMessage.Message = "This is last testcase";
_toastMessage.Post();
}
- return true;
};
- _buttonContainer.AddChild(passButton, new TableView.CellPosition(0, 0));
- _buttonContainer.AddChild(failButton, new TableView.CellPosition(0, 1));
- _buttonContainer.AddChild(blockButton, new TableView.CellPosition(0, 2));
- _buttonContainer.AddChild(runButton, new TableView.CellPosition(0, 3));
- _buttonContainer.AddChild(homeButton, new TableView.CellPosition(1, 0));
- _buttonContainer.AddChild(notRun, new TableView.CellPosition(1, 1));
- _buttonContainer.AddChild(preButton, new TableView.CellPosition(1, 2));
- _buttonContainer.AddChild(nextButton, new TableView.CellPosition(1, 3));
+ _runButton.DownFocusableView = _homeButton;
+ _homeButton.UpFocusableView = _runButton;
+ _homeButton.RightFocusableView = _preButton;
+ _preButton.UpFocusableView = _runButton;
+ _preButton.LeftFocusableView = _homeButton;
+ _preButton.RightFocusableView = _nextButton;
+ _nextButton.UpFocusableView = _runButton;
+ _nextButton.LeftFocusableView = _preButton;
+
+ _buttonContainer.Add(_passButton);
+ _buttonContainer.Add(_failButton);
+ _buttonContainer.Add(_blockButton);
+ _buttonContainer.Add(_runButton);
+ _buttonContainer2.Add(_homeButton);
+ _buttonContainer2.Add(_notRun);
+ _buttonContainer2.Add(_preButton);
+ _buttonContainer2.Add(_nextButton);
}
public void ExecuteTC(View view)
_caseView = view;
_caseView.ParentOrigin = Position.ParentOriginTopLeft;
_caseView.PivotPoint = PivotPoint.TopLeft;
- _caseView.Position = new Position(20.0f, 700.0f, 0.0f);
+ _caseView.Position = new Position(Window.Instance.Size.Width * 0.01f, Window.Instance.Size.Height * 0.74f, 0.0f);
_detailView.Add(_caseView);
_caseView.KeyEvent += OnKeyPressed;
_caseView.Show();
{
if (e.Key.KeyPressedName == "Down")
{
- FocusManager.Instance.SetCurrentFocusView(passButton);
+ FocusManager.Instance.SetCurrentFocusView(_passButton);
}
}
if (e.Key.KeyPressedName == "Up")
{
Tizen.Log.Fatal("NUI", "Set current focus view :: doneButton");
- FocusManager.Instance.SetCurrentFocusView(doneButton);
+ FocusManager.Instance.SetCurrentFocusView(_doneButton);
}
}
return false;
if (e.Key.KeyPressedName == "Down")
{
Tizen.Log.Fatal("NUI", "Set current focus view :: run");
- FocusManager.Instance.SetCurrentFocusView(run);
+ FocusManager.Instance.SetCurrentFocusView(_run);
}
}
return false;
public void ClearTestCase(View view)
{
- FocusManager.Instance.SetCurrentFocusView(runButton);
+ FocusManager.Instance.SetCurrentFocusView(_runButton);
Tizen.Log.Fatal("NUI", "Clear test case!");
_detailView.Remove(view);
}
_summaryLabel.Text = "Total : " + ResultNumber.Total + ", Pass : " + ResultNumber.Pass + ", Fail : " + ResultNumber.Fail + ", Block : " + ResultNumber.Block + ", Not Run : " + ResultNumber.NotRun;
}
- private PropertyMap CreateTextMap(float pointSize, string text)
- {
- PropertyMap map = new PropertyMap();
- map.Insert("visualType", new PropertyValue("TEXT"));
- map.Insert("pointSize", new PropertyValue(pointSize));
- map.Insert("text", new PropertyValue(text));
- return map;
- }
-
- private void CreateInitList()
- {
- int tcNum = _tcIDList.Count;
- Tizen.Log.Fatal("NUI", "_tcIDList.Count: " + _tcIDList.Count);
- buttonList = new PushButton[tcNum];
- for (int index = 0; index < tcNum; index++)
- {
- string name = _tcIDList[index];
- string testcaseName = "#." + (index + 1).ToString() + name;
- string resultText = "[" + _listItem[(int)index].Result + "]";
- string text = testcaseName + resultText;
- buttonList[index] = new PushButton();
- buttonList[index].CellIndex = new Vector2(index, 0);
- buttonList[index].Name = index.ToString();
- buttonList[index].Focusable = true;
- buttonList[index].Label = CreateTextMap(PointSize, text);
- buttonList[index].ParentOrigin = Position.ParentOriginTopLeft;
- buttonList[index].PivotPoint = PivotPoint.TopLeft;
- buttonList[index].Position = new Position(0.0f, 0.0f, 0.0f);
- buttonList[index].Clicked += (obj, e) =>
- {
- PushButton button = obj as PushButton;
-
- Tizen.Log.Fatal("TBT", "Item clicked!!::" + button.Name);
- CurrentTCNum = int.Parse(button.Name);
- _initView.Hide();
- UpdateDetailPage();
- _caseView.Hide();
- _detailView.Show();
- FocusManager.Instance.SetCurrentFocusView(runButton);
- return false;
- };
- buttonList[index].FocusGained += ManualTestNUI_FocusGained;
- _initList.AddChild(buttonList[index], new TableView.CellPosition((uint)index, 0));
-
- }
- }
-
- private void ManualTestNUI_FocusGained(object sender, EventArgs e)
- {
- var item = sender as PushButton;
- if (item != null)
- {
- uint idx = UInt32.Parse(item.Name);
- _scrollView.ScrollTo(new Vector2(0, 30 * idx));
- }
- }
-
private void CreateDetailList()
{
Tizen.Log.Fatal("NUI", "Print the CreateDetailList::");
- int senNum = CurrentTCInfo.Count;
+ int senNum = _currentTCInfo.Count;
for (int index = 0; index < senNum; index++)
{
TextLabel description = new TextLabel();
description.ParentOrigin = Position.ParentOriginTopLeft;
description.PivotPoint = PivotPoint.TopLeft;
description.Position = new Position(0.0f, 0.0f, 0.0f);
- description.Size2D = new Size2D((int)Window.Instance.Size.Width - 20, 50);
+ description.Size2D = new Size2D((int)(Window.Instance.Size.Width * 0.9895), (int)(Window.Instance.Size.Height * 0.0462));
description.HorizontalAlignment = HorizontalAlignment.Begin;
- description.PointSize = PointSize;
- description.Text = CurrentTCInfo[(int)index];
+ description.PointSize = _pointSize;
+ description.Text = _currentTCInfo[(int)index];
_detailList.AddChild(description, new TableView.CellPosition((uint)index, 0));
}
}
ResultNumber.Pass = 0;
ResultNumber.Fail = 0;
ResultNumber.Block = 0;
- TCInfoList = new List<TestcaseInfo>();
+ _tcInfoList = new List<TestcaseInfo>();
foreach (var testcaseItem in _listItem)
{
foreach (KeyValuePair<string, ITest> pair in _tRunner.GetTestList())
postconditions.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
}
}
- TCInfoList.Add(new TestcaseInfo
+ _tcInfoList.Add(new TestcaseInfo
{
TestcaseName = pair.Key,
Preconditions = preconditions,
//The data in CurrentTCInfo list will be show in _detailList.
void UpdateCurrentTCInfo()
{
- CurrentTCInfo = new List<string>();
- Tizen.Log.Fatal("NUI", "Print the CurrentTCNum::" + CurrentTCNum);
- CurrentTCInfo.Add("DESCRIPTION:#" + (CurrentTCNum + 1));
- string[] str = TCInfoList[CurrentTCNum].TestcaseName.Split('.');
- CurrentTCInfo.Add("CLASS:" + str[str.Length - 2]);
- CurrentTCInfo.Add("METHOD:" + str[str.Length - 1]);
- for(int index = 0; index < TCInfoList[CurrentTCNum].Preconditions.Count; index++)
- {
- CurrentTCInfo.Add(TCInfoList[CurrentTCNum].Preconditions[index]);
+ _currentTCInfo = new List<string>();
+ Tizen.Log.Fatal("NUI.Components", "Print the CurrentTCNum::" + _currentTCNum);
+ _currentTCInfo.Add("DESCRIPTION:#" + (_currentTCNum + 1));
+ string[] str = _tcInfoList[_currentTCNum].TestcaseName.Split('.');
+ _currentTCInfo.Add("CLASS:" + str[str.Length - 2]);
+ _currentTCInfo.Add("METHOD:" + str[str.Length - 1]);
+ for(int index = 0; index < _tcInfoList[_currentTCNum].Preconditions.Count; index++)
+ {
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Preconditions[index]);
}
- for(int index = 0; index < TCInfoList[CurrentTCNum].Steps.Count; index++ )
+ for(int index = 0; index < _tcInfoList[_currentTCNum].Steps.Count; index++ )
{
- CurrentTCInfo.Add(TCInfoList[CurrentTCNum].Steps[index]);
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Steps[index]);
}
- for(int index = 0; index < TCInfoList[CurrentTCNum].Postconditions.Count; index++ )
+ for(int index = 0; index < _tcInfoList[_currentTCNum].Postconditions.Count; index++ )
{
- CurrentTCInfo.Add(TCInfoList[CurrentTCNum].Postconditions[index]);
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Postconditions[index]);
}
- Tizen.Log.Fatal("NUI", "The CurrentTCNum::" + CurrentTCNum);
+ Tizen.Log.Fatal("NUI", "The CurrentTCNum::" + _currentTCNum);
}
private void OnSingleTestDone(object sender, SingleTestDoneEventArgs e)
//Test when will this event will be triggered
Tizen.Log.Fatal("NUI", "OnSingleTestDone has been triggered!");
// check old result
- if (_listItem[CurrentTCNum].Result.Contains(StrResult.FAIL))
+ if (_listItem[_currentTCNum].Result.Contains(StrResult.FAIL))
{
ResultNumber.Fail = ResultNumber.Fail - 1;
}
- else if (_listItem[CurrentTCNum].Result.Contains(StrResult.PASS))
+ else if (_listItem[_currentTCNum].Result.Contains(StrResult.PASS))
{
ResultNumber.Pass = ResultNumber.Pass - 1;
}
- else if (_listItem[CurrentTCNum].Result.Contains(StrResult.BLOCK))
+ else if (_listItem[_currentTCNum].Result.Contains(StrResult.BLOCK))
ResultNumber.Block = ResultNumber.Block - 1;
// Update new result
- _listItem[CurrentTCNum].Result = e.Result;
+ _listItem[_currentTCNum].Result = e.Result;
if (e.Result.Contains(StrResult.PASS))
{
ResultNumber.Pass += 1;
ResultNumber.Block += 1;
}
- _initList.RemoveChildAt(new TableView.CellPosition((uint)CurrentTCNum, 0));
- string name = _tcIDList[CurrentTCNum];
- string testcaseName = "#." + (CurrentTCNum + 1).ToString() + name;
- string resultText = "[" + _listItem[(int)CurrentTCNum].Result + "]";
- string text = testcaseName + resultText;
- PushButton button = new PushButton();
- button.CellIndex = new Vector2(CurrentTCNum, 0);
- button.Name = CurrentTCNum.ToString();
- button.Focusable = true;
- button.Label = CreateTextMap(PointSize, text);
- button.ParentOrigin = Position.ParentOriginTopLeft;
- button.PivotPoint = PivotPoint.TopLeft;
- button.Position = new Position(0.0f, 0.0f, 0.0f);
- button.Clicked += (obj, ee) =>
- {
- Tizen.Log.Fatal("NUI", "Item clicked clicked!!::" + ((int)button.CellIndex.X).ToString());
- CurrentTCNum = (int)button.CellIndex.X;
- _initView.Hide();
- UpdateDetailPage();
- _caseView.Hide();
- _detailView.Show();
- FocusManager.Instance.SetCurrentFocusView(runButton);
- return false;
- };
- _initList.AddChild(button, new TableView.CellPosition((uint)CurrentTCNum, 0));
+ FlexibleView.ViewHolder holder = _initList?.FindViewHolderForAdapterPosition(_currentTCNum);
+ if (holder != null)
+ {
+ string testcaseName = "#." + (_currentTCNum + 1).ToString() + _tcIDList[_currentTCNum];
+ string resultText = "[" + _listItem[(int)_currentTCNum].Result + "]";
+ string text = testcaseName + resultText;
+ Button btn = holder.ItemView as Button;
+ btn.Text = text;
+ _adapter?.UpdateItemData(_currentTCNum, _listItem);
+ }
+
SetSummaryResult();
- notRun.Text = _listItem[CurrentTCNum].Result;
+ _notRun.Text = _listItem[_currentTCNum].Result;
}
}
}
Microsoft Visual Studio Solution File, Format Version 12.00\r
-# Visual Studio 15\r
-VisualStudioVersion = 15.0.26124.0\r
+# Visual Studio Version 16\r
+VisualStudioVersion = 16.0.29905.134\r
MinimumVisualStudioVersion = 15.0.26124.0\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.Manual.Tests", "Tizen.NUI.Manual.Tests.csproj", "{66D8A33C-59A0-4F95-86BB-D4B98DB350B8}"\r
EndProject\r
using NUnit.Framework.TUnit;
using System.Reflection;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
namespace Tizen.NUI.Tests
{
class WearableManualTestNUI
{
+ class ListBridge : FlexibleView.Adapter
+ {
+ private List<string> _mDatas;
+ private List<ItemData> _mlistItem;
+
+ public ListBridge(List<string> datas, List<ItemData> item)
+ {
+ _mDatas = datas;
+ _mlistItem = item;
+ }
+
+ public void UpdateItemData(int position, List<ItemData> item)
+ {
+ _mlistItem = item;
+ }
+
+ public override FlexibleView.ViewHolder OnCreateViewHolder(int viewType)
+ {
+ FlexibleView.ViewHolder viewHolder = new FlexibleView.ViewHolder(new Button());
+ return viewHolder;
+ }
+
+ public override void OnBindViewHolder(FlexibleView.ViewHolder holder, int position)
+ {
+ string testcaseName = "#." + (position + 1).ToString() + _mDatas[position];
+ string resultText = "[" + _mlistItem[(int)position].Result + "]";
+ string text = testcaseName + resultText;
+
+ Button btn = holder.ItemView as Button;
+ if (btn)
+ {
+ btn.Size = new Size(Window.Instance.Size.Width, 120);
+ btn.Name = position.ToString();
+ btn.Text = text;
+ btn.PointSize = 4.0f;
+ btn.TextAlignment = HorizontalAlignment.Begin;
+ btn.Style.Text.TextColor = Color.White;
+ btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";
+ btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
+ }
+ }
+
+ public override void OnDestroyViewHolder(FlexibleView.ViewHolder holder)
+ {
+ if (holder.ItemView != null)
+ {
+ holder.ItemView.Dispose();
+ }
+ }
+
+ public override int GetItemCount()
+ {
+ return _mDatas.Count;
+ }
+ }
+
+ class DetailListBridge : FlexibleView.Adapter
+ {
+ private List<string> _mDatas;
+
+ public DetailListBridge(List<string> datas)
+ {
+ _mDatas = datas;
+ }
+
+ public override FlexibleView.ViewHolder OnCreateViewHolder(int viewType)
+ {
+ FlexibleView.ViewHolder viewHolder = new FlexibleView.ViewHolder(new Button());
+ return viewHolder;
+ }
+
+ public override void OnBindViewHolder(FlexibleView.ViewHolder holder, int position)
+ {
+ TextLabel label = holder.ItemView as TextLabel;
+ if (label)
+ {
+ label.TextColor = Color.White;
+ label.ParentOrigin = ParentOrigin.TopLeft;
+ label.PivotPoint = PivotPoint.TopLeft;
+ label.Position = new Position(0.0f, 0.0f, 0.0f);
+ label.Size = new Size(Window.Instance.Size.Width - 100, _detailScrollHeight);
+ label.HorizontalAlignment = HorizontalAlignment.Begin;
+ label.VerticalAlignment = VerticalAlignment.Center;
+ label.PointSize = 3.0f;
+ label.MultiLine = true;
+ label.Text = _mDatas[position];
+ }
+ }
+
+ public override void OnDestroyViewHolder(FlexibleView.ViewHolder holder)
+ {
+ if (holder.ItemView != null)
+ {
+ holder.ItemView.Dispose();
+ }
+ }
+
+ public override int GetItemCount()
+ {
+ return _mDatas.Count;
+ }
+ }
+
private List<string> _tcIDList;
private List<ItemData> _listItem;
private TSettings _tsettings;
private TRunner _tRunner;
- private NavigationButton _pressButton = NavigationButton.NA;
- private PushButton passButton, failButton, blockButton, homeButton, preButton, nextButton, doneButton;
- private TextLabel notRun;
+ private Button _passButton, _failButton, _blockButton, _homeButton, _preButton, _nextButton, _doneButton;
+ private TextLabel _notRun;
private const string STEP_ATTRIBUTE_NAME = "NUnit.Framework.StepAttribute";
private const string PRECONDITION_ATTRIBUTE_NAME = "NUnit.Framework.PreconditionAttribute";
private const string POSTCONDITION_ATTRIBUTE_NAME = "NUnit.Framework.PostconditionAttribute";
private List<string> _listNotPass;
- private static float PointSize = 5.0f;
+ private float _pointSize = 5.0f;
//Save the information of every single test case
- private List<TestcaseInfo> TCInfoList;
- private List<string> CurrentTCInfo;
+ private List<TestcaseInfo> _tcInfoList;
+ private List<string> _currentTCInfo;
- private static WearableManualTestNUI instance;
- private static Object lockObject = new object();
+ private static WearableManualTestNUI _instance;
+ private static Object _lockObject = new object();
//Show the result of all the test case
private TextLabel _summaryLabel1, _summaryLabel2, _description;
private View _initView;
private View _detailView;
-
- private ScrollView _initList;
- private ScrollView _detailList;
-
+ private FlexibleView _initList;
+ private ListBridge _adapter;
+ private FlexibleView _detailList;
+ private DetailListBridge _adapter_detail;
private View _caseView;
-
- private PushButton run;
- private PushButton runButton;
- private PushButton[] buttonList;
-
- private TextLabel[] resultList;
+ private Button _run;
+ private Button _runButton;
//Always save the current TC number;
- private int CurrentTCNum = 0;
-
- private static int _scrollWidth = Window.Instance.Size.Width;
- private static int _scrollHeight = 120;
-
+ private int _currentTCNum = 0;
private static int _detailScrollHeight = 60;
public static WearableManualTestNUI GetInstance()
{
- lock (lockObject)
+ lock (_lockObject)
{
- if (instance == null)
+ if (_instance == null)
{
- instance = new WearableManualTestNUI();
+ _instance = new WearableManualTestNUI();
}
}
- return instance;
+ return _instance;
}
private WearableManualTestNUI()
{
Window.Instance.BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 1.0f);
Tizen.Log.Fatal("NUI", "Initialize=========================================");
- PointSize = (1.0f / Window.Instance.Dpi.Length()) * 2000.0f;
+ _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 0.28f;
RunType.Value = RunType.MANUAL;
_tRunner = new TRunner();
_tRunner.LoadTestsuite();
window.GetDefaultLayer().Add(_detailView);
}
+ void SetCommonButtonStyle(Button btn, string text)
+ {
+ if (!btn) return;
+ btn.Text = text;
+ btn.PointSize = _pointSize;
+ btn.Style.Text.TextColor = new Selector<Color>
+ {
+ Normal = new Color(0, 0, 0, 1),
+ Pressed = new Color(0, 0, 0, 0.7f),
+ Selected = new Color(0.058f, 0.631f, 0.92f, 1),
+ Disabled = new Color(0, 0, 0, 0.4f)
+ };
+ btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";
+ btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
+ btn.TextColor = Color.White;
+ }
+
void InitializeFirstPage()
{
//Create Run Button, when you Click it, then the first test case will be executed.
- doneButton = new PushButton();
- doneButton.Size2D = new Size2D(120, 60);
- doneButton.Position2D = new Position2D(-150, -200);
- //doneButton.Position2D = new Position2D(50, 0);
- doneButton.Label = CreateTextVisual("Done", Color.White);
- doneButton.Clicked += (obj, ee) =>
+ _doneButton = new Button();
+ _doneButton.Position = new Position(-150, -200);
+ _doneButton.Size = new Size(120, 60);
+ SetCommonButtonStyle(_doneButton, "Done");
+ _doneButton.ClickEvent += (obj, ee) =>
{
TSettings.GetInstance().SubmitManualResult();
- return false;
};
- run = new PushButton();
- run.Size2D = new Size2D(120, 60);
- run.Position2D = new Position2D(20, -200);
- //run.Position2D = new Position2D(180, 0);
- run.Label = CreateTextVisual("Runner", Color.White); ;
- run.Clicked += (obj, ee) =>
+ _run = new Button();
+ _run.Position2D = new Position2D(20, -200);
+ _run.Size = new Size(120, 60);
+ SetCommonButtonStyle(_run, "Runner");
+ _run.ClickEvent += (obj, ee) =>
{
Tizen.Log.Fatal("NUI", "Check all the test case from the first one.");
- CurrentTCNum = 0;
+ _currentTCNum = 0;
_initView.Hide();
_caseView.Hide();
UpdateDetailPage();
_detailView.Show();
- return false;
};
- _initList = new ScrollView();
- _initList.Size2D = new Size2D(_scrollWidth, _scrollHeight);
- _initList.ParentOrigin = ParentOrigin.TopLeft;
- _initList.PivotPoint = PivotPoint.TopLeft;
- _initList.Position2D = new Position2D(0, 80);
- _initList.ClippingMode = ClippingModeType.ClipChildren;
CreateInitList();
- _initView.Add(doneButton);
- _initView.Add(run);
+ _initView.Add(_doneButton);
+ _initView.Add(_run);
_initView.Add(_initList);
Tizen.Log.Fatal("NUI", "TCT : InitializeFirstPage:");
}
void InitializeDetailPage()
{
- _detailList = new ScrollView();
- _detailList.BackgroundColor = Color.Black;
- _detailList.Size2D = new Size2D(_scrollWidth - 100, _detailScrollHeight);
- _detailList.ParentOrigin = ParentOrigin.TopLeft;
- _detailList.PivotPoint = PivotPoint.TopLeft;
- _detailList.Position2D = new Position2D(30, 20);
- _detailList.ClippingMode = ClippingModeType.ClipChildren;
-
_description = new TextLabel();
_description.TextColor = Color.White;
_description.PointSize = 3.0f;
_detailView.Add(_description);
CreateDetailList();
- _detailView.Add(_detailList);
-
//To Place the function button, such as PASS, FAIL.....
CreateButtons();
}
_detailView.Remove(_detailList);
_detailList.Dispose();
}
- Tizen.Log.Fatal("NUI", "Print the CurrentTCNum here::" + CurrentTCNum);
-
- _detailList = new ScrollView();
- _detailList.BackgroundColor = Color.Black;
- _detailList.Size2D = new Size2D(_scrollWidth - 100, _detailScrollHeight);
- _detailList.ParentOrigin = ParentOrigin.TopLeft;
- _detailList.PivotPoint = PivotPoint.TopLeft;
- _detailList.Position2D = new Position2D(30, 20);
- _detailList.ClippingMode = ClippingModeType.ClipChildren;
+ Tizen.Log.Fatal("NUI", "Print the CurrentTCNum here::" + _currentTCNum);
CreateDetailList();
- _detailView.Add(_detailList);
- if (notRun)
+ if (_notRun)
{
- notRun.Text = _listItem[CurrentTCNum].Result;
+ _notRun.Text = _listItem[_currentTCNum].Result;
}
}
private TextLabel CreateTextLabel(string textStr, int left)
//Create all the function buttons here, such as PASS, FAIL.....
void CreateButtons()
{
-
- notRun = new TextLabel();
- notRun.TextColor = Color.White;
- notRun.Size2D = new Size2D(40, 30);
- notRun.PointSize = 2.5f;
- notRun.Position2D = new Position2D(260, 118);
- notRun.HorizontalAlignment = HorizontalAlignment.Center;
- notRun.VerticalAlignment = VerticalAlignment.Center;
- notRun.MultiLine = true;
- notRun.Text = "Not Run";
-
- TextLabel pass = CreateTextLabel("P", 20);
- passButton = new PushButton();
- passButton.Size2D = new Size2D(70, 30);
- passButton.Position2D = new Position2D(0, 0);
- passButton.LabelText = "";
- passButton.Add(pass);
- passButton.Clicked += (obj, ee) =>
+ _notRun = new TextLabel();
+ _notRun.TextColor = Color.White;
+ _notRun.Size = new Size(40, 30);
+ _notRun.PointSize = 2.5f;
+ _notRun.Position = new Position(260, 118);
+ _notRun.HorizontalAlignment = HorizontalAlignment.Center;
+ _notRun.VerticalAlignment = VerticalAlignment.Center;
+ _notRun.MultiLine = true;
+ _notRun.Text = "Not Run";
+
+ _passButton = new Button();
+ SetCommonButtonStyle(_passButton, "P");
+ _passButton.Size = new Size(70, 30);
+ _passButton.Position = new Position(0, 0);
+ _passButton.ClickEvent += (obj, ee) =>
{
-
Clear();
if (!ManualTest.IsConfirmed())
{
_tsettings.TCResult = StrResult.PASS;
ManualTest.Confirm();
}
- Tizen.Log.Fatal("TBT", "Pass Button clicked!");
- return true;
+ Tizen.Log.Fatal("NUI", "Pass Button clicked!");
};
- TextLabel fail = CreateTextLabel("F", 20);
- failButton = new PushButton();
- failButton.Size2D = new Size2D(70, 30);
- failButton.Position2D = new Position2D(72, 0);
- failButton.LabelText = "";
- failButton.Add(fail);
- failButton.Clicked += (obj, ee) =>
+ _failButton = new Button();
+ SetCommonButtonStyle(_failButton, "F");
+ _failButton.Size = new Size(70, 30);
+ _failButton.Position = new Position(72, 0);
+ _failButton.ClickEvent += (obj, ee) =>
{
Clear();
if (!ManualTest.IsConfirmed())
_tsettings.TCResult = StrResult.FAIL;
ManualTest.Confirm();
}
- Tizen.Log.Fatal("TBT", "Fail Button clicked!");
- return true;
+ Tizen.Log.Fatal("NUI", "Fail Button clicked!");
};
- TextLabel block = CreateTextLabel("B", 20);
- blockButton = new PushButton();
- blockButton.Size2D = new Size2D(70, 30);
- blockButton.Position2D = new Position2D(144, 0);
- blockButton.LabelText = "";
- blockButton.Add(block);
- blockButton.Clicked += (obj, ee) =>
+ _blockButton = new Button();
+ SetCommonButtonStyle(_blockButton, "B");
+ _blockButton.Size = new Size(70, 30);
+ _blockButton.Position = new Position(144, 0);
+ _blockButton.ClickEvent += (obj, ee) =>
{
Clear();
if (!ManualTest.IsConfirmed())
_tsettings.TCResult = StrResult.BLOCK;
ManualTest.Confirm();
}
- return true;
};
- TextLabel run = CreateTextLabel("R", 20);
- runButton = new PushButton();
- runButton.Size2D = new Size2D(70, 30);
- runButton.Position2D = new Position2D(216, 0);
- runButton.LabelText = "";
- runButton.Add(run);
- runButton.Clicked += (obj, ee) =>
+ _runButton = new Button();
+ SetCommonButtonStyle(_runButton, "R");
+ _runButton.Size = new Size(70, 30);
+ _runButton.Position = new Position(216, 0);
+ _runButton.ClickEvent += (obj, ee) =>
{
Clear();
- //should update the _caseView by the test case
- _pressButton = NavigationButton.NA;
- _tsettings.Testcase_ID = _tcIDList[CurrentTCNum];
+ _tsettings.Testcase_ID = _tcIDList[_currentTCNum];
_tsettings.TCResult = "";
_tRunner.Execute();
- return true;
};
- TextLabel home = CreateTextLabel("H", 15);
- homeButton = new PushButton();
- homeButton.Size2D = new Size2D(60, 30);
- homeButton.Position2D = new Position2D(15, 32);
- homeButton.LabelText = "";
- homeButton.Add(home);
- homeButton.Clicked += (obj, ee) =>
+ _homeButton = new Button();
+ SetCommonButtonStyle(_homeButton, "H");
+ _homeButton.Size = new Size(60, 30);
+ _homeButton.Position = new Position(15, 32);
+ _homeButton.ClickEvent += (obj, ee) =>
{
Clear();
- _pressButton = NavigationButton.Home;
if (!ManualTest.IsConfirmed())
{
_tsettings.TCResult = StrResult.NOTRUN;
_detailView.Hide();
_initView.Show();
}
- return true;
};
- TextLabel pre = CreateTextLabel("<<", 15);
- preButton = new PushButton();
- preButton.Size2D = new Size2D(60, 30);
- preButton.Position2D = new Position2D(128, 32);
- preButton.LabelText = "";
- preButton.Add(pre);
- preButton.Clicked += (obj, ee) =>
+ _preButton = new Button();
+ SetCommonButtonStyle(_homeButton, "<<");
+ _preButton.Size = new Size(60, 30);
+ _preButton.Position = new Position(128, 32);
+ _preButton.ClickEvent += (obj, ee) =>
{
Clear();
if (!ManualTest.IsConfirmed())
}
else
{
- if (CurrentTCNum != 0)
+ if (_currentTCNum != 0)
{
- CurrentTCNum--;
- notRun.Text = _listItem[CurrentTCNum].Result;
+ _currentTCNum--;
+ _notRun.Text = _listItem[_currentTCNum].Result;
ManualTest.Confirm();
UpdateDetailPage();
}
}
- return true;
};
- TextLabel next = CreateTextLabel(">>", 15);
- nextButton = new PushButton();
- nextButton.Size2D = new Size2D(60, 30);
- nextButton.Position2D = new Position2D(193, 32);
- nextButton.Add(next);
- nextButton.LabelText = "";
- nextButton.Clicked += (obj, ee) =>
+ _nextButton = new Button();
+ SetCommonButtonStyle(_homeButton, ">>");
+ _nextButton.Size = new Size(60, 30);
+ _nextButton.Position = new Position(193, 32);
+ _nextButton.ClickEvent += (obj, ee) =>
{
Clear();
if (!ManualTest.IsConfirmed())
_tsettings.TCResult = StrResult.NOTRUN;
ManualTest.Confirm();
}
- if (CurrentTCNum + 1 != ResultNumber.Total)
+ if (_currentTCNum + 1 != ResultNumber.Total)
{
- Tizen.Log.Fatal("NUI", "Print the [not run] CurrentTCNum::" + CurrentTCNum);
- CurrentTCNum++;
- notRun.Text = _listItem[CurrentTCNum].Result;
+ Tizen.Log.Fatal("NUI", "Print the [not run] CurrentTCNum::" + _currentTCNum);
+ _currentTCNum++;
+ _notRun.Text = _listItem[_currentTCNum].Result;
UpdateDetailPage();
}
- return true;
};
View buttonView = new View();
buttonView.Size2D = new Size2D(Window.Instance.Size.Width, 80);
buttonView.Position2D = new Position2D(-140, 120);
- buttonView.Add(passButton);
- buttonView.Add(failButton);
- buttonView.Add(blockButton);
- buttonView.Add(runButton);
- buttonView.Add(homeButton);
- buttonView.Add(notRun);
- buttonView.Add(preButton);
- buttonView.Add(nextButton);
+ buttonView.Add(_passButton);
+ buttonView.Add(_failButton);
+ buttonView.Add(_blockButton);
+ buttonView.Add(_runButton);
+ buttonView.Add(_homeButton);
+ buttonView.Add(_notRun);
+ buttonView.Add(_preButton);
+ buttonView.Add(_nextButton);
_detailView.Add(buttonView);
}
Tizen.Log.Fatal("ManualTCT", "Set the result Text");
}
- private PropertyMap CreateTextMap(float pointSize, string text)
- {
- PropertyMap map = new PropertyMap();
- map.Insert("visualType", new PropertyValue("TEXT"));
- map.Insert("pointSize", new PropertyValue(pointSize));
- map.Insert("text", new PropertyValue(text));
- return map;
- }
-
private void CreateInitList()
{
- int tcNum = _tcIDList.Count;
- buttonList = new PushButton[tcNum];
- resultList = new TextLabel[tcNum];
- for (int index = 0; index < tcNum; index++)
- {
- string name = _tcIDList[index];
- string testcaseName = "#." + (index + 1).ToString();
- Tizen.Log.Fatal("ManualTCT", "name: " + name);
- TextLabel label = new TextLabel();
- label.TextColor = Color.White;
- label.Text = testcaseName;
- label.PointSize = 4.0f;
- label.VerticalAlignment = VerticalAlignment.Center;
- label.ParentOrigin = ParentOrigin.TopLeft;
- label.PivotPoint = PivotPoint.TopLeft;
- label.Size2D = new Size2D(40, _scrollHeight);
- label.Position2D = new Position2D(0, 0);
-
-
- TextLabel nameLabel = new TextLabel();
- nameLabel.ParentOrigin = ParentOrigin.TopLeft;
- nameLabel.PivotPoint = PivotPoint.TopLeft;
- nameLabel.Text = name;
- nameLabel.VerticalAlignment = VerticalAlignment.Bottom;
- nameLabel.PointSize = 4.0f;
- nameLabel.TextColor = Color.White;
- nameLabel.MultiLine = true;
- nameLabel.Size2D = new Size2D(245, _scrollHeight);
- nameLabel.Position2D = new Position2D(5, 0);
- nameLabel.TextColor = Color.White;
-
- string resultText = "[" + _listItem[(int)index].Result + "]";
- buttonList[index] = new PushButton();
- buttonList[index].Name = index.ToString();
- buttonList[index].ParentOrigin = ParentOrigin.TopLeft;
- buttonList[index].PivotPoint = PivotPoint.TopLeft;
- buttonList[index].Position = new Position(33, 0.0f, 0.0f);
- buttonList[index].Size2D = new Size2D(255, _scrollHeight);
- buttonList[index].LabelText = "";
- buttonList[index].Add(nameLabel);
- buttonList[index].Clicked += (obj, e) =>
+ Tizen.Log.Fatal("ManualTCT", "CreateInitList");
+ _initList = new FlexibleView();
+ _initList.ParentOrigin = ParentOrigin.TopLeft;
+ _initList.PivotPoint = PivotPoint.TopLeft;
+ _initList.Size = new Size(Window.Instance.Size.Width, 400);
+ _initList.Position = new Position(0, 80);
+ _initList.ClippingMode = ClippingModeType.ClipChildren;
+ _adapter = new ListBridge(_tcIDList, _listItem);
+ _initList.SetAdapter(_adapter);
+ LinearLayoutManager layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL);
+ _initList.SetLayoutManager(layoutManager);
+ _initList.FocusedItemIndex = 0;
+ _initList.ItemClickEvent += (obj, e) =>
+ {
+ Button button = e.ClickedView.ItemView as Button;
+ if (button)
{
- PushButton button = obj as PushButton;
-
- Tizen.Log.Fatal("TBT", "Item clicked!!!!!!!!!!!!!!::" + button.Name);
- CurrentTCNum = int.Parse(button.Name);
+ Tizen.Log.Fatal("NUI", "Item clicked!!::" + button.Name);
+ _currentTCNum = int.Parse(button.Name);
_initView.Hide();
UpdateDetailPage();
_caseView.Hide();
_detailView.Show();
- return false;
- };
-
- resultList[index] = new TextLabel();
- resultList[index].TextColor = Color.White;
- resultList[index].PointSize = 3.0f;
- resultList[index].Name = index.ToString();
- resultList[index].Text = resultText;
- resultList[index].ParentOrigin = ParentOrigin.TopLeft;
- resultList[index].PivotPoint = PivotPoint.TopLeft;
- resultList[index].Position = new Position(285.0f, 0.0f, 0.0f);
- resultList[index].Size2D = new Size2D(65, _scrollHeight);
- resultList[index].VerticalAlignment = VerticalAlignment.Center;
- resultList[index].HorizontalAlignment = HorizontalAlignment.Center;
-
- View pageActor = new View();
- pageActor.WidthResizePolicy = ResizePolicyType.FillToParent;
- pageActor.HeightResizePolicy = ResizePolicyType.FillToParent;
- pageActor.ParentOrigin = ParentOrigin.TopLeft;
- pageActor.PivotPoint = PivotPoint.TopLeft;
- pageActor.Position = new Position(0, index * _scrollHeight, 0.0f);
-
- pageActor.Add(label);
- pageActor.Add(buttonList[index]);
- pageActor.Add(resultList[index]);
- _initList.Add(pageActor);
- }
- _initList.SetAxisAutoLock(false);
- PropertyMap rulerMapY = new PropertyMap();
- rulerMapY.Add((int)ScrollModeType.XAxisScrollEnabled, new PropertyValue(false));
- rulerMapY.Add((int)ScrollModeType.YAxisScrollEnabled, new PropertyValue(true));
- rulerMapY.Add((int)ScrollModeType.YAxisSnapToInterval, new PropertyValue(_scrollHeight));
- rulerMapY.Add((int)ScrollModeType.YAxisScrollBoundary, new PropertyValue(_scrollHeight * tcNum));
- _initList.ScrollMode = rulerMapY;
-
- Tizen.Log.Fatal("ManualTCT", "Initial ScrollView");
+ }
+ };
}
private void CreateDetailList()
{
- Tizen.Log.Fatal("NUI", "Print the CreateDetailList::count: " + CurrentTCInfo.Count);
- int senNum = CurrentTCInfo.Count;
- _description.Text = CurrentTCInfo[0];
- for (int index = 1; index < senNum; index++)
- {
- TextLabel description = new TextLabel();
- description.TextColor = Color.White;
- description.ParentOrigin = ParentOrigin.TopLeft;
- description.PivotPoint = PivotPoint.TopLeft;
- description.Position = new Position(0.0f, 0.0f, 0.0f);
- description.Size2D = new Size2D((int)Window.Instance.Size.Width - 100, _detailScrollHeight);
- description.HorizontalAlignment = HorizontalAlignment.Begin;
- description.VerticalAlignment = VerticalAlignment.Center;
- description.PointSize = 3.0f;
- description.MultiLine = true;
- description.Text = CurrentTCInfo[(int)index];
-
- View pageActor = new View();
- pageActor.WidthResizePolicy = ResizePolicyType.FillToParent;
- pageActor.HeightResizePolicy = ResizePolicyType.FillToParent;
- pageActor.ParentOrigin = ParentOrigin.TopLeft;
- pageActor.PivotPoint = PivotPoint.TopLeft;
- pageActor.Position = new Position(0, (index - 1) * _detailScrollHeight, 0.0f);
- pageActor.Add(description);
- _detailList.Add(pageActor);
- }
- _detailList.SetAxisAutoLock(false);
- PropertyMap rulerMapY = new PropertyMap();
- rulerMapY.Add((int)ScrollModeType.XAxisScrollEnabled, new PropertyValue(false));
- rulerMapY.Add((int)ScrollModeType.YAxisScrollEnabled, new PropertyValue(true));
- rulerMapY.Add((int)ScrollModeType.YAxisSnapToInterval, new PropertyValue(_detailScrollHeight));
- rulerMapY.Add((int)ScrollModeType.YAxisScrollBoundary, new PropertyValue(_detailScrollHeight * (senNum - 1)));
- _detailList.ScrollMode = rulerMapY;
+ Tizen.Log.Fatal("NUI", "Print the CreateDetailList::count: " + _currentTCInfo.Count);
+ _description.Text = _currentTCInfo[0];
+
+ _detailList = new FlexibleView();
+ _detailList.ParentOrigin = ParentOrigin.TopLeft;
+ _detailList.PivotPoint = PivotPoint.TopLeft;
+ _detailList.Size = new Size(Window.Instance.Size.Width - 100, _detailScrollHeight);
+ _detailList.Position = new Position(30, 20);
+ _detailList.BackgroundColor = Color.Black;
+ _detailList.ClippingMode = ClippingModeType.ClipChildren;
+ _adapter_detail = new DetailListBridge(_currentTCInfo);
+ _detailList.SetAdapter(_adapter_detail);
+ LinearLayoutManager layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL);
+ _detailList.SetLayoutManager(layoutManager);
+ _detailView.Add(_detailList);
}
//Init all the data, should be offered by Test Framework
ResultNumber.Pass = 0;
ResultNumber.Fail = 0;
ResultNumber.Block = 0;
- TCInfoList = new List<TestcaseInfo>();
+ _tcInfoList = new List<TestcaseInfo>();
foreach (var testcaseItem in _listItem)
{
foreach (KeyValuePair<string, ITest> pair in _tRunner.GetTestList())
postconditions.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
}
}
- TCInfoList.Add(new TestcaseInfo
+ _tcInfoList.Add(new TestcaseInfo
{
TestcaseName = pair.Key,
Preconditions = preconditions,
//The data in CurrentTCInfo list will be show in _detailList.
void UpdateCurrentTCInfo()
{
- CurrentTCInfo = new List<string>();
- Tizen.Log.Fatal("NUI", "Print the CurrentTCNum::" + CurrentTCNum);
- CurrentTCInfo.Add("DESCRIPTION:#" + (CurrentTCNum + 1));
- string[] str = TCInfoList[CurrentTCNum].TestcaseName.Split('.');
- CurrentTCInfo.Add("CLASS:" + str[str.Length - 2]);
- CurrentTCInfo.Add("METHOD:" + str[str.Length - 1]);
- for(int index = 0; index < TCInfoList[CurrentTCNum].Preconditions.Count; index++)
- {
- CurrentTCInfo.Add(TCInfoList[CurrentTCNum].Preconditions[index]);
+ _currentTCInfo = new List<string>();
+ Tizen.Log.Fatal("NUI.Components", "Print the CurrentTCNum::" + _currentTCNum);
+ _currentTCInfo.Add("DESCRIPTION:#" + (_currentTCNum + 1));
+ string[] str = _tcInfoList[_currentTCNum].TestcaseName.Split('.');
+ _currentTCInfo.Add("CLASS:" + str[str.Length - 2]);
+ _currentTCInfo.Add("METHOD:" + str[str.Length - 1]);
+ for(int index = 0; index < _tcInfoList[_currentTCNum].Preconditions.Count; index++)
+ {
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Preconditions[index]);
}
- for(int index = 0; index < TCInfoList[CurrentTCNum].Steps.Count; index++ )
+ for(int index = 0; index < _tcInfoList[_currentTCNum].Steps.Count; index++ )
{
- CurrentTCInfo.Add(TCInfoList[CurrentTCNum].Steps[index]);
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Steps[index]);
}
- for(int index = 0; index < TCInfoList[CurrentTCNum].Postconditions.Count; index++ )
+ for(int index = 0; index < _tcInfoList[_currentTCNum].Postconditions.Count; index++ )
{
- CurrentTCInfo.Add(TCInfoList[CurrentTCNum].Postconditions[index]);
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Postconditions[index]);
}
- Tizen.Log.Fatal("NUI", "Ppppppppppppppppppppppprint the CurrentTCNum::" + CurrentTCNum);
+ Tizen.Log.Fatal("NUI", "the CurrentTCNum::" + _currentTCNum);
}
private void OnSingleTestDone(object sender, SingleTestDoneEventArgs e)
//Test when will this event will be triggered
Tizen.Log.Fatal("NUI", "OnSingleTestDone has been triggered!");
// check old result
- if (_listItem[CurrentTCNum].Result.Contains(StrResult.FAIL))
+ if (_listItem[_currentTCNum].Result.Contains(StrResult.FAIL))
{
ResultNumber.Fail = ResultNumber.Fail - 1;
}
- else if (_listItem[CurrentTCNum].Result.Contains(StrResult.PASS))
+ else if (_listItem[_currentTCNum].Result.Contains(StrResult.PASS))
{
ResultNumber.Pass = ResultNumber.Pass - 1;
}
- else if (_listItem[CurrentTCNum].Result.Contains(StrResult.BLOCK))
+ else if (_listItem[_currentTCNum].Result.Contains(StrResult.BLOCK))
ResultNumber.Block = ResultNumber.Block - 1;
// Update new result
- _listItem[CurrentTCNum].Result = e.Result;
+ _listItem[_currentTCNum].Result = e.Result;
if (e.Result.Contains(StrResult.PASS))
{
ResultNumber.Pass += 1;
{
ResultNumber.Block += 1;
}
- TextLabel label = resultList[CurrentTCNum];
- label.Text = _listItem[(int)CurrentTCNum].Result;
- SetSummaryResult();
- notRun.Text = _listItem[CurrentTCNum].Result;
- }
- private PropertyMap CreateTextVisual(string text, Color color)
- {
- PropertyMap map = new PropertyMap();
- map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
- map.Add(TextVisualProperty.Text, new PropertyValue(text));
- map.Add(TextVisualProperty.TextColor, new PropertyValue(color));
- map.Add(TextVisualProperty.PointSize, new PropertyValue(6.0f));
- map.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue("CENTER"));
- map.Add(TextVisualProperty.VerticalAlignment, new PropertyValue("BOTTOM"));
- return map;
+ FlexibleView.ViewHolder holder = _initList?.FindViewHolderForAdapterPosition(_currentTCNum);
+ if (holder != null)
+ {
+ string testcaseName = "#." + (_currentTCNum + 1).ToString() + _tcIDList[_currentTCNum];
+ string resultText = "[" + _listItem[(int)_currentTCNum].Result + "]";
+ string text = testcaseName + resultText;
+ Button btn = holder.ItemView as Button;
+ btn.Text = text;
+ _adapter?.UpdateItemData(_currentTCNum, _listItem);
+ }
+ SetSummaryResult();
+ _notRun.Text = _listItem[_currentTCNum].Result;
}
}
}
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-using System;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.UIComponents;
-
-namespace Tizen.NUI.Tests
-{
- [TestFixture]
- [Description("Tizen.NUI.UIComponents.Button test")]
- public class ButtonTests
- {
- private ManualTestNUI _testPage;
- private WearableManualTestNUI _wearTestPage;
- private PushButton _button;
- private float PointSize = 5.0f;
-
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
- if (Window.Instance.Size.Width > 1000)
- {
- PointSize = 20.0f;
- }
-
- if(ManualTest.IsWearable())
- {
- PointSize = 4.0f;
- _wearTestPage = WearableManualTestNUI.GetInstance();
- }
- else
- {
- _testPage = ManualTestNUI.GetInstance();
- }
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
- }
-
- private PropertyMap CreateTextMap(float pointSize, string text)
- {
- PropertyMap map = new PropertyMap();
- map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
- map.Add(TextVisualProperty.Text, new PropertyValue(text));
- map.Add(TextVisualProperty.PointSize, new PropertyValue(pointSize));
- if (ManualTest.IsWearable())
- {
- map.Add(TextVisualProperty.TextColor, new PropertyValue(Color.White));
- map.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue("CENTER"));
- map.Add(TextVisualProperty.VerticalAlignment, new PropertyValue("BOTTOM"));
- }
- return map;
- }
-
- private void CreateButton(string buttonText)
- {
- _button = new PushButton();
- _button.Label = CreateTextMap(PointSize, buttonText);
- if(ManualTest.IsWearable())
- {
- _button.Size2D = new Size2D(200, 50);
- _wearTestPage.ExecuteTC(_button);
- }
- else
- {
- _testPage.ExecuteTC(_button);
- }
- }
-
- public bool OnClicked(object sender, EventArgs e)
- {
- Tizen.Log.Fatal("NUI", "PushButton OnClicked!!!!!!!!!!!!!!!!!!!!!");
- _button.Label = CreateTextMap(PointSize, "Cliked");
- ManualTest.Confirm();
- return false;
- }
-
- public bool OnPressed(object sender, EventArgs e)
- {
- Tizen.Log.Fatal("NUI", "TUnit OnPressed!!!!!!!!!!!!!!!!!!!!!");
- _button.Label = CreateTextMap(PointSize, "Pressed");
- ManualTest.Confirm();
- return false;
- }
-
- public bool OnReleased(object sender, EventArgs e)
- {
- Tizen.Log.Fatal("NUI", "TUnit OnReleased!!!!!!!!!!!!!!!!!!!!!");
- _button.Label = CreateTextMap(PointSize, "Released");
- ManualTest.Confirm();
- return false;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event click button.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.Button.Clicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button(Press the Enter key on the TV emulator)")]
- [Postcondition(1, "NA")]
- public async Task Clicked_CB()
- {
- CreateButton("Click me!");
- _button.Clicked += OnClicked;
- await ManualTest.WaitForConfirm();
- _button.Clicked -= OnClicked;
- if (ManualTest.IsWearable())
- {
- _wearTestPage.ClearTestCase(_button);
- }
- else
- {
- _testPage.ClearTestCase(_button);
- }
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event Pressed button.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.Button.Pressed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press button(Press the Enter key on the TV emulator)")]
- [Postcondition(1, "NA")]
- public async Task Pressed_CB()
- {
- CreateButton("Press!");
- _button.Pressed += OnPressed;
- await ManualTest.WaitForConfirm();
- _button.Pressed -= OnPressed;
- if (ManualTest.IsWearable())
- {
- _wearTestPage.ClearTestCase(_button);
- }
- else
- {
- _testPage.ClearTestCase(_button);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event Released button.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.Button.Released E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press and Release button(Press the Enter key on the TV emulator and relese the key)")]
- [Postcondition(1, "NA")]
- public async Task Released_CB()
- {
- CreateButton("Press & Release!");
- _button.Released += OnReleased;
- await ManualTest.WaitForConfirm();
- _button.Released -= OnReleased;
- if (ManualTest.IsWearable())
- {
- _wearTestPage.ClearTestCase(_button);
- }
- else
- {
- _testPage.ClearTestCase(_button);
- }
- }
- }
-}
-
-
-
using System.Threading.Tasks;
using NUnit.Framework;
using NUnit.Framework.TUnit;
-using Tizen.NUI;
-using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI.Tests
{
private ManualTestNUI _testPage;
private WearableManualTestNUI _wearTestPage;
- private PushButton _button1;
+ private Button _button1;
private FocusManager _focusManager;
- private float PointSize = 5.0f;
+ private float _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f;
private TextLabel _label;
[SetUp]
{
LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
_focusManager = FocusManager.Instance;
- if (Window.Instance.Size.Width > 1000)
- {
- PointSize = 20.0f;
- }
if (ManualTest.IsWearable())
{
- PointSize = 2.0f;
+ _pointSize = 2.0f;
_label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!");
_wearTestPage = WearableManualTestNUI.GetInstance();
}
LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
}
- private PropertyMap CreateTextMap(float pointSize, string text)
- {
- PropertyMap map = new PropertyMap();
- map.Insert("visualType", new PropertyValue("TEXT"));
- map.Insert("pointSize", new PropertyValue(pointSize));
- map.Insert("text", new PropertyValue(text));
- return map;
- }
-
private void CreateTestView(string information)
{
- _button1 = new PushButton();
- _button1.Label = CreateTextMap(PointSize, information);
+ _button1 = new Button();
+ _button1.Text = information;
+ _button1.PointSize = _pointSize;\r
+ _button1.BackgroundColor = Color.Cyan;
+ _button1.Size = new Size(Window.Instance.Size.Width * 0.1f, Window.Instance.Size.Height * 0.0462f);
+ _button1.Focusable = true;
FocusManager.Instance.SetAsFocusGroup(_button1, true);
_testPage.ExecuteTC(_button1);
}
public View OnPreFocusChange(object sender, EventArgs e)
{
Tizen.Log.Fatal("NUI", "TUnit PreFocusChanged!!!!!!!!!!!!!!!!!!!!!");
- _button1.Label = CreateTextMap(PointSize, "PreFocusChanged");
+ _button1.Text = "PreFocusChanged";
ManualTest.Confirm();
return _button1;
}
public void OnFocusedViewEnterKeyPressed(object sender, EventArgs e)
{
Tizen.Log.Fatal("NUI", "TUnit FocusedViewEnterKeyPressed!!!!!!!!!!!!!!!!!!!!!");
- _button1.Label = CreateTextMap(PointSize, "FocusedViewEnterKeyPressed");
+ _button1.Text = "FocusedViewEnterKeyPressed";
ManualTest.Confirm();
}
public void OnFocusGroupChanged(object sender, EventArgs e)
{
Tizen.Log.Fatal("NUI", "TUnit FocusGroupChanged!!!!!!!!!!!!!!!!!!!!!");
- _button1.Label = CreateTextMap(PointSize, "FocusGroupChanged");
+ _button1.Text = "FocusGroupChanged";
ManualTest.Confirm();
}
using System.Threading.Tasks;
using NUnit.Framework;
using NUnit.Framework.TUnit;
-using Tizen.NUI;
-using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI.Tests
private ManualTestNUI _testPage;
private WearableManualTestNUI _wearTestPage;
private Window _window;
- private PushButton _button;
- private float _PointSize = 5.0f;
+ private Button _button;
+ private float _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f;
private TextLabel _label;
private TextEditor _textEditor;
{
LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
_window = Window.Instance;
- if (Window.Instance.Size.Width > 1000)
- {
- _PointSize = 20.0f;
- }
if (ManualTest.IsWearable())
{
- _PointSize = 2.0f;
+ _pointSize = 2.0f;
_label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!");
_wearTestPage = WearableManualTestNUI.GetInstance();
}
LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
}
- private PropertyMap CreateTextMap(float pointSize, string text)
- {
- PropertyMap map = new PropertyMap();
- map.Insert("visualType", new PropertyValue("TEXT"));
- map.Insert("pointSize", new PropertyValue(pointSize));
- map.Insert("text", new PropertyValue(text));
- return map;
- }
-
private void CreateView(string information)
- {
- _button = new PushButton();
- _button.Label = CreateTextMap(_PointSize, information);
-
+ {\r
+ _button = new Button();
+ _button.Text = information;
+ _button.PointSize = _pointSize;
+ _button.BackgroundColor = Color.Cyan;
+ _button.Size = new Size(Window.Instance.Size.Width * 0.1f, Window.Instance.Size.Height * 0.0462f);
+ _button.Focusable = true;
_testPage.ExecuteTC(_button);
}
using Tizen.Applications;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.UIComponents;
namespace Tizen.NUI.Tests
{
using NUnit.Framework.TUnit;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.UIComponents;
using Tizen.Applications;
namespace Tizen.NUI.Tests
{
private ManualTestNUI _testPage;
private WearableManualTestNUI _wearTestPage;
- private float _pointSize = 5.0f;
+ private float _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f;
private bool _isMobile = false;
private bool _isWearable = false;
private bool _isEmulator = false;
}
AppControl.SendLaunchRequest(myAppControl);
- if (Window.Instance.Size.Width > 1000)
- {
- _pointSize = 20.0f;
- }
-
if(ManualTest.IsWearable())
{
_pointSize = 4.0f;
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-using System;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.NUI;
-using Tizen.NUI.UIComponents;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Tests
-{
- [TestFixture]
- [Description("Tizen.NUI.UIComponents.Popup test")]
- public class PopupTests
- {
- private ManualTestNUI _testPage;
- private WearableManualTestNUI _wearTestPage;
- private Window _window;
- private PushButton _button;
- private float _PointSize = 5.0f;
- private TextLabel _label;
- private Popup _popup;
-
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
- _window = Window.Instance;
- if (Window.Instance.Size.Width > 1000)
- {
- _PointSize = 20.0f;
- }
- if (ManualTest.IsWearable())
- {
- _PointSize = 2.0f;
- _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!");
- _wearTestPage = WearableManualTestNUI.GetInstance();
- }
- else
- {
- _testPage = ManualTestNUI.GetInstance();
- }
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
- }
-
- private PropertyMap CreateTextMap(float pointSize, string text)
- {
- PropertyMap map = new PropertyMap();
- map.Insert("visualType", new PropertyValue("TEXT"));
- map.Insert("pointSize", new PropertyValue(pointSize));
- map.Insert("text", new PropertyValue(text));
- return map;
- }
-
- private void CreateView(string information)
- {
- _button = new PushButton();
- _button.Label = CreateTextMap(_PointSize, information);
-
- _testPage.ExecuteTC(_button);
- }
-
- public void OnPopupEvent(object sender, EventArgs e)
- {
- Tizen.Log.Fatal("NUI", "Popup event !!!!!");
- ManualTest.Confirm();
- _window.Remove(_popup);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event TouchedOutside.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.Popup.TouchedOutside E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
- [Step(1, "Connect the mouse to the TV (TM-1 don't need)")]
- [Step(2, "Click run button to run TC")]
- [Step(3, "Touch window outside of dialog or click mouse out of dialog(on TV).")]
- [Step(4, "If your touch or click outside the dialog, TC will pass")]
- [Postcondition(1, "NA")]
- public async Task TouchedOutside_CB()
- {
- if (ManualTest.IsWearable())
- {
- _wearTestPage.ExecuteTC(_label);
- await ManualTest.WaitForConfirm();
- _wearTestPage.ClearTestCase(_label);
- }
- else
- {
- CreateView("Touch or click outside of Popup");
- _popup = new Popup()
- {
- Size2D = new Size2D(100, 100),
- BackgroundColor = Color.Magenta,
- Focusable = true,
- HeightResizePolicy = ResizePolicyType.Fixed,
- WidthResizePolicy = ResizePolicyType.Fixed,
- TooltipText = "This is a popup",
- AnimationDuration = 0.0f,
- DisplayState = Popup.DisplayStateType.Shown
- };
-
- _popup.TouchedOutside += OnPopupEvent;
- _window.Add(_popup);
-
- _popup.Show();\r
- // Waits for user confirmation.
- await ManualTest.WaitForConfirm();
- _popup.TouchedOutside -= OnPopupEvent;
- _testPage.ClearTestCase(_button);
- }
- }
- }
-}
-
-
-
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-using System;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.NUI;
-using Tizen.NUI.UIComponents;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Tests
-{
- [TestFixture]
- [Description("Tizen.NUI.UIComponents.ScrollBar test")]
- public class ScrollBarTests
- {
- private ManualTestNUI _testPage;
- private WearableManualTestNUI _wearTestPage;
- private PushButton _button;
- private ScrollBar _scrollBar;
- private float PointSize = 5.0f;
- private TextLabel _label;
-
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
- if (Window.Instance.Size.Width > 1000)
- {
- PointSize = 20.0f;
- }
-
- if (ManualTest.IsWearable())
- {
- PointSize = 2.0f;
- _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!");
- _wearTestPage = WearableManualTestNUI.GetInstance();
- }
- else
- {
- _testPage = ManualTestNUI.GetInstance();
- }
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
- }
-
- private PropertyMap CreateTextMap(float pointSize, string text)
- {
- PropertyMap map = new PropertyMap();
- map.Insert("visualType", new PropertyValue("TEXT"));
- map.Insert("pointSize", new PropertyValue(pointSize));
- map.Insert("text", new PropertyValue(text));
- return map;
- }
-
- private void CreateView(string information)
- {
- _button = new PushButton();
- _button.Label = CreateTextMap(PointSize, information);
-
- // Invoke ExecuteTC() method to add UI to test area.
- _testPage.ExecuteTC(_button);
- }
-
- private void OnPanFinished(object sender, EventArgs e)
- {
- Tizen.Log.Fatal("NUI", "TUnit OnPanFinished!");
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: PanFinished should be triggerred without any error.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.PanFinished E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
- [Precondition(1, "Prepare a mouse connect to target.")]
- [Precondition(2, "Open terminal to enter command.")]
- [Precondition(3, "Enter command \"vconftool set -t bool memory/window_system/input/force_enable_cursor 1 -f\" to enable mouse")]
- [Step(1, "Click run TC")]
- [Step(2, "Pan the ScrollBar show on the window")]
- [Postcondition(1, "NA")]
- public async Task PanFinished_CB()
- {
- if (ManualTest.IsWearable())
- {
- _wearTestPage.ExecuteTC(_label);
- await ManualTest.WaitForConfirm();
- _wearTestPage.ClearTestCase(_label);
- }
- else
- {
- CreateView("Use mouse to pan the scrollbar");
-
- _scrollBar = new ScrollBar(ScrollBar.Direction.Horizontal);
- _scrollBar.ParentOrigin = ParentOrigin.Center;
- _scrollBar.PivotPoint = PivotPoint.Center;
- _scrollBar.PositionUsesPivotPoint = true;
- _scrollBar.BackgroundColor = Color.Red;
- _scrollBar.Size2D = new Size2D(400, 30);
- _scrollBar.IndicatorHeightPolicy = ScrollBar.IndicatorHeightPolicyType.Fixed;
- _scrollBar.IndicatorFixedHeight = 50;
- Window.Instance.Add(_scrollBar);
-
- View sourceActor = new View();
- Window.Instance.Add(sourceActor);
-
- // Register the scroll properties
- int propertyScrollPosition = sourceActor.RegisterProperty("sourcePosition", new PropertyValue(0.0f));
- int propertyMinScrollPosition = sourceActor.RegisterProperty("sourcePositionMin", new PropertyValue(0.0f));
- int propertyMaxScrollPosition = sourceActor.RegisterProperty("sourcePositionMax", new PropertyValue(100.0f));
- int propertyScrollContentSize = sourceActor.RegisterProperty("sourceContentSize", new PropertyValue(500.0f));
-
- _scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
- _scrollBar.PanFinished += OnPanFinished;
- // Waits for user confirmation.
- await ManualTest.WaitForConfirm();
- _scrollBar.PanFinished -= OnPanFinished;
- Window.Instance.Remove(sourceActor);
- Window.Instance.Remove(_scrollBar);
- _testPage.ClearTestCase(_button);
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-using System;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.NUI;
-using Tizen.NUI.UIComponents;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Tests
-{
- [TestFixture]
- [Description("Tizen.NUI.UIComponents.Slider test")]
- public class SliderTests
- {
- private ManualTestNUI _testPage;
- private WearableManualTestNUI _wearTestPage;
- private Window _window;
- private PushButton _button;
- private float _PointSize = 5.0f;
- private TextLabel _label;
- private Slider _slider;
-
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
- _window = Window.Instance;
- if (Window.Instance.Size.Width > 1000)
- {
- _PointSize = 20.0f;
- }
- if (ManualTest.IsWearable())
- {
- _PointSize = 2.0f;
- _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!");
- _wearTestPage = WearableManualTestNUI.GetInstance();
- }
- else
- {
- _testPage = ManualTestNUI.GetInstance();
- }
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
- }
-
- private PropertyMap CreateTextMap(float pointSize, string text)
- {
- PropertyMap map = new PropertyMap();
- map.Insert("visualType", new PropertyValue("TEXT"));
- map.Insert("pointSize", new PropertyValue(pointSize));
- map.Insert("text", new PropertyValue(text));
- return map;
- }
-
- private void CreateView(string information)
- {
- _button = new PushButton();
- _button.Label = CreateTextMap(_PointSize, information);
-
- _testPage.ExecuteTC(_button);
- }
-
- public bool OnSliderEvent(object sender, EventArgs e)
- {
- Tizen.Log.Fatal("NUI", "Slider event !!!!!");
- ManualTest.Confirm();
- _window.Remove(_slider);
- return true;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event MarkReached.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.Slider.MarkReached E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
- [Step(1, "If test on TV, connect the mouse to the TV")]
- [Step(2, "Click run button to run TC")]
- [Step(3, "Sliding the slider to marked position(1/5,2/5 or 3/5).")]
- [Step(4, "TC will pass after reaching the mark position")]
- [Postcondition(1, "NA")]
- public async Task MarkReached_CB()
- {
- if (ManualTest.IsWearable())
- {
- _wearTestPage.ExecuteTC(_label);
- await ManualTest.WaitForConfirm();
- _wearTestPage.ClearTestCase(_label);
- }
- else
- {
- CreateView("Press Key-Down");
- _slider = new Slider()
- {
- Size2D = new Size2D(500, 300),
- Position2D = new Position2D(610, 150),
- BackgroundColor = Color.Magenta,
- Focusable = true,
- };
- _slider.LowerBound = 1.0f;
- _slider.UpperBound = 5.0f;
- _window.Add(_slider);
- PropertyArray marks = new PropertyArray();
- marks.Add(new PropertyValue(1));
- marks.Add(new PropertyValue(2));
- marks.Add(new PropertyValue(3));
- _slider.Marks = marks;
- _slider.MarkReached += OnSliderEvent;
-
- // Waits for user confirmation.
- await ManualTest.WaitForConfirm();
- _slider.MarkReached -= OnSliderEvent;
- _testPage.ClearTestCase(_button);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event SlidingFinished.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.Slider.SlidingFinished E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
- [Step(1, "Connect the mouse to the TV (TM-1 don't need)")]
- [Step(2, "Click run button to run TC")]
- [Step(3, "Touch or use mouse(on TV) to drag the slider.")]
- [Step(4, "When you stop sliding, TC will pass")]
- [Postcondition(1, "NA")]
- public async Task SlidingFinished_CB()
- {
- if (ManualTest.IsWearable())
- {
- _wearTestPage.ExecuteTC(_label);
- await ManualTest.WaitForConfirm();
- _wearTestPage.ClearTestCase(_label);
- }
- else
- {
- CreateView("Press Key-Down");
- _slider = new Slider()
- {
- Size2D = new Size2D(500, 300),
- Position2D = new Position2D(610, 150),
- BackgroundColor = Color.Magenta,
- Focusable = true,
- };
-
- _window.Add(_slider);
- _slider.SlidingFinished += OnSliderEvent;
- // Waits for user confirmation.
- await ManualTest.WaitForConfirm();
- _slider.SlidingFinished -= OnSliderEvent;
- _testPage.ClearTestCase(_button);
- }
- }
- }
-}
-
-
-
using NUnit.Framework;
using NUnit.Framework.TUnit;
using Tizen.NUI;
-using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI.Tests
private ManualTestNUI _testPage;
private WearableManualTestNUI _wearTestPage;
private Window _window;
- private PushButton _button;
- private float _PointSize = 5.0f;
+ private Button _button;
+ private float _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f;
private TextLabel _label;
[SetUp]
{
LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
_window = Window.Instance;
- if (Window.Instance.Size.Width > 1000)
- {
- _PointSize = 20.0f;
- }
if (ManualTest.IsWearable())
{
- _PointSize = 2.0f;
+ _pointSize = 2.0f;
_label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!");
_wearTestPage = WearableManualTestNUI.GetInstance();
}
private void CreateView(string information)
{
- _button = new PushButton();
- _button.Label = CreateTextMap(_PointSize, information);\r
+ _button = new Button();\r
+ _button.Text = information;
+ _button.PointSize = _pointSize;\r
+ _button.BackgroundColor = Color.Cyan;
+ _button.Size = new Size(Window.Instance.Size.Width * 0.1f, Window.Instance.Size.Height * 0.0462f);
+ _button.Focusable = true;\r
\r
if (ManualTest.IsWearable())
{\r
using NUnit.Framework;
using NUnit.Framework.TUnit;
using Tizen.NUI;
-using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI.Tests
{
private ManualTestNUI _testPage;
private WearableManualTestNUI _wearTestPage;
- private PushButton _button;
- private float PointSize = 5.0f;
+ private Button _button;
+ private float _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f;
private TextLabel _label;
[SetUp]
public void Init()
{
LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
- if (Window.Instance.Size.Width > 1000)
- {
- PointSize = 20.0f;
- }
-
if (ManualTest.IsWearable())
{
- PointSize = 2.0f;
+ _pointSize = 2.0f;
_label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!");
_wearTestPage = WearableManualTestNUI.GetInstance();
}
private void CreateView(string information)
{
- _button = new PushButton();
- _button.Label = CreateTextMap(PointSize, information);
-
+ _button = new Button();\r
+ _button.Text = information;
+ _button.PointSize = _pointSize;\r
+ _button.BackgroundColor = Color.Cyan;
+ _button.Size = new Size(Window.Instance.Size.Width * 0.1f, Window.Instance.Size.Height * 0.0462f);
+ _button.Focusable = true;
// Invoke ExecuteTC() method to add UI to test area.
_testPage.ExecuteTC(_button);
}
using NUnit.Framework.TUnit;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.UIComponents;
using Tizen.Applications;
namespace Tizen.NUI.Tests
{
private ManualTestNUI _testPage;
private WearableManualTestNUI _wearTestPage;
- private float _pointSize = 5.0f;
+ private float _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f;
[SetUp]
public void Init()
myAppControl.ApplicationId = "org.tizen.example.WidgetViewSample";
}
AppControl.SendLaunchRequest(myAppControl);
-
- if (Window.Instance.Size.Width > 1000)
- {
- _pointSize = 20.0f;
- }
-
if(ManualTest.IsWearable())
{
_pointSize = 4.0f;
using NUnit.Framework.TUnit;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.UIComponents;
using Tizen.Applications;
namespace Tizen.NUI.Tests
{
private ManualTestNUI _testPage;
private WearableManualTestNUI _wearTestPage;
- private float _pointSize = 5.0f;
+ private float _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f;
[SetUp]
public void Init()
}
AppControl.SendLaunchRequest(myAppControl);
- if (Window.Instance.Size.Width > 1000)
- {
- _pointSize = 20.0f;
- }
-
if (ManualTest.IsWearable())
{
_pointSize = 4.0f;
using NUnit.Framework;
using NUnit.Framework.TUnit;
using Tizen.NUI;
-using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI.Tests
private ManualTestNUI _testPage;
private WearableManualTestNUI _wearTestPage;
private Window _window;
- private PushButton _button;
- private float PointSize = 5.0f;
+ private Button _button;
+ private float _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f;
private TextLabel _label;
[SetUp]
{
LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
_window = Window.Instance;
- if(Window.Instance.Size.Width > 1000)
- {
- PointSize = 20.0f;
- }
if (ManualTest.IsWearable())
{
- PointSize = 2.0f;
+ _pointSize = 2.0f;
_label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!");
_wearTestPage = WearableManualTestNUI.GetInstance();
}
LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
}
-
- private PropertyMap CreateTextMap(float pointSize, string text)
- {
- PropertyMap map = new PropertyMap();
- map.Insert("visualType", new PropertyValue("TEXT"));
- map.Insert("pointSize", new PropertyValue(pointSize));
- map.Insert("text", new PropertyValue(text));
- return map;
- }
-
private void CreateView(string information)
{
- _button = new PushButton();
- _button.Label = CreateTextMap(PointSize, information);
-
+ _button = new Button();\r
+ _button.Text = information;
+ _button.PointSize = _pointSize;\r
+ _button.BackgroundColor = Color.Cyan;
+ _button.Size = new Size(Window.Instance.Size.Width * 0.1f, Window.Instance.Size.Height * 0.0462f);
+ _button.Focusable = true;
_testPage.ExecuteTC(_button);
}