From 1fb57495f807e839402fd48d965d0bb8d90e2f95 Mon Sep 17 00:00:00 2001 From: Xianbing Teng Date: Fri, 10 Apr 2020 18:29:05 +0800 Subject: [PATCH] [NUI.Wearable][Non-ACR] Removing deprecated apis Change-Id: Iadaaa1e89c95b71d3bb8e96c8937881ba0a46fc9 --- .../ManualTestPage.cs | 953 +++++++++++------- .../Tizen.NUI.Wearable.Manual.Tests/Program.cs | 18 + .../WearableManualTestPage.cs | 1007 ++++++++++++-------- .../res/images/controller_btn_check_on.png | Bin 0 -> 1188 bytes .../res/images/rectangle_btn_shadow.png | Bin 0 -> 1368 bytes .../res/images/rectangle_point_btn_normal.png | Bin 0 -> 1151 bytes .../res/images/rectangle_toggle_btn_normal.png | Bin 0 -> 1245 bytes .../res/images/tw_bottom_btn_bg.png | Bin 0 -> 4234 bytes .../testcase/TSNUIWatchApplication.cs | 28 +- 9 files changed, 1221 insertions(+), 785 deletions(-) create mode 100644 tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/res/images/controller_btn_check_on.png create mode 100644 tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/res/images/rectangle_btn_shadow.png create mode 100644 tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/res/images/rectangle_point_btn_normal.png create mode 100644 tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/res/images/rectangle_toggle_btn_normal.png create mode 100644 tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/res/images/tw_bottom_btn_bg.png diff --git a/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/ManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/ManualTestPage.cs index a00fc36..999238d 100755 --- a/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/ManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/ManualTestPage.cs @@ -23,79 +23,161 @@ using NUnit.Framework.Interfaces; 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.Wearable.Tests { class ManualTestNUI { + class ListBridge : FlexibleView.Adapter + { + private List _mDatas; + private List _mlistItem; + + public ListBridge(List datas, List item) + { + _mDatas = datas; + _mlistItem = item; + } + + public void UpdateItemData(List 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 + { + 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 += OnFocusGained; + btn.FocusLost += OnFocusLost; + 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) + { + Button btn = holder.ItemView as Button; + btn.FocusGained -= OnFocusGained; + btn.FocusLost -= OnFocusLost; + holder.ItemView.Dispose(); + } + } + + public override int GetItemCount() + { + return _mDatas.Count; + } + + private void OnFocusGained(object sender, EventArgs e) + { + Button btn = sender as Button; + btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png"; + } + + private void OnFocusLost(object sender, EventArgs e) + { + Button btn = sender as Button; + btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; + } + + } + private List _tcIDList; private List _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 static float _pointSize = 5.0f; + private static float _pixelSize = 20.0f; //Save the information of every single test case - private List TCInfoList; - private List CurrentTCInfo; + private List _tcInfoList; + private List _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 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; + private int _currentTCNum = 0; 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() { Initialize(); } + public void Initialize() { Tizen.Log.Fatal("NUI", "NUI Initialize"); - PointSize = (1.0f / Window.Instance.Dpi.Length()) * 2000.0f; + _pointSize = (1.0f / Window.Instance.Dpi.Length()) * 2000.0f; RunType.Value = RunType.MANUAL; _tRunner = new TRunner(); _tRunner.LoadTestsuite(); @@ -115,7 +197,6 @@ namespace Tizen.NUI.Wearable.Tests Tizen.Log.Fatal("NUI", "TCT : TCName:" + nameTc.ToString()); } - _tsettings = TSettings.GetInstance(); _tsettings.IsManual = true; @@ -126,8 +207,8 @@ namespace Tizen.NUI.Wearable.Tests window.BackgroundColor = Color.White; _summaryLabel = new TextLabel(); - _summaryLabel.PixelSize = PixelSize; - _summaryLabel.Size2D = new Size2D((int)Window.Instance.Size.Width, 60); + _summaryLabel.PixelSize = _pixelSize; + _summaryLabel.Size = new Size((int)Window.Instance.Size.Width, 60); _summaryLabel.ParentOrigin = Position.ParentOriginTopLeft; _summaryLabel.PivotPoint = PivotPoint.TopLeft; _summaryLabel.Position = new Position(0, 5, 0); @@ -138,7 +219,7 @@ namespace Tizen.NUI.Wearable.Tests 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((int)Window.Instance.Size.Width, (int)Window.Instance.Size.Height - 65); _initView.ParentOrigin = Position.ParentOriginTopLeft; _initView.PivotPoint = PivotPoint.TopLeft; _initView.Position = new Position(0.0f, 70.0f, 0.0f); @@ -146,7 +227,7 @@ namespace Tizen.NUI.Wearable.Tests _initView.Show(); _detailView = new View(); - _initView.Size2D = new Size2D((int)Window.Instance.Size.Width, (int)Window.Instance.Size.Height - 65); + _detailView.Size = new Size((int)Window.Instance.Size.Width, (int)Window.Instance.Size.Height - 65); _detailView.ParentOrigin = Position.ParentOriginTopLeft; _detailView.PivotPoint = PivotPoint.TopLeft; _detailView.Position = new Position(0.0f, 70.0f, 0.0f); @@ -156,87 +237,78 @@ namespace Tizen.NUI.Wearable.Tests window.GetDefaultLayer().Add(_initView); window.GetDefaultLayer().Add(_detailView); - FocusManager.Instance.SetCurrentFocusView(run); + FocusManager.Instance.SetCurrentFocusView(_run); } - void InitializeFirstPage() + void SetCommonButtonStyle(Button btn, string text) { - //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) => + 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 { - TSettings.GetInstance().SubmitManualResult(); - return false; + Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png", + Border = new Rectangle(5, 5, 5, 5) }; - - run = new PushButton(); - run.LabelText = "Runner"; - run.Clicked += (obj, ee) => - { - Tizen.Log.Fatal("NUI", "Check all the test case from the first one."); - CurrentTCNum = 0; - _initView.Hide(); - _caseView.Hide(); - UpdateDetailPage(); - _detailView.Show(); - FocusManager.Instance.SetCurrentFocusView(runButton); - return false; + btn.Style.BackgroundImage = new Selector + { + 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 += OnFocusGained; + btn.FocusLost += OnFocusLost; + } + + void InitializeFirstPage() + { + //Create Run Button, when you Click it, then the first test case will be executed. + _doneButton = new Button(); + SetCommonButtonStyle(_doneButton, "Done"); + _doneButton.ClickEvent += OnDoneButtonClicked; - run.RightFocusableView = doneButton; - doneButton.LeftFocusableView = run; + _run = new Button(); + SetCommonButtonStyle(_run, "Runner"); + _run.ClickEvent += OnRunnerButtonClicked; + _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 += OnItemClickEvent; + _initList.FocusGained += OnInitListFocusGained; + _initList.FocusLost += OnInitListFocusLost; + _initList.KeyEvent += OnInitListKeyEvent; + + _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). @@ -251,7 +323,7 @@ namespace Tizen.NUI.Wearable.Tests { _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 - 50, 500); _detailList.ParentOrigin = Position.ParentOriginTopLeft; _detailList.PivotPoint = PivotPoint.TopLeft; _detailList.Position = new Position(0.0f, 0.0f, 0.0f); @@ -259,15 +331,31 @@ namespace Tizen.NUI.Wearable.Tests _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 @@ -281,163 +369,83 @@ namespace Tizen.NUI.Wearable.Tests _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) => - { - - Clear(); - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.PASS; - ManualTest.Confirm(); - } - Tizen.Log.Fatal("TBT", "Pass Button clicked!"); - return true; - }; - - failButton = new PushButton(); - failButton.Focusable = true; - failButton.LabelText = "Fail"; - failButton.Clicked += (obj, ee) => - { - Clear(); - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.FAIL; - ManualTest.Confirm(); - } - Tizen.Log.Fatal("TBT", "Fail Button clicked!"); - return true; - }; - - blockButton = new PushButton(); - blockButton.Focusable = true; - blockButton.LabelText = "Block"; - blockButton.Clicked += (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) => - { - Clear(); - //should update the _caseView by the test case - _pressButton = NavigationButton.NA; - _tsettings.Testcase_ID = _tcIDList[CurrentTCNum]; - _tsettings.TCResult = ""; - _tRunner.Execute(); - return true; - }; - - homeButton = new PushButton(); - homeButton.Focusable = true; - homeButton.LabelText = "Home"; - homeButton.Clicked += (obj, ee) => - { - Clear(); - _pressButton = NavigationButton.Home; - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - else - { - _detailView.Hide(); - _initView.Show(); - FocusManager.Instance.SetCurrentFocusView(run); - } - return true; - }; - - preButton = new PushButton(); - preButton.Focusable = true; - preButton.LabelText = "<<"; - preButton.Clicked += (obj, ee) => - { - Clear(); - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - else - { - if (CurrentTCNum != 0) - { - CurrentTCNum--; - notRun.Text = _listItem[CurrentTCNum].Result; - ManualTest.Confirm(); - UpdateDetailPage(); - } - } - return true; - }; - nextButton = new PushButton(); - nextButton.Focusable = true; - nextButton.LabelText = ">>"; - nextButton.Clicked += (obj, ee) => - { - Clear(); - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - if (CurrentTCNum + 1 != ResultNumber.Total) - { - Tizen.Log.Fatal("NUI", "Print the [not run] CurrentTCNum::" + CurrentTCNum); - CurrentTCNum++; - notRun.Text = _listItem[CurrentTCNum].Result; - UpdateDetailPage(); - } - 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)); + _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 += OnPassButtonClicked; + _failButton = new Button(); + SetCommonButtonStyle(_failButton, "Fail"); + _failButton.ClickEvent += OnFailButtonClicked; + + _blockButton = new Button(); + SetCommonButtonStyle(_blockButton, "Block"); + _blockButton.ClickEvent += OnBlockButtonClicked; + + _runButton = new Button(); + SetCommonButtonStyle(_runButton, "Run"); + _runButton.ClickEvent += OnRunButtonClicked; + + _homeButton = new Button(); + SetCommonButtonStyle(_homeButton, "Home"); + _homeButton.ClickEvent += OnHomeButtonClicked; + + _preButton = new Button(); + SetCommonButtonStyle(_preButton, "<<"); + _preButton.ClickEvent += OnPreButtonClicked; + + _nextButton = new Button(); + SetCommonButtonStyle(_nextButton, ">>"); + _nextButton.ClickEvent += OnNextButtonClicked; + + _runButton.DownFocusableView = _nextButton; + _runButton.LeftFocusableView = _blockButton; + _runButton.RightFocusableView = _homeButton; + _blockButton.LeftFocusableView = _failButton; + _blockButton.RightFocusableView = _runButton; + _failButton.RightFocusableView = _blockButton; + _failButton.LeftFocusableView = _passButton; + _passButton.RightFocusableView = _failButton; + _passButton.DownFocusableView = _homeButton; + _homeButton.UpFocusableView = _passButton; + _homeButton.LeftFocusableView = _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) @@ -462,7 +470,7 @@ namespace Tizen.NUI.Wearable.Tests { if (e.Key.KeyPressedName == "Down") { - FocusManager.Instance.SetCurrentFocusView(passButton); + FocusManager.Instance.SetCurrentFocusView(_passButton); } } @@ -478,7 +486,7 @@ namespace Tizen.NUI.Wearable.Tests if (e.Key.KeyPressedName == "Up") { Tizen.Log.Fatal("NUI", "Set current focus view :: doneButton"); - FocusManager.Instance.SetCurrentFocusView(doneButton); + FocusManager.Instance.SetCurrentFocusView(_doneButton); } } return false; @@ -493,7 +501,7 @@ namespace Tizen.NUI.Wearable.Tests if (e.Key.KeyPressedName == "Down") { Tizen.Log.Fatal("NUI", "Set current focus view :: run"); - FocusManager.Instance.SetCurrentFocusView(run); + FocusManager.Instance.SetCurrentFocusView(_run); } } return false; @@ -509,11 +517,120 @@ namespace Tizen.NUI.Wearable.Tests public void ClearTestCase(View view) { - FocusManager.Instance.SetCurrentFocusView(runButton); + FocusManager.Instance.SetCurrentFocusView(_runButton); Tizen.Log.Fatal("NUI", "Clear test case!"); _detailView.Remove(view); } + public void Dispose() + { + if (_passButton) + { + _passButton.ClickEvent -= OnPassButtonClicked; + _passButton.FocusGained -= OnFocusGained; + _passButton.FocusLost -= OnFocusLost; + _passButton.GetParent()?.Remove(_passButton); + _passButton.Dispose(); + _passButton = null; + } + if (_failButton) + { + _failButton.ClickEvent -= OnFailButtonClicked; + _failButton.FocusGained -= OnFocusGained; + _failButton.FocusLost -= OnFocusLost; + _failButton.GetParent()?.Remove(_failButton); + _failButton.Dispose(); + _failButton = null; + } + if (_blockButton) + { + _blockButton.ClickEvent -= OnBlockButtonClicked; + _blockButton.FocusGained -= OnFocusGained; + _blockButton.FocusLost -= OnFocusLost; + _blockButton.GetParent()?.Remove(_blockButton); + _blockButton.Dispose(); + _blockButton = null; + } + if (_runButton) + { + _runButton.ClickEvent -= OnRunButtonClicked; + _runButton.FocusGained -= OnFocusGained; + _runButton.FocusLost -= OnFocusLost; + _runButton.GetParent()?.Remove(_runButton); + _runButton.Dispose(); + _runButton = null; + } + if (_homeButton) + { + _homeButton.ClickEvent -= OnHomeButtonClicked; + _homeButton.FocusGained -= OnFocusGained; + _homeButton.FocusLost -= OnFocusLost; + _homeButton.GetParent()?.Remove(_homeButton); + _homeButton.Dispose(); + _homeButton = null; + } + if (_preButton) + { + _preButton.ClickEvent -= OnPreButtonClicked; + _preButton.FocusGained -= OnFocusGained; + _preButton.FocusLost -= OnFocusLost; + _preButton.GetParent()?.Remove(_preButton); + _preButton.Dispose(); + _preButton = null; + } + if (_nextButton) + { + _nextButton.ClickEvent -= OnNextButtonClicked; + _nextButton.FocusGained -= OnFocusGained; + _nextButton.FocusLost -= OnFocusLost; + _nextButton.GetParent()?.Remove(_nextButton); + _nextButton.Dispose(); + _nextButton = null; + } + + if(_detailView) + { + _detailView.GetParent()?.Remove(_detailView); + _detailView.Dispose(); + _detailView = null; + } + if (_initList) + { + _initList.ItemClickEvent -= OnItemClickEvent; + _initList.FocusGained -= OnInitListFocusGained; + _initList.FocusLost -= OnInitListFocusLost; + _initList.KeyEvent -= OnInitListKeyEvent; + _initList.GetParent()?.Remove(_initList); + _initList.Dispose(); + _initList = null; + } + if (_doneButton) + { + _doneButton.ClickEvent -= OnDoneButtonClicked; + _doneButton.FocusGained -= OnFocusGained; + _doneButton.FocusLost -= OnFocusLost; + _doneButton.GetParent()?.Remove(_doneButton); + _doneButton.Dispose(); + _doneButton = null; + } + if (_run) + { + _run.ClickEvent -= OnRunnerButtonClicked; + _run.FocusGained -= OnFocusGained; + _run.FocusLost -= OnFocusLost; + _run.GetParent()?.Remove(_run); + _run.Dispose(); + _run = null; + } + + if (_initView) + { + _initView.GetParent()?.Remove(_initView); + _initView.Dispose(); + _initView = null; + } + } + //Use to update the _summaryLabel. private void SetSummaryResult() { @@ -530,58 +647,10 @@ namespace Tizen.NUI.Wearable.Tests 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(); @@ -590,8 +659,8 @@ namespace Tizen.NUI.Wearable.Tests description.Position = new Position(0.0f, 0.0f, 0.0f); description.Size2D = new Size2D((int)Window.Instance.Size.Width - 20, 50); 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)); } } @@ -603,7 +672,7 @@ namespace Tizen.NUI.Wearable.Tests ResultNumber.Pass = 0; ResultNumber.Fail = 0; ResultNumber.Block = 0; - TCInfoList = new List(); + _tcInfoList = new List(); foreach (KeyValuePair pair in _tRunner.GetTestList()) { List preconditions = new List(); @@ -628,7 +697,7 @@ namespace Tizen.NUI.Wearable.Tests 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, @@ -642,25 +711,25 @@ namespace Tizen.NUI.Wearable.Tests //The data in CurrentTCInfo list will be show in _detailList. void UpdateCurrentTCInfo() { - CurrentTCInfo = new List(); - 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 = new List(); + 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.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) @@ -668,19 +737,19 @@ namespace Tizen.NUI.Wearable.Tests //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; @@ -694,34 +763,222 @@ namespace Tizen.NUI.Wearable.Tests 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(_listItem); + } + SetSummaryResult(); - notRun.Text = _listItem[CurrentTCNum].Result; + _notRun.Text = _listItem[_currentTCNum].Result; + } + + private void OnItemClickEvent(object sender, FlexibleView.ItemClickEventArgs 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); + } + } + + private void OnInitListFocusGained(object sender, EventArgs e) + { + FlexibleView.ViewHolder holder = _initList?.FindViewHolderForAdapterPosition(0); + if (holder != null && holder.ItemView != null) + { + FocusManager.Instance.SetCurrentFocusView(holder.ItemView); + _currentTCNum = 0; + } + } + + private void OnInitListFocusLost(object sender, EventArgs e) + { + _currentTCNum = 0; + } + + private bool OnInitListKeyEvent(object sender, View.KeyEventArgs 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; + } + + private void OnDoneButtonClicked(object sender, Button.ClickEventArgs e) + { + TSettings.GetInstance().SubmitManualResult(); + } + + private void OnRunnerButtonClicked(object sender, Button.ClickEventArgs e) + { + Tizen.Log.Fatal("NUI", "Check all the test case from the first one."); + _currentTCNum = 0; + _initView.Hide(); + _caseView.Hide(); + UpdateDetailPage(); + _detailView.Show(); + FocusManager.Instance.SetCurrentFocusView(_runButton); } + + private void OnPassButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.PASS; + ManualTest.Confirm(); + } + Tizen.Log.Fatal("TBT", "Pass Button clicked!"); + } + + private void OnFailButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.FAIL; + ManualTest.Confirm(); + } + Tizen.Log.Fatal("TBT", "Fail Button clicked!"); + } + + private void OnBlockButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.BLOCK; + ManualTest.Confirm(); + } + } + + private void OnRunButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + //should update the _caseView by the test case + _tsettings.Testcase_ID = _tcIDList[_currentTCNum]; + _tsettings.TCResult = ""; + _tRunner.Execute(); + } + + private void OnHomeButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + else + { + _detailView.Hide(); + _initView.Show(); + FocusManager.Instance.SetCurrentFocusView(_run); + } + } + + private void OnPreButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + else + { + if (_currentTCNum != 0) + { + _currentTCNum--; + _notRun.Text = _listItem[_currentTCNum].Result; + ManualTest.Confirm(); + UpdateDetailPage(); + } + } + } + + private void OnNextButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + if (_currentTCNum + 1 != ResultNumber.Total) + { + Tizen.Log.Fatal("NUI", "Print the [not run] CurrentTCNum::" + _currentTCNum); + _currentTCNum++; + _notRun.Text = _listItem[_currentTCNum].Result; + UpdateDetailPage(); + } + } + + private void OnFocusGained(object sender, EventArgs e) + { + Button btn = sender as Button; + btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png"; + } + + private void OnFocusLost(object sender, EventArgs e) + { + Button btn = sender as Button; + btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; + } + } } diff --git a/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/Program.cs b/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/Program.cs index 68bc5da..7097808 100755 --- a/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/Program.cs +++ b/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/Program.cs @@ -36,6 +36,24 @@ namespace Tizen.NUI.Wearable.Tests } } + protected override void OnTerminate() + { + //Tizen.Log.Fatal("NUI", "### OnTerminate() START!"); + if (ManualTest.IsWearable()) + { + WearableManualTestNUI.GetInstance().Dispose(); + } + else + { + ManualTestNUI.GetInstance().Dispose(); + } + + Exit(); + base.OnTerminate(); + + //Tizen.Log.Fatal("NUI", "### OnTerminate() END!"); + } + static void Main(string[] args) { Tizen.Log.Fatal("NUI", "Manual TCT for NUI start!"); diff --git a/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/WearableManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/WearableManualTestPage.cs index 6fc37d6..392713a 100755 --- a/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/WearableManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/WearableManualTestPage.cs @@ -23,67 +23,246 @@ using NUnit.Framework.Interfaces; using NUnit.Framework.TUnit; using System.Reflection; using Tizen.NUI.BaseComponents; -using Tizen.NUI.UIComponents; +using Tizen.NUI.Components; namespace Tizen.NUI.Wearable.Tests { class WearableManualTestNUI { - private bool _isSelectRunButton; + class ListBridge : FlexibleView.Adapter + { + private List _mDatas; + private List _mlistItem; + + public ListBridge(List datas, List item) + { + _mDatas = datas; + _mlistItem = item; + } + + public void UpdateItemData(List item) + { + _mlistItem = item; + } + + public override FlexibleView.ViewHolder OnCreateViewHolder(int viewType) + { + FlexibleView.ViewHolder viewHolder = new FlexibleView.ViewHolder(new ListItemView()); + return viewHolder; + } + + public override void OnBindViewHolder(FlexibleView.ViewHolder holder, int position) + { + string testcaseID = "#." + (position + 1).ToString(); + string caseName = _mDatas[position]; + string resultText = "[" + _mlistItem[(int)position].Result + "]"; + + ListItemView item = holder.ItemView as ListItemView; + if (item) + { + item.Size = new Size(Window.Instance.Size.Width, 120); + item.Name = position.ToString(); + item.CaseID = testcaseID; + item.CaseName = caseName; + item.CaseResult = resultText; + } + } + + public override void OnDestroyViewHolder(FlexibleView.ViewHolder holder) + { + if (holder.ItemView != null) + { + holder.ItemView.Dispose(); + } + } + + public override int GetItemCount() + { + return _mDatas.Count; + } + } + + class ListItemView : View + { + private TextLabel _mID; + private TextLabel _mName; + private TextLabel _mResult; + + public ListItemView() + { + WidthResizePolicy = ResizePolicyType.FillToParent; + HeightResizePolicy = ResizePolicyType.FillToParent; + + _mID = new TextLabel(); + _mID.TextColor = Color.White; + _mID.PointSize = 4.0f; + _mID.VerticalAlignment = VerticalAlignment.Center; + _mID.ParentOrigin = NUI.ParentOrigin.TopLeft; + _mID.PivotPoint = NUI.PivotPoint.TopLeft; + _mID.Size2D = new Size2D(40, _scrollHeight); + _mID.Position2D = new Position2D(0, 0); + Add(_mID); + + _mName = new TextLabel(); + _mName.ParentOrigin = NUI.ParentOrigin.TopLeft; + _mName.PivotPoint = NUI.PivotPoint.TopLeft; + _mName.Position = new Position(33, 0.0f, 0.0f); + _mName.Size = new Size(255, _scrollHeight); + _mName.VerticalAlignment = VerticalAlignment.Bottom; + _mName.PointSize = 4.0f; + _mName.TextColor = Color.Green; + _mName.MultiLine = true; + _mName.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/tw_bottom_btn_bg.png"; + Add(_mName); + + _mResult = new TextLabel(); + _mResult.TextColor = Color.White; + _mResult.PointSize = 3.0f; + _mResult.ParentOrigin = NUI.ParentOrigin.TopLeft; + _mResult.PivotPoint = NUI.PivotPoint.TopLeft; + _mResult.Position = new Position(285.0f, 0.0f, 0.0f); + _mResult.Size2D = new Size2D(65, _scrollHeight); + _mResult.VerticalAlignment = VerticalAlignment.Center; + _mResult.HorizontalAlignment = HorizontalAlignment.Center; + Add(_mResult); + } + + public string CaseID + { + get + { + return _mID.Text; + } + set + { + _mID.Text = value; + } + } + + public string CaseName + { + get + { + return _mName.Text; + } + set + { + _mName.Text = value; + } + } + + public string CaseResult + { + get + { + return _mResult.Text; + } + set + { + _mResult.Text = value; + } + } + } + + class DetailListBridge : FlexibleView.Adapter + { + private List _mDatas; + + public DetailListBridge(List datas) + { + _mDatas = datas; + } + + public override FlexibleView.ViewHolder OnCreateViewHolder(int viewType) + { + FlexibleView.ViewHolder viewHolder = new FlexibleView.ViewHolder(new TextLabel()); + 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 _tcIDList; private List _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 static float PointSize = 5.0f; + private static float _pointSize = 5.0f; //Save the information of every single test case - private List TCInfoList; - private List CurrentTCInfo; + private List _tcInfoList; + private List _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 int _currentTCNum = 0; private static int _scrollWidth = Window.Instance.Size.Width; private static int _scrollHeight = 120; private static int _detailScrollHeight = 60; + private bool _isSelectRunButton; 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() @@ -100,8 +279,9 @@ namespace Tizen.NUI.Wearable.Tests { _isSelectRunButton = false; 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; + Tizen.Log.Fatal("ManualTCT", "Initialize========================================="); + Tizen.Log.Fatal("ManualTCT", $"App resource path: {Tizen.Applications.Application.Current.DirectoryInfo.Resource}"); + _pointSize = (1.0f / Window.Instance.Dpi.Length()) * 2000.0f; RunType.Value = RunType.MANUAL; _tRunner = new TRunner(); _tRunner.LoadTestsuite(); @@ -115,10 +295,10 @@ namespace Tizen.NUI.Wearable.Tests _tcIDList.Add(pair.Key); count++; } - Tizen.Log.Fatal("NUI", "TCT : count:" + count.ToString()); + Tizen.Log.Fatal("ManualTCT", "TCT : count:" + count.ToString()); foreach (String nameTc in _tcIDList) { - Tizen.Log.Fatal("NUI", "TCT : TCName:" + nameTc.ToString()); + Tizen.Log.Fatal("ManualTCT", "TCT : TCName:" + nameTc.ToString()); } @@ -174,68 +354,59 @@ namespace Tizen.NUI.Wearable.Tests window.GetDefaultLayer().Add(_detailView); } + void SetCommonButtonStyle(Button btn, string text, int? left = null) + { + if (null == btn) return; + btn.Style.Text.Text = text; + btn.Style.Text.TextColor = Color.Green; + if (left.HasValue) // for detail buttons + { + btn.Style.Text.Position = new Position(left.Value, 0); + btn.Style.Text.Size = new Size(30, 30); + btn.Style.Text.PointSize = _pointSize; + } + else // for home buttons + { + btn.Style.Text.PointSize = 6.0f; + } + btn.Style.Text.VerticalAlignment = VerticalAlignment.Bottom; + btn.Style.Text.HorizontalAlignment = HorizontalAlignment.Center; + btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/tw_bottom_btn_bg.png"; + } + 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) => - { - 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) => - { - Tizen.Log.Fatal("NUI", "Check all the test case from the first one."); - 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; + _doneButton = new Button(); + _doneButton.Size = new Size(120, 60); + _doneButton.Position = new Position(30, 0);//-150, -200 + SetCommonButtonStyle(_doneButton, "Done"); + _doneButton.ClickEvent += OnDoneButtonClicked; + + _run = new Button(); + _run.Size = new Size(120, 60); + _run.Position = new Position(180, 0); //20, -200 + SetCommonButtonStyle(_run, "Runner"); + _run.ClickEvent += OnRunnerButtonClicked; + CreateInitList(); - _initView.Add(doneButton); - _initView.Add(run); + _initView.Add(_doneButton); + _initView.Add(_run); _initView.Add(_initList); - Tizen.Log.Fatal("NUI", "TCT : InitializeFirstPage:"); + Tizen.Log.Fatal("ManualTCT", "TCT : InitializeFirstPage:"); } //Update the Test Page before you want to show it(Click Run/Pre/nect Button, or Click on item in the List). void UpdateDetailPage() { UpdateCurrentTCInfo(); - Tizen.Log.Fatal("NUI", "UpdateDetailPage::::::::::::::::::::::"); + Tizen.Log.Fatal("ManualTCT", "UpdateDetailPage::::::::::::::::::::::"); CreateTestCase(); } 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; @@ -246,7 +417,6 @@ namespace Tizen.NUI.Wearable.Tests _detailView.Add(_description); CreateDetailList(); - _detailView.Add(_detailList); //To Place the function button, such as PASS, FAIL..... CreateButtons(); @@ -263,22 +433,15 @@ namespace Tizen.NUI.Wearable.Tests _detailView.Remove(_detailList); _detailList.Dispose(); } - Tizen.Log.Fatal("NUI", "Print the CurrentTCNum here::" + CurrentTCNum); + Tizen.Log.Fatal("ManualTCT", "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; 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) { TextLabel text = new TextLabel(); @@ -289,187 +452,81 @@ namespace Tizen.NUI.Wearable.Tests text.PointSize = 5.0f; text.VerticalAlignment = VerticalAlignment.Bottom; text.HorizontalAlignment = HorizontalAlignment.Center; - text.Size2D = new Size2D(30, 30); - text.Position2D = new Position2D(left, 0); + text.Size = new Size(30, 30); + text.Position = new Position(left, 0); return text; } + //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) => - { - - Clear(); - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.PASS; - ManualTest.Confirm(); - } - Tizen.Log.Fatal("TBT", "Pass Button clicked!"); - return true; - }; - - 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) => - { - Clear(); - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.FAIL; - ManualTest.Confirm(); - } - Tizen.Log.Fatal("TBT", "Fail Button clicked!"); - return true; - }; - - 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) => - { - 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) => - { - if(_isSelectRunButton == false) - { - _isSelectRunButton = true; - Clear(); - //should update the _caseView by the test case - _pressButton = NavigationButton.NA; - _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) => - { - Clear(); - _pressButton = NavigationButton.Home; - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - else - { - _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) => - { - Clear(); - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - else - { - if (CurrentTCNum != 0) - { - 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) => - { - Clear(); - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - if (CurrentTCNum + 1 != ResultNumber.Total) - { - Tizen.Log.Fatal("NUI", "Print the [not run] CurrentTCNum::" + CurrentTCNum); - CurrentTCNum++; - notRun.Text = _listItem[CurrentTCNum].Result; - UpdateDetailPage(); - } - return true; - }; + _passButton = new Button(); + SetCommonButtonStyle(_passButton, "P", 20); + _passButton.Size = new Size(70, 30); + _passButton.Position = new Position(0, 0); + _passButton.ClickEvent += OnPassButtonClicked; + + _failButton = new Button(); + SetCommonButtonStyle(_failButton, "F", 20); + _failButton.Size = new Size(70, 30); + _failButton.Position = new Position(72, 0); + _failButton.ClickEvent += OnFailButtonClicked; + + _blockButton = new Button(); + SetCommonButtonStyle(_blockButton, "B", 20); + _blockButton.Size = new Size(70, 30); + _blockButton.Position = new Position(144, 0); + _blockButton.ClickEvent += OnBlockButtonClicked; + + _runButton = new Button(); + SetCommonButtonStyle(_runButton, "R", 20); + _runButton.Size = new Size(70, 30); + _runButton.Position = new Position(216, 0); + _runButton.ClickEvent += OnRunButtonClicked; + + _homeButton = new Button(); + SetCommonButtonStyle(_homeButton, "H", 15); + _homeButton.Size = new Size(60, 30); + _homeButton.Position = new Position(15, 32); + _homeButton.ClickEvent += OnHomeButtonClicked; + + _notRun = new TextLabel(); + _notRun.TextColor = Color.White; + _notRun.Size = new Size(40, 30); + _notRun.PointSize = 2.5f; + _notRun.Position = new Position(82, 32); + _notRun.HorizontalAlignment = HorizontalAlignment.Center; + _notRun.VerticalAlignment = VerticalAlignment.Center; + _notRun.MultiLine = true; + _notRun.Text = "Not Run"; + + _preButton = new Button(); + SetCommonButtonStyle(_preButton, "<<", 15); + _preButton.Size = new Size(60, 30); + _preButton.Position = new Position(128, 32); + _preButton.ClickEvent += OnPreButtonClicked; + + _nextButton = new Button(); + SetCommonButtonStyle(_nextButton, ">>", 15); + _nextButton.Size = new Size(60, 30); + _nextButton.Position = new Position(193, 32); + + _nextButton.ClickEvent += OnNextButtonClicked; View buttonView = new View(); buttonView.ParentOrigin = ParentOrigin.TopLeft; buttonView.PivotPoint = PivotPoint.TopLeft; - 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.Size = new Size(Window.Instance.Size.Width-30, 80); + buttonView.Position = new Position(40, 180); // 30, 150 + + 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); } @@ -478,7 +535,7 @@ namespace Tizen.NUI.Wearable.Tests Tizen.Log.Fatal("ManualTCT", "Execute the manual test case!"); _caseView = view; - _caseView.ParentOrigin = Position.ParentOriginTopLeft; + _caseView.ParentOrigin = ParentOrigin.TopLeft; _caseView.PivotPoint = PivotPoint.TopLeft; _caseView.Position = new Position(40.0f, 120.0f, 0.0f); _detailView.Add(_caseView); @@ -495,10 +552,98 @@ namespace Tizen.NUI.Wearable.Tests public void ClearTestCase(View view) { - Tizen.Log.Fatal("NUI", "Clear test case!"); + Tizen.Log.Fatal("ManualTCT", "Clear test case!"); _detailView.Remove(view); } + public void Dispose() + { + if (_passButton) + { + _passButton.ClickEvent -= OnPassButtonClicked; + _passButton.GetParent()?.Remove(_passButton); + _passButton.Dispose(); + _passButton = null; + } + if (_failButton) + { + _failButton.ClickEvent -= OnFailButtonClicked; + _failButton.GetParent()?.Remove(_failButton); + _failButton.Dispose(); + _failButton = null; + } + if (_blockButton) + { + _blockButton.ClickEvent -= OnBlockButtonClicked; + _blockButton.GetParent()?.Remove(_blockButton); + _blockButton.Dispose(); + _blockButton = null; + } + if (_runButton) + { + _runButton.ClickEvent -= OnRunButtonClicked; + _runButton.GetParent()?.Remove(_runButton); + _runButton.Dispose(); + _runButton = null; + } + if (_homeButton) + { + _homeButton.ClickEvent -= OnHomeButtonClicked; + _homeButton.GetParent()?.Remove(_homeButton); + _homeButton.Dispose(); + _homeButton = null; + } + if (_preButton) + { + _preButton.ClickEvent -= OnPreButtonClicked; + _preButton.GetParent()?.Remove(_preButton); + _preButton.Dispose(); + _preButton = null; + } + if (_nextButton) + { + _nextButton.ClickEvent -= OnNextButtonClicked; + _nextButton.GetParent()?.Remove(_nextButton); + _nextButton.Dispose(); + _nextButton = null; + } + + if (_detailView) + { + _detailView.GetParent()?.Remove(_detailView); + _detailView.Dispose(); + _detailView = null; + } + if (_initList) + { + _initList.ItemClickEvent -= OnItemClickEvent; + _initList.GetParent()?.Remove(_initList); + _initList.Dispose(); + _initList = null; + } + if (_doneButton) + { + _doneButton.ClickEvent -= OnDoneButtonClicked; + _doneButton.GetParent()?.Remove(_doneButton); + _doneButton.Dispose(); + _doneButton = null; + } + if (_run) + { + _run.ClickEvent -= OnRunnerButtonClicked; + _run.GetParent()?.Remove(_run); + _run.Dispose(); + _run = null; + } + + if (_initView) + { + _initView.GetParent()?.Remove(_initView); + _initView.Dispose(); + _initView = null; + } + } + //Use to update the _summaryLabel. private void SetSummaryResult() { @@ -508,140 +653,40 @@ namespace Tizen.NUI.Wearable.Tests 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) => - { - 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(); - 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"); + Tizen.Log.Fatal("ManualTCT", "CreateInitList"); + _initList = new FlexibleView(); + _initList.ParentOrigin = ParentOrigin.TopLeft; + _initList.PivotPoint = PivotPoint.TopLeft; + _initList.Size = new Size(Window.Instance.Size.Width, 120); //400 + _initList.Position = new Position(0, 80); //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 += OnItemClickEvent; } 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("ManualTCT", "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 @@ -651,7 +696,7 @@ namespace Tizen.NUI.Wearable.Tests ResultNumber.Pass = 0; ResultNumber.Fail = 0; ResultNumber.Block = 0; - TCInfoList = new List(); + _tcInfoList = new List(); foreach (KeyValuePair pair in _tRunner.GetTestList()) { List preconditions = new List(); @@ -676,7 +721,7 @@ namespace Tizen.NUI.Wearable.Tests 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, @@ -690,45 +735,45 @@ namespace Tizen.NUI.Wearable.Tests //The data in CurrentTCInfo list will be show in _detailList. void UpdateCurrentTCInfo() { - CurrentTCInfo = new List(); - 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 = new List(); + Tizen.Log.Fatal("ManualTCT", "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.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("ManualTCT", "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!"); + Tizen.Log.Fatal("ManualTCT", "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; @@ -741,22 +786,146 @@ namespace Tizen.NUI.Wearable.Tests { ResultNumber.Block += 1; } - TextLabel label = resultList[CurrentTCNum]; - label.Text = _listItem[(int)CurrentTCNum].Result; + + FlexibleView.ViewHolder holder = _initList?.FindViewHolderForAdapterPosition(_currentTCNum); + if (holder != null) + { + string testcaseName = "#." + (_currentTCNum + 1).ToString() + _tcIDList[_currentTCNum]; + string resultText = "[" + _listItem[(int)_currentTCNum].Result + "]"; + ListItemView item = holder.ItemView as ListItemView; + item.CaseResult = resultText; + _adapter?.UpdateItemData(_listItem); + } SetSummaryResult(); - notRun.Text = _listItem[CurrentTCNum].Result; + _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; + private void OnItemClickEvent(object sender, FlexibleView.ItemClickEventArgs e) + { + ListItemView item = e.ClickedView.ItemView as ListItemView; + if (item) + { + Tizen.Log.Fatal("ManualTCT", "Item clicked!!::" + item.Name); + _currentTCNum = int.Parse(item.Name); + _initView.Hide(); + UpdateDetailPage(); + _caseView.Hide(); + _detailView.Show(); + } + } + + private void OnDoneButtonClicked(object sender, Button.ClickEventArgs e) + { + TSettings.GetInstance().SubmitManualResult(); + } + + private void OnRunnerButtonClicked(object sender, Button.ClickEventArgs e) + { + Tizen.Log.Fatal("ManualTCT", "Check all the test case from the first one."); + _currentTCNum = 0; + _initView.Hide(); + _caseView.Hide(); + UpdateDetailPage(); + _detailView.Show(); + } + + private void OnPassButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.PASS; + ManualTest.Confirm(); + } + Tizen.Log.Fatal("TBT", "Pass Button clicked!"); + } + + private void OnFailButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.FAIL; + ManualTest.Confirm(); + } + Tizen.Log.Fatal("TBT", "Fail Button clicked!"); + } + + private void OnBlockButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.BLOCK; + ManualTest.Confirm(); + } + } + + private void OnRunButtonClicked(object sender, Button.ClickEventArgs e) + { + if (_isSelectRunButton == false) + { + _isSelectRunButton = true; + Clear(); + //should update the _caseView by the test case + _pressButton = NavigationButton.NA; + _tsettings.Testcase_ID = _tcIDList[_currentTCNum]; + _tsettings.TCResult = ""; + _tRunner.Execute(); + } + } + + private void OnHomeButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + _pressButton = NavigationButton.Home; + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + else + { + _detailView.Hide(); + _initView.Show(); + } + } + + private void OnPreButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + else + { + if (_currentTCNum != 0) + { + _currentTCNum--; + _notRun.Text = _listItem[_currentTCNum].Result; + ManualTest.Confirm(); + UpdateDetailPage(); + } + } + } + + private void OnNextButtonClicked(object sender, Button.ClickEventArgs e) + { + Clear(); + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + if (_currentTCNum + 1 != ResultNumber.Total) + { + Tizen.Log.Fatal("ManualTCT", "Print the [not run] CurrentTCNum::" + _currentTCNum); + _currentTCNum++; + _notRun.Text = _listItem[_currentTCNum].Result; + UpdateDetailPage(); + } } } } diff --git a/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/res/images/controller_btn_check_on.png b/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/res/images/controller_btn_check_on.png new file mode 100644 index 0000000000000000000000000000000000000000..9a3af3a09fd972d112d938b34c8c3897d217ecf3 GIT binary patch literal 1188 zcmaJ>TWAzl7#>_u2?X*I#Q5NJQmcYY29N`%hNoXw8O%o%6S zx|=8nzKA}k2PW1O}Yj5jnqbRC9zuhd7S%{z2E6ICs#r$zHt;N|PJb)^=ZiSHQbx;}7dCwYw zMQAzW2Y-M)6qWGZ(hwdh?9y%IaaL@@HN1eJDXM2{Be3jIi0LvMas4zibN?%bcAYdc zC>Ml6V8E)oeIkSd6MZFnV${|gX6vVPPeUgJ9>f;i@W%W|Z={(8UY)GtW1gWGOz>!$ zSrj!?=%)=7LR#h&)&>C3s>T61l@#SIv?u_X7c?FStN?T%=%PS32SdDtPDL-8xu!3& zOEXoB1D)sV^*UEiawr_(fu?D^Ao8Nf5(_pO_p#Mr{iwUeV8X}_-2l7Dr(;H|jA}T| z5T%P(@Pa~NiP(>tfg&N}8&<#rPT)N+zSn|vgp2S$8OvHnrSSmrMHr!4Xp?+Yx?5lp zyAL~x4T&0kcj%I&SYsx#YaaA*-b^#(3+K3wZb?>BlQh6q%8tUS6)DMNZ22~9`F4r#CRY6*RyRUu zVHB1S8f#TSe-&XARZ&12Mx1qt-Zbd?4ys3+<1{Va+JvEd2s*hCdGtb@b$1yJLdp~j z(NrWw&BgjPQO#z1)r?FIGKxg>FJhf#V%Nl~@5S;&3?CQC|B9w{L@F^}F0}yJEHx4I zN#}&5MLyQMc98b^IdArs8c(L5+-dtp==grt{C02Gk)B#q8yJ4GVy^Sz^k4b!^1+Gq zrH@v>I6JA$uR8T8^W)!-c3!x68t6aSm);(GHg{hB=gxlk@Ur&DgX%aPV%@>cSHr~7byHv`oOYFV7?$^ZE6#Z`MllV{Zz9Gn0l4l}y zWwo8+{(Ly2&F=Ya|Iw$Pb)J9y>dO7T^>3b5PTx4Z;mbL{^X1XWdsKo-Jm?lXCc%N2 NFrV!+Z)H9|_Ag}CfoK2# literal 0 HcmV?d00001 diff --git a/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/res/images/rectangle_btn_shadow.png b/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/res/images/rectangle_btn_shadow.png new file mode 100644 index 0000000000000000000000000000000000000000..df385f1ac93d827a9142148af02426f705dd143a GIT binary patch literal 1368 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

NMG0 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 literal 0 HcmV?d00001 diff --git a/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/testcase/TSNUIWatchApplication.cs b/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/testcase/TSNUIWatchApplication.cs index 563dba3..0c0a47f 100755 --- a/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/testcase/TSNUIWatchApplication.cs +++ b/tct-suite-vs/Tizen.NUI.Wearable.Manual.Tests/testcase/TSNUIWatchApplication.cs @@ -21,7 +21,7 @@ using NUnit.Framework.TUnit; using Tizen.Applications; using Tizen.NUI; using Tizen.NUI.BaseComponents; -using Tizen.NUI.UIComponents; +using Tizen.NUI.Components; namespace Tizen.NUI.Wearable.Tests { @@ -32,7 +32,7 @@ namespace Tizen.NUI.Wearable.Tests private bool _isWearable = false; private bool _isEmulator = false; private WearableManualTestNUI _testPage; - private PushButton _infoButton; + private Button _infoButton; [SetUp] public void Init() @@ -51,26 +51,18 @@ namespace Tizen.NUI.Wearable.Tests Log.Info("TCT", "Postconditions for each TEST"); } - private PropertyMap CreateTextMap(float pointSize, string text) + private void CreateButton() { - 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)); + _infoButton = new Button(); + _infoButton.Style.Text.Text = "Clicked run, Please refer test step"; + _infoButton.Style.Text.PointSize = 5.0f; 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")); + _infoButton.Style.Text.TextColor = Color.White; + _infoButton.Style.Text.HorizontalAlignment = HorizontalAlignment.Center; + _infoButton.Style.Text.VerticalAlignment = VerticalAlignment.Bottom; } - return map; - } - - private void CreateButton() - { - _infoButton = new PushButton(); - _infoButton.Label = CreateTextMap(5.0f, "Clicked run, Please refer test step"); - _infoButton.Size2D = new Size2D(300, 50); + _infoButton.Size = new Size(300, 50); _testPage.ExecuteTC(_infoButton); } -- 2.7.4