From fbf379f8468ea54d6529bbfd3fff3268f25f9387 Mon Sep 17 00:00:00 2001 From: zhouleonlei Date: Tue, 7 Apr 2020 17:55:42 +0800 Subject: [PATCH] [NUI.Manual][ACR-280] Replace with new controls and add new layout Change-Id: Ica5111c83ec6a4bdd0230aebf38944c896773ea1 --- .../Tizen.NUI.Manual.Tests/ManualTestPage.cs | 655 ++++++++++++--------- .../Tizen.NUI.Manual.Tests.sln | 4 +- .../WearableManualTestPage.cs | 607 +++++++++---------- .../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 .../Tizen.NUI.Manual.Tests/testcase/TSButton.cs | 201 ------- .../testcase/TSFocusManager.cs | 36 +- .../testcase/TSInputMethodContext.cs | 33 +- .../testcase/TSNUIApplication.cs | 1 - .../testcase/TSNUIWidgetApplication.cs | 8 +- .../Tizen.NUI.Manual.Tests/testcase/TSPopup.cs | 139 ----- .../Tizen.NUI.Manual.Tests/testcase/TSScrollBar.cs | 144 ----- .../Tizen.NUI.Manual.Tests/testcase/TSSlider.cs | 181 ------ .../Tizen.NUI.Manual.Tests/testcase/TSTouch.cs | 20 +- .../Tizen.NUI.Manual.Tests/testcase/TSView.cs | 22 +- .../Tizen.NUI.Manual.Tests/testcase/TSWidget.cs | 9 +- .../testcase/TSWidgetView.cs | 8 +- .../Tizen.NUI.Manual.Tests/testcase/TSWindow.cs | 31 +- 20 files changed, 713 insertions(+), 1386 deletions(-) create mode 100755 tct-suite-vs/Tizen.NUI.Manual.Tests/res/images/controller_btn_check_on.png create mode 100755 tct-suite-vs/Tizen.NUI.Manual.Tests/res/images/rectangle_btn_shadow.png create mode 100755 tct-suite-vs/Tizen.NUI.Manual.Tests/res/images/rectangle_point_btn_normal.png create mode 100755 tct-suite-vs/Tizen.NUI.Manual.Tests/res/images/rectangle_toggle_btn_normal.png delete mode 100755 tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSButton.cs delete mode 100755 tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSPopup.cs delete mode 100755 tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSScrollBar.cs delete mode 100755 tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSSlider.cs mode change 100644 => 100755 tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSTouch.cs diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs index 570c131..c664903 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs @@ -23,20 +23,96 @@ 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.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(int position, 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 += (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 _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"; @@ -45,50 +121,43 @@ namespace Tizen.NUI.Tests //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 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 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() @@ -97,9 +166,11 @@ namespace Tizen.NUI.Tests } 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(); @@ -121,128 +192,201 @@ namespace Tizen.NUI.Tests 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 + { + 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). @@ -257,7 +401,7 @@ namespace Tizen.NUI.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 * 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); @@ -265,15 +409,31 @@ namespace Tizen.NUI.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 @@ -287,37 +447,34 @@ namespace Tizen.NUI.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) => + _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()) { @@ -325,13 +482,11 @@ namespace Tizen.NUI.Tests 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()) @@ -340,13 +495,11 @@ namespace Tizen.NUI.Tests 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()) @@ -354,30 +507,24 @@ namespace Tizen.NUI.Tests _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; @@ -387,15 +534,13 @@ namespace Tizen.NUI.Tests { _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()) @@ -405,25 +550,24 @@ namespace Tizen.NUI.Tests } 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()) @@ -431,29 +575,37 @@ namespace Tizen.NUI.Tests _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) @@ -463,7 +615,7 @@ namespace Tizen.NUI.Tests _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(); @@ -478,7 +630,7 @@ namespace Tizen.NUI.Tests { if (e.Key.KeyPressedName == "Down") { - FocusManager.Instance.SetCurrentFocusView(passButton); + FocusManager.Instance.SetCurrentFocusView(_passButton); } } @@ -494,7 +646,7 @@ namespace Tizen.NUI.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; @@ -509,7 +661,7 @@ namespace Tizen.NUI.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; @@ -525,7 +677,7 @@ namespace Tizen.NUI.Tests public void ClearTestCase(View view) { - FocusManager.Instance.SetCurrentFocusView(runButton); + FocusManager.Instance.SetCurrentFocusView(_runButton); Tizen.Log.Fatal("NUI", "Clear test case!"); _detailView.Remove(view); } @@ -537,77 +689,20 @@ namespace Tizen.NUI.Tests _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)); } } @@ -619,7 +714,7 @@ namespace Tizen.NUI.Tests ResultNumber.Pass = 0; ResultNumber.Fail = 0; ResultNumber.Block = 0; - TCInfoList = new List(); + _tcInfoList = new List(); foreach (var testcaseItem in _listItem) { foreach (KeyValuePair pair in _tRunner.GetTestList()) @@ -648,7 +743,7 @@ namespace Tizen.NUI.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, @@ -665,25 +760,25 @@ namespace Tizen.NUI.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.Add(TCInfoList[CurrentTCNum].Preconditions[index]); + _currentTCInfo = new List(); + 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) @@ -691,19 +786,19 @@ namespace Tizen.NUI.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; @@ -717,33 +812,19 @@ namespace Tizen.NUI.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(_currentTCNum, _listItem); + } + SetSummaryResult(); - notRun.Text = _listItem[CurrentTCNum].Result; + _notRun.Text = _listItem[_currentTCNum].Result; } } } diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/Tizen.NUI.Manual.Tests.sln b/tct-suite-vs/Tizen.NUI.Manual.Tests/Tizen.NUI.Manual.Tests.sln index cffec67..eb22e3c 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/Tizen.NUI.Manual.Tests.sln +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/Tizen.NUI.Manual.Tests.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26124.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29905.134 MinimumVisualStudioVersion = 15.0.26124.0 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.Manual.Tests", "Tizen.NUI.Manual.Tests.csproj", "{66D8A33C-59A0-4F95-86BB-D4B98DB350B8}" EndProject diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs index 18051c0..cf3a48b 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs @@ -23,66 +23,160 @@ 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.Tests { class WearableManualTestNUI { + class ListBridge : FlexibleView.Adapter + { + private List _mDatas; + private List _mlistItem; + + public ListBridge(List datas, List item) + { + _mDatas = datas; + _mlistItem = item; + } + + public void UpdateItemData(int position, 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.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 _mDatas; + + public DetailListBridge(List 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 _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 List _listNotPass; - private static float PointSize = 5.0f; + private 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 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() @@ -93,7 +187,7 @@ namespace Tizen.NUI.Tests { 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(); @@ -168,46 +262,53 @@ namespace Tizen.NUI.Tests 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 + { + 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:"); } @@ -222,14 +323,6 @@ namespace Tizen.NUI.Tests 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; @@ -240,8 +333,6 @@ namespace Tizen.NUI.Tests _detailView.Add(_description); CreateDetailList(); - _detailView.Add(_detailList); - //To Place the function button, such as PASS, FAIL..... CreateButtons(); } @@ -257,20 +348,11 @@ namespace Tizen.NUI.Tests _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) @@ -290,43 +372,36 @@ namespace Tizen.NUI.Tests //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()) @@ -334,17 +409,14 @@ namespace Tizen.NUI.Tests _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()) @@ -352,36 +424,27 @@ namespace Tizen.NUI.Tests _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; @@ -392,16 +455,13 @@ namespace Tizen.NUI.Tests _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()) @@ -411,24 +471,21 @@ namespace Tizen.NUI.Tests } 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()) @@ -436,14 +493,13 @@ namespace Tizen.NUI.Tests _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(); @@ -452,14 +508,14 @@ namespace Tizen.NUI.Tests 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); } @@ -498,140 +554,52 @@ namespace Tizen.NUI.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) => + 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 @@ -641,7 +609,7 @@ namespace Tizen.NUI.Tests ResultNumber.Pass = 0; ResultNumber.Fail = 0; ResultNumber.Block = 0; - TCInfoList = new List(); + _tcInfoList = new List(); foreach (var testcaseItem in _listItem) { foreach (KeyValuePair pair in _tRunner.GetTestList()) @@ -670,7 +638,7 @@ namespace Tizen.NUI.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, @@ -687,25 +655,25 @@ namespace Tizen.NUI.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.Add(TCInfoList[CurrentTCNum].Preconditions[index]); + _currentTCInfo = new List(); + 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) @@ -713,19 +681,19 @@ namespace Tizen.NUI.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; @@ -738,22 +706,19 @@ namespace Tizen.NUI.Tests { 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; } } } diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/res/images/controller_btn_check_on.png b/tct-suite-vs/Tizen.NUI.Manual.Tests/res/images/controller_btn_check_on.png new file mode 100755 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.Manual.Tests/res/images/rectangle_btn_shadow.png b/tct-suite-vs/Tizen.NUI.Manual.Tests/res/images/rectangle_btn_shadow.png new file mode 100755 index 0000000000000000000000000000000000000000..df385f1ac93d827a9142148af02426f705dd143a GIT binary patch literal 1368 zcmeAS@N?(olHy`uVBq!ia0vp^79h;Q1|(OsS<3+_$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%xak-5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8hm3bwJ6}oxF$}kgLQj3#|G7CyF^YauyCMG83 zmzLNn0bL65LT-VtFWlg~VrW1CgG|37u|VHY&pf(~1RD?6IsxA(xEJ)Q4 zN-fSWElLK)N18HBGcfG%TLe-Fbd8luesXDUYF>$_i>(q+L@y;X#mdRZ+`z)k$i>XU z$j#8u)f^atE>4DK&Mp>)ZcZkShA_RJdBr7(dC93Ty_pET&Up1&ITxiSmgE=c`5nj#hRetg}OGiD6=dz#jPkmR{sBcEG(RJ&IOCPQ0E@YJd(RxH7JOltva~qg7xQLduznA1bg=$|IQwN z@BKTOKOfFL{}kM;5a6O08d_f~H}_{j%QRN6IYNuia6YP8&ZDt@irxNsY(jlswXbHC z>d!xadu2#g>}8W!mbveL&wIVgZ}rt(8e-k)C9gY;{*-JCpYlFt)7?Dz=S4eZC&u6O zTVCwhCY&XI)6eb4--?|vb^@};wPv54HP!3sgj=pwrs_D%?b4lmphGF%HKnySoQXrBfq@v}hkJs8b%Du(NvuyR=dJ%R z^P<3wa+%{(Sv{szr`kyTW_@$@^;hl4hC7#%Yb^w<{r{#dzG$&2x7s@;X7kNG8+Be! zxfOlt_LC#}v)A9znCkVr)hW?>@=2A_*#54DPqpN{ZM|h$`@gs^+1euL@XG2w zp8y`YYsL$Hov-CN@NDyZ&2k(4hl-2;6|BlSRdFpyn8Ca|>J0nGAipkX(Z0R5 zW@QaQ5Vi3(C5hK&@AWOj-z&$rtisC*6iuT}*o$(i1Bj3gdjJ_X)jp5}sy?v)8E7Gh z$_+*;jnavovIb3B^)Phav@x3?TDIkFRm%cI_JBUa3Q{wVMk&(JgVY`&!6xho$QW&d z4(J?gPicc$P131tTgjHZj2)N&sbt>VXSs4dNEQ9c*!GSYiY!7Q-u@0F8EtP~6Hf>Z_}TV|MC zE=T7YY3TGZoFqvM%QHOh#|XbWU?DZ{x7@X54+?NK$FPwBEzbs2s$YU_m#WXk%0)h8EBJ{NU>Yw#yy6m!<@UxD{o0HaEt>$k2%mJi}jI> zc{DVMfk;RY6|5mTt6yY8F#&5A8yf{KK$W=qJh_*+(Z6yTEQax#`$x0OM|grfb8d9; zW^VX_g(u#@qg~%n7sA(KCa#21`H9aTx73WaE{#nqn+tD0oS4XNN{<}I$fP7lAiJ0_*a7tUO6J3IR7+|v{-G_6}tH0J( z9Heh&m%RVFc*WVuC1mRnVnIcf??1*gvFOl3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8hm3bwJ6}oxF$}kgLQj3#|G7CyF^YauyCMG83 zmzLNn0bL65LT-VtFWlg~VrW1CgG|37u|VHY&pf(~1RD?6IsxA(xEJ)Q4 zN-fSWElLK)N18HBGcfG%TLe-Fbd8luesXDUYF>$_i>(q+L@y;X#md0c)Y8P++{Db> z$=uM;)!f3^+0@C%+1bd|#K_pd+z6)EGq1QLF)uk4rZ*Fz*BGx}E9aur#FG4?ko^1{ zSnLI4MqfGNHRn6xi5vQ1=QVD$BLaSW-r_2#yrACsfR(T|bIiv`W5$sF?Y?WkZB z683K}6FcH|h*M{U#)iep6NM#AJ~G^rtoB!6WmU}C^0oGzPTsZ+^H0`KntoSy+k@@* z+g?q)^4>o7ME2FpKfiyLJ>9kT%hcpleU=2Px#G)bep=SkQm13K-Rt{3t?OmYN&Tvv ziiiFjtAD<*NcGDCt}Q2JwWgn%Trah7@2Z)f)?DU(>TqJS(T3$cQ(L)fICp-T7AIM; zWY3O@Ypd&(%@17pu3M0DQA|xxBa*FQhSlvo^R^4e+VWp=uC8)mm&54IH 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); - } - } - } -} - - - diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSFocusManager.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSFocusManager.cs index ef0c8af..b6d868e 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSFocusManager.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSFocusManager.cs @@ -18,8 +18,7 @@ using System; 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 @@ -30,9 +29,9 @@ 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] @@ -40,14 +39,10 @@ namespace Tizen.NUI.Tests { 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(); } @@ -63,19 +58,14 @@ namespace Tizen.NUI.Tests 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; + _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); } @@ -83,7 +73,7 @@ namespace Tizen.NUI.Tests 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; } @@ -91,14 +81,14 @@ namespace Tizen.NUI.Tests 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(); } diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSInputMethodContext.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSInputMethodContext.cs index 56b927c..5f4c24c 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSInputMethodContext.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSInputMethodContext.cs @@ -18,8 +18,7 @@ using System; 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 @@ -31,8 +30,8 @@ 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; @@ -41,13 +40,9 @@ namespace Tizen.NUI.Tests { 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(); } @@ -63,20 +58,14 @@ namespace Tizen.NUI.Tests 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(); + _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); } diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSNUIApplication.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSNUIApplication.cs index af7a65d..d066a94 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSNUIApplication.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSNUIApplication.cs @@ -21,7 +21,6 @@ using NUnit.Framework.TUnit; using Tizen.Applications; using Tizen.NUI; using Tizen.NUI.BaseComponents; -using Tizen.NUI.UIComponents; namespace Tizen.NUI.Tests { diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSNUIWidgetApplication.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSNUIWidgetApplication.cs index adf1ce4..86b8eb2 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSNUIWidgetApplication.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSNUIWidgetApplication.cs @@ -20,7 +20,6 @@ using NUnit.Framework; using NUnit.Framework.TUnit; using Tizen.NUI; using Tizen.NUI.BaseComponents; -using Tizen.NUI.UIComponents; using Tizen.Applications; namespace Tizen.NUI.Tests @@ -31,7 +30,7 @@ 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; @@ -55,11 +54,6 @@ namespace Tizen.NUI.Tests } AppControl.SendLaunchRequest(myAppControl); - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - if(ManualTest.IsWearable()) { _pointSize = 4.0f; diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSPopup.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSPopup.cs deleted file mode 100755 index b755979..0000000 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSPopup.cs +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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(); - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - _popup.TouchedOutside -= OnPopupEvent; - _testPage.ClearTestCase(_button); - } - } - } -} - - - diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSScrollBar.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSScrollBar.cs deleted file mode 100755 index 4d58975..0000000 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSScrollBar.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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 diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSSlider.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSSlider.cs deleted file mode 100755 index 33fa132..0000000 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSSlider.cs +++ /dev/null @@ -1,181 +0,0 @@ -/* - * 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); - } - } - } -} - - - diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSTouch.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSTouch.cs old mode 100644 new mode 100755 index b953b41..8d128e9 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSTouch.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSTouch.cs @@ -19,7 +19,7 @@ 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 @@ -31,8 +31,8 @@ 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] @@ -40,13 +40,9 @@ namespace Tizen.NUI.Tests { 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(); } @@ -73,8 +69,12 @@ namespace Tizen.NUI.Tests private void CreateView(string information) { - _button = new PushButton(); - _button.Label = CreateTextMap(_PointSize, information); + _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; if (ManualTest.IsWearable()) { diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSView.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSView.cs index bb1c48f..603c0bd 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSView.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSView.cs @@ -19,7 +19,7 @@ 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 @@ -30,22 +30,17 @@ 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(); } @@ -72,9 +67,12 @@ namespace Tizen.NUI.Tests private void CreateView(string information) { - _button = new PushButton(); - _button.Label = CreateTextMap(PointSize, information); - + _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; // Invoke ExecuteTC() method to add UI to test area. _testPage.ExecuteTC(_button); } diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWidget.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWidget.cs index 17583f5..752f966 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWidget.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWidget.cs @@ -20,7 +20,6 @@ using NUnit.Framework; using NUnit.Framework.TUnit; using Tizen.NUI; using Tizen.NUI.BaseComponents; -using Tizen.NUI.UIComponents; using Tizen.Applications; namespace Tizen.NUI.Tests @@ -31,7 +30,7 @@ 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() @@ -49,12 +48,6 @@ namespace Tizen.NUI.Tests myAppControl.ApplicationId = "org.tizen.example.WidgetViewSample"; } AppControl.SendLaunchRequest(myAppControl); - - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - if(ManualTest.IsWearable()) { _pointSize = 4.0f; diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWidgetView.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWidgetView.cs index e29d04f..164d9b2 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWidgetView.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWidgetView.cs @@ -20,7 +20,6 @@ using NUnit.Framework; using NUnit.Framework.TUnit; using Tizen.NUI; using Tizen.NUI.BaseComponents; -using Tizen.NUI.UIComponents; using Tizen.Applications; namespace Tizen.NUI.Tests @@ -31,7 +30,7 @@ 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() @@ -50,11 +49,6 @@ namespace Tizen.NUI.Tests } AppControl.SendLaunchRequest(myAppControl); - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - if (ManualTest.IsWearable()) { _pointSize = 4.0f; diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWindow.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWindow.cs index 3931c3d..3ff0703 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWindow.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/testcase/TSWindow.cs @@ -19,7 +19,7 @@ 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 @@ -31,8 +31,8 @@ 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] @@ -40,13 +40,9 @@ namespace Tizen.NUI.Tests { 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(); } @@ -62,21 +58,14 @@ namespace Tizen.NUI.Tests 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(); + _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); } -- 2.7.4