From: zhouleonlei Date: Fri, 3 Apr 2020 00:41:02 +0000 (+0800) Subject: [NUI.Components.Manual][Non-ACR] Add new layouts, replace with new controls X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e9dea7a5d7754afb6602a1997f198d4f72b5f12;p=test%2Ftct%2Fcsharp%2Fapi.git [NUI.Components.Manual][Non-ACR] Add new layouts, replace with new controls Change-Id: I47b5108925ca311681de91c8f3db8f72c9fb2ac0 --- diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/ManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/ManualTestPage.cs index 4babaf097..1afe45da3 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/ManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/ManualTestPage.cs @@ -23,19 +23,95 @@ 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.Components.Tests { class ManualTestComponents - { + { + 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 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"; @@ -45,9 +121,7 @@ namespace Tizen.NUI.Components.Tests //For TV KantM //private static float PointSize = 30.0f; //private static float ButtonSizeWidth = 200; - private float _pointSize = 5.0f; - private float _pixelSize = 20.0f; - + private float _pointSize = 20.0f; //Save the information of every single test case private List _tcInfoList; @@ -58,17 +132,17 @@ namespace Tizen.NUI.Components.Tests //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; @@ -91,9 +165,11 @@ namespace Tizen.NUI.Components.Tests } public void Initialize() { - Tizen.Log.Fatal("NUI.Components", "Initialize========================================="); + Tizen.Log.Fatal("NUI.Components", "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(); @@ -115,65 +191,87 @@ namespace Tizen.NUI.Components.Tests Tizen.Log.Fatal("NUI.Components", "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.ParentOrigin = Position.ParentOriginTopLeft; + _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.GetDefaultLayer().Add(_initView); - window.GetDefaultLayer().Add(_detailView); + Window.Instance.GetDefaultLayer().Add(_detailView); 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.Components", "Check all the test case from the first one."); _currentTCNum = 0; @@ -182,57 +280,108 @@ namespace Tizen.NUI.Components.Tests UpdateDetailPage(); _detailView.Show(); FocusManager.Instance.SetCurrentFocusView(_runButton); - return false; }; - _run.RightFocusableView = _doneButton; - _doneButton.LeftFocusableView = _run; - - //To show all the test case information(Number _className._TCName [result]). - _initList = new TableView((uint)_tcIDList.Count, 1); + _doneButton.LeftFocusableView = _run; + + //To show all the test case information(Number _className._TCName [result]). + _initList = new FlexibleView(); + _initList.Size = new Size(Window.Instance.Size.Width * 0.4f, Window.Instance.Size.Height * 0.74f); + _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; - + _initList.ItemClickEvent += (obj, e) => + { + Button button = e.ClickedView.ItemView as Button; + if (button) + { + Tizen.Log.Fatal("NUI.Components", "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.Components", "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(2, 2); - _firstPageContainer.PivotPoint = Position.PivotPointTopLeft; + _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.74f); + _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(_run, new TableView.CellPosition(0, 1)); + _firstPageContainer.AddChild(_initList, new TableView.CellPosition(1, 0, 1, 2)); + _run.DownFocusableView = _initList; + _doneButton.DownFocusableView = _initList; _initView.Add(_firstPageContainer); Tizen.Log.Fatal("NUI.Components", "TCT : InitializeFirstPage:"); @@ -251,7 +400,7 @@ namespace Tizen.NUI.Components.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); @@ -259,15 +408,31 @@ namespace Tizen.NUI.Components.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 @@ -284,7 +449,7 @@ namespace Tizen.NUI.Components.Tests Tizen.Log.Fatal("NUI.Components", "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); @@ -299,19 +464,16 @@ namespace Tizen.NUI.Components.Tests //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.PointSize = _pointSize; _notRun.Text = "Not Run"; + _notRun.Size = new Size(Window.Instance.Size.Width * 0.06f, Window.Instance.Size.Height * 0.046f); - _passButton = new PushButton(); - _passButton.Focusable = true; - _passButton.LabelText = "Pass"; - _passButton.Clicked += (obj, ee) => + _passButton = new Button(); + SetCommonButtonStyle(_passButton, "Pass"); + _passButton.ClickEvent += (obj, ee) => { - Clear(); if (!ManualTest.IsConfirmed()) { @@ -319,13 +481,11 @@ namespace Tizen.NUI.Components.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()) @@ -334,13 +494,11 @@ namespace Tizen.NUI.Components.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()) @@ -348,30 +506,24 @@ namespace Tizen.NUI.Components.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.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; @@ -383,13 +535,11 @@ namespace Tizen.NUI.Components.Tests _initView.Show(); 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()) @@ -412,12 +562,11 @@ namespace Tizen.NUI.Components.Tests _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()) @@ -437,27 +586,33 @@ namespace Tizen.NUI.Components.Tests _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) { Tizen.Log.Fatal("NUI.Components", "Execute the manual test case!"); - - _caseView = view; + _caseView = view; _caseView.ParentOrigin = Position.ParentOriginTopLeft; _caseView.PivotPoint = PivotPoint.TopLeft; - _caseView.Position = new Position(20.0f, 700.0f, 0.0f); _detailView.Add(_caseView); _caseView.KeyEvent += OnKeyPressed; _caseView.Show(); @@ -531,63 +686,6 @@ namespace Tizen.NUI.Components.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.Components", "_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.Components", "Print the CreateDetailList::"); @@ -598,7 +696,7 @@ namespace Tizen.NUI.Components.Tests 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]; @@ -709,33 +807,19 @@ namespace Tizen.NUI.Components.Tests else if (e.Result.Contains(StrResult.BLOCK)) { ResultNumber.Block += 1; + } + + 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); } - _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.Components", "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)); SetSummaryResult(); _notRun.Text = _listItem[_currentTCNum].Result; } diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/WearableManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/WearableManualTestPage.cs index 9ed89cd7c..32cf906aa 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/WearableManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/WearableManualTestPage.cs @@ -23,18 +23,120 @@ 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.Components.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 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"; @@ -52,25 +154,17 @@ namespace Tizen.NUI.Components.Tests //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 View _detailView; + 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 static int _detailScrollHeight = 60; public static WearableManualTestNUI GetInstance() @@ -93,7 +187,7 @@ namespace Tizen.NUI.Components.Tests { Window.Instance.BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 1.0f); Tizen.Log.Fatal("NUI.Components", "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(); @@ -166,28 +260,42 @@ namespace Tizen.NUI.Components.Tests window.GetDefaultLayer().Add(_initView); 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.Components", "Check all the test case from the first one."); _currentTCNum = 0; @@ -195,15 +303,8 @@ namespace Tizen.NUI.Components.Tests _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); @@ -222,14 +323,6 @@ namespace Tizen.NUI.Components.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.Components.Tests _detailView.Add(_description); CreateDetailList(); - _detailView.Add(_detailList); - //To Place the function button, such as PASS, FAIL..... CreateButtons(); } @@ -258,16 +349,7 @@ namespace Tizen.NUI.Components.Tests _detailList.Dispose(); } Tizen.Log.Fatal("NUI.Components", "Print the CurrentTCNum here::" + _currentTCNum); - - _detailList = new ScrollView(); - _detailList.BackgroundColor = Color.Black; - _detailList.Size2D = new Size2D(_scrollWidth - 100, _detailScrollHeight); - _detailList.ParentOrigin = ParentOrigin.TopLeft; - _detailList.PivotPoint = PivotPoint.TopLeft; - _detailList.Position2D = new Position2D(30, 20); - _detailList.ClippingMode = ClippingModeType.ClipChildren; CreateDetailList(); - _detailView.Add(_detailList); if (_notRun) { _notRun.Text = _listItem[_currentTCNum].Result; @@ -290,26 +372,22 @@ namespace Tizen.NUI.Components.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.Size = new Size(40, 30); _notRun.PointSize = 2.5f; - _notRun.Position2D = new Position2D(260, 118); + _notRun.Position = new Position(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) => + _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()) { @@ -317,16 +395,13 @@ namespace Tizen.NUI.Components.Tests ManualTest.Confirm(); } Tizen.Log.Fatal("TBT", "Pass Button clicked!"); - return true; }; - TextLabel fail = CreateTextLabel("F", 20); - _failButton = new PushButton(); - _failButton.Size2D = new Size2D(70, 30); - _failButton.Position2D = new Position2D(72, 0); - _failButton.LabelText = ""; - _failButton.Add(fail); - _failButton.Clicked += (obj, ee) => + _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()) @@ -335,16 +410,13 @@ namespace Tizen.NUI.Components.Tests ManualTest.Confirm(); } Tizen.Log.Fatal("TBT", "Fail Button clicked!"); - return true; }; - TextLabel block = CreateTextLabel("B", 20); - _blockButton = new PushButton(); - _blockButton.Size2D = new Size2D(70, 30); - _blockButton.Position2D = new Position2D(144, 0); - _blockButton.LabelText = ""; - _blockButton.Add(block); - _blockButton.Clicked += (obj, ee) => + _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.Components.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.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.Components.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()) @@ -419,16 +479,13 @@ namespace Tizen.NUI.Components.Tests 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()) @@ -443,7 +500,6 @@ namespace Tizen.NUI.Components.Tests _notRun.Text = _listItem[_currentTCNum].Result; UpdateDetailPage(); } - return true; }; View buttonView = new View(); @@ -498,140 +554,52 @@ namespace Tizen.NUI.Components.Tests Tizen.Log.Fatal("ManualTCT", "Set the result Text"); } - private PropertyMap CreateTextMap(float pointSize, string text) - { - PropertyMap map = new PropertyMap(); - map.Insert("visualType", new PropertyValue("TEXT")); - map.Insert("pointSize", new PropertyValue(pointSize)); - map.Insert("text", new PropertyValue(text)); - return map; - } - private void CreateInitList() { - int tcNum = _tcIDList.Count; - _buttonList = new PushButton[tcNum]; - _resultList = new TextLabel[tcNum]; - for (int index = 0; index < tcNum; index++) - { - string name = _tcIDList[index]; - string testcaseName = "#." + (index + 1).ToString(); - Tizen.Log.Fatal("ManualTCT", "name: " + name); - TextLabel label = new TextLabel(); - label.TextColor = Color.White; - label.Text = testcaseName; - label.PointSize = 4.0f; - label.VerticalAlignment = VerticalAlignment.Center; - label.ParentOrigin = ParentOrigin.TopLeft; - label.PivotPoint = PivotPoint.TopLeft; - label.Size2D = new Size2D(40, _scrollHeight); - label.Position2D = new Position2D(0, 0); - - - TextLabel nameLabel = new TextLabel(); - nameLabel.ParentOrigin = ParentOrigin.TopLeft; - nameLabel.PivotPoint = PivotPoint.TopLeft; - nameLabel.Text = name; - nameLabel.VerticalAlignment = VerticalAlignment.Bottom; - nameLabel.PointSize = 4.0f; - nameLabel.TextColor = Color.White; - nameLabel.MultiLine = true; - nameLabel.Size2D = new Size2D(245, _scrollHeight); - nameLabel.Position2D = new Position2D(5, 0); - nameLabel.TextColor = Color.White; - - string resultText = "[" + _listItem[(int)index].Result + "]"; - _buttonList[index] = new PushButton(); - _buttonList[index].Name = index.ToString(); - _buttonList[index].ParentOrigin = ParentOrigin.TopLeft; - _buttonList[index].PivotPoint = PivotPoint.TopLeft; - _buttonList[index].Position = new Position(33, 0.0f, 0.0f); - _buttonList[index].Size2D = new Size2D(255, _scrollHeight); - _buttonList[index].LabelText = ""; - _buttonList[index].Add(nameLabel); - _buttonList[index].Clicked += (obj, e) => - { - PushButton button = obj as PushButton; - - Tizen.Log.Fatal("TBT", "Item clicked!!!!!!!!!!!!!!::" + button.Name); - _currentTCNum = int.Parse(button.Name); - _initView.Hide(); - UpdateDetailPage(); - _caseView.Hide(); - _detailView.Show(); - return false; - }; - - _resultList[index] = new TextLabel(); - _resultList[index].TextColor = Color.White; - _resultList[index].PointSize = 3.0f; - _resultList[index].Name = index.ToString(); - _resultList[index].Text = resultText; - _resultList[index].ParentOrigin = ParentOrigin.TopLeft; - _resultList[index].PivotPoint = PivotPoint.TopLeft; - _resultList[index].Position = new Position(285.0f, 0.0f, 0.0f); - _resultList[index].Size2D = new Size2D(65, _scrollHeight); - _resultList[index].VerticalAlignment = VerticalAlignment.Center; - _resultList[index].HorizontalAlignment = HorizontalAlignment.Center; - - View pageActor = new View(); - pageActor.WidthResizePolicy = ResizePolicyType.FillToParent; - pageActor.HeightResizePolicy = ResizePolicyType.FillToParent; - pageActor.ParentOrigin = ParentOrigin.TopLeft; - pageActor.PivotPoint = PivotPoint.TopLeft; - pageActor.Position = new Position(0, index * _scrollHeight, 0.0f); - - pageActor.Add(label); - pageActor.Add(_buttonList[index]); - pageActor.Add(_resultList[index]); - _initList.Add(pageActor); - } - _initList.SetAxisAutoLock(false); - PropertyMap rulerMapY = new PropertyMap(); - rulerMapY.Add((int)ScrollModeType.XAxisScrollEnabled, new PropertyValue(false)); - rulerMapY.Add((int)ScrollModeType.YAxisScrollEnabled, new PropertyValue(true)); - rulerMapY.Add((int)ScrollModeType.YAxisSnapToInterval, new PropertyValue(_scrollHeight)); - rulerMapY.Add((int)ScrollModeType.YAxisScrollBoundary, new PropertyValue(_scrollHeight * tcNum)); - _initList.ScrollMode = rulerMapY; - - Tizen.Log.Fatal("ManualTCT", "Initial ScrollView"); + Tizen.Log.Fatal("ManualTCT", "CreateInitList"); + _initList = new FlexibleView(); + _initList.ParentOrigin = ParentOrigin.TopLeft; + _initList.PivotPoint = PivotPoint.TopLeft; + _initList.Size = new Size(Window.Instance.Size.Width, 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) + { + Tizen.Log.Fatal("TBT", "Item clicked!!::" + button.Name); + _currentTCNum = int.Parse(button.Name); + _initView.Hide(); + UpdateDetailPage(); + _caseView.Hide(); + _detailView.Show(); + } + }; } private void CreateDetailList() { - Tizen.Log.Fatal("NUI.Components", "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.Components", "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 @@ -705,7 +673,7 @@ namespace Tizen.NUI.Components.Tests { _currentTCInfo.Add(_tcInfoList[_currentTCNum].Postconditions[index]); } - Tizen.Log.Fatal("NUI.Components", "Ppppppppppppppppppppppprint the CurrentTCNum::" + _currentTCNum); + Tizen.Log.Fatal("NUI.Components", "the CurrentTCNum::" + _currentTCNum); } private void OnSingleTestDone(object sender, SingleTestDoneEventArgs e) @@ -737,24 +705,21 @@ namespace Tizen.NUI.Components.Tests else if (e.Result.Contains(StrResult.BLOCK)) { ResultNumber.Block += 1; + } + + 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); } - 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; - } } } diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/res/images/rectangle_btn_shadow.png b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/res/images/rectangle_btn_shadow.png new file mode 100755 index 000000000..df385f1ac Binary files /dev/null and b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/res/images/rectangle_btn_shadow.png differ diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/res/images/rectangle_point_btn_normal.png b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/res/images/rectangle_point_btn_normal.png new file mode 100755 index 000000000..677963924 Binary files /dev/null and b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/res/images/rectangle_point_btn_normal.png differ diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/res/images/rectangle_toggle_btn_normal.png b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/res/images/rectangle_toggle_btn_normal.png new file mode 100755 index 000000000..a73694bd6 Binary files /dev/null and b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/res/images/rectangle_toggle_btn_normal.png differ diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSButton.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSButton.cs index 4ef7e1e54..d130d4d4b 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSButton.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSButton.cs @@ -32,20 +32,15 @@ namespace Tizen.NUI.Components.Tests private ManualTestComponents _testPage; private WearableManualTestNUI _wearTestPage; private Components.Button _button; - private float _pointSize = 5.0f; + private float _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f; [SetUp] public void Init() { LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - if(ManualTest.IsWearable()) { - _pointSize = 4.0f; + _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 0.28f; _wearTestPage = WearableManualTestNUI.GetInstance(); } else @@ -60,23 +55,6 @@ namespace Tizen.NUI.Components.Tests LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); } - private void CreateButton(string buttonText) - { - _button = new Components.Button(); - _button.Text = buttonText; - _button.PointSize = _pointSize; - _button.BackgroundColor = Color.Cyan; - if(ManualTest.IsWearable()) - { - _button.Size2D = new Size2D(200, 50); - _wearTestPage.ExecuteTC(_button); - } - else - { - _testPage.ExecuteTC(_button); - } - } - private void CreateMyButton(string buttonText) { _button = new Button(); @@ -85,11 +63,11 @@ namespace Tizen.NUI.Components.Tests _button.Text = buttonText; _button.PointSize = _pointSize; _button.BackgroundColor = Color.Cyan; - _button.Size2D = new Size2D(200, 50); + _button.Position = new Position(Window.Instance.Size.Width * 0.45f, Window.Instance.Size.Height * 0.5f); + _button.Size = new Size(Window.Instance.Size.Width * 0.1f, Window.Instance.Size.Height * 0.0462f); _button.Focusable = true; if (ManualTest.IsWearable()) { - _button.Size2D = new Size2D(200, 50); _wearTestPage.ExecuteTC(_button); } else @@ -100,7 +78,7 @@ namespace Tizen.NUI.Components.Tests public void OnClicked(object sender, EventArgs e) { - Tizen.Log.Fatal("Components", "Button OnClicked!!!!!!!!!!!!!!!!!!!!!"); + Tizen.Log.Fatal("NUI.Components", "Button OnClicked!!!!!!!!!!!!!!!!!!!!!"); _button.Text = "Clicked"; ManualTest.Confirm(); } diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs old mode 100644 new mode 100755 index b250c2792..51db7e9f7 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs @@ -33,21 +33,16 @@ namespace Tizen.NUI.Components.Tests private WearableManualTestNUI _wearTestPage; private Popup _popup; - private float _pointSize = 5.0f; + private float _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f; private string _resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; [SetUp] public void Init() { LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - if (ManualTest.IsWearable()) { - _pointSize = 4.0f; + _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 0.28f; _wearTestPage = WearableManualTestNUI.GetInstance(); } else @@ -66,40 +61,44 @@ namespace Tizen.NUI.Components.Tests { _popup = new Popup(); Assert.IsNotNull(_popup, "Should be not null"); - Assert.IsInstanceOf(_popup, "Should be equal!"); - _popup.MinimumSize = new Size2D(232, 184); - _popup.Size2D = new Size2D(232, 200); - - _popup.TitlePointSize = _pointSize; - _popup.TitleTextColor = Color.Black; - _popup.TitleHeight = 68; - _popup.TitleTextHorizontalAlignment = HorizontalAlignment.Begin; - _popup.TitleTextPosition = new Position(64, 52); - _popup.TitleText = "Popup Title"; - - _popup.BackgroundImage = _resourcePath + "/images/popup_background.png"; - _popup.ButtonOverLayBackgroundColorSelector = new ColorSelector - { - Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f), - Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f), - Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f), - }; - _popup.ButtonTextColor = new Color(0.05f, 0.63f, 0.9f, 1); - _popup.ButtonHeight = 132; - _popup.SetButtonText(0, "Yes"); - _popup.SetButtonText(1, "Exit"); - - TextLabel contentText = new TextLabel(); - contentText.Size2D = new Size2D(104, 100); - contentText.PointSize = _pointSize; - contentText.HorizontalAlignment = HorizontalAlignment.Begin; - contentText.VerticalAlignment = VerticalAlignment.Center; - contentText.Text = "Popup"; - _popup.ContentView.Add(contentText); + Assert.IsInstanceOf(_popup, "Should be equal!"); + _popup.Size = new Size(Window.Instance.Size.Width * 0.2f, Window.Instance.Size.Height * 0.24f); + _popup.Position = new Position(Window.Instance.Size.Width * 0.39f, Window.Instance.Size.Height * 0.2f); + + // Title + _popup.Style.Title.PointSize = _pointSize; + _popup.Style.Title.SizeHeight = Window.Instance.Size.Height * 0.025f; + _popup.Style.Title.HorizontalAlignment = HorizontalAlignment.Begin; + _popup.Style.Title.Position = new Position(Window.Instance.Size.Width * 0.033f, Window.Instance.Size.Height * 0.01f); + _popup.Style.Title.Text = "Popup Title"; + _popup.Style.Title.Padding = new Extents(0, 0, 0, 0); + + // Background + _popup.BackgroundImage = _resourcePath + "/images/popup_background.png"; + + // Buttons + _popup.AddButton("Yes"); + _popup.AddButton("Exit"); + _popup.ButtonOverLayBackgroundColorSelector = new Selector + { + Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f), + Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f), + Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f), + }; + _popup.ButtonHeight = (int)(Window.Instance.Size.Height * 0.07); + _popup.Post(Window.Instance); + + TextLabel contentText = new TextLabel(); + contentText = new TextLabel(); + contentText.Size = new Size(Window.Instance.Size.Width * 0.2f, Window.Instance.Size.Height * 0.1f); + contentText.PointSize = _pointSize; + contentText.HorizontalAlignment = HorizontalAlignment.Begin; + contentText.VerticalAlignment = VerticalAlignment.Center; + contentText.Text = "Popup contentText "; + _popup.AddContentText(contentText); if (ManualTest.IsWearable()) { - _popup.Size2D = new Size2D(200, 50); _wearTestPage.ExecuteTC(_popup); } else @@ -110,7 +109,7 @@ namespace Tizen.NUI.Components.Tests public void OnPopupButtonClicked(object sender, Popup.ButtonClickEventArgs e) { - Tizen.Log.Fatal("NUI", "Popup OnPopupButtonClicked!!!!!!!!!!!!!!!!!!!!!"); + Tizen.Log.Fatal("NUI.Components", "Popup OnPopupButtonClicked!!!!!!!!!!!!!!!!!!!!!"); ManualTest.Confirm(); } diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSlider.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSlider.cs old mode 100644 new mode 100755 index 7ee8f343a..4b295e6ed --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSlider.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSlider.cs @@ -19,7 +19,6 @@ using System.Threading.Tasks; using NUnit.Framework; using NUnit.Framework.TUnit; using Tizen.NUI; -using Tizen.NUI.UIComponents; using Tizen.NUI.BaseComponents; using Tizen.NUI.Components; @@ -32,8 +31,9 @@ namespace Tizen.NUI.Components.Tests private ManualTestComponents _testPage; private WearableManualTestNUI _wearTestPage; private Window _window; - private PushButton _button; - private float _pointSize = 5.0f; + private View _view; + private Button _button; + private float _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 1.06f; private TextLabel _label; private Slider _slider; @@ -42,20 +42,20 @@ namespace Tizen.NUI.Components.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; _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!"); + _pointSize = (Window.Instance.Size.Width / Window.Instance.Dpi.Length()) * 0.28f; _wearTestPage = WearableManualTestNUI.GetInstance(); } else { _testPage = ManualTestComponents.GetInstance(); - } + } + + _view = new View(); + _view.Size = new Size2D(Window.Instance.Size.Width, (int)(Window.Instance.Size.Height * 0.8)); + _view.Position = new Position(0.0f, 0.0f, 0.0f); } [TearDown] @@ -77,52 +77,48 @@ namespace Tizen.NUI.Components.Tests Normal = "9. Controller/controller_btn_slide_handler_normal.png", Pressed = "9. Controller/controller_btn_slide_handler_press.png", }, - ThumbSize = new Size(60, 60), + ThumbSize = new Size(Window.Instance.Size.Width * 0.0312f, Window.Instance.Size.Height * 0.0555f), Direction = Slider.DirectionType.Horizontal, MinValue = 0, MaxValue = 100, - Position2D = new Position2D(10, 10), - Size2D = new Size2D(800, 50), + Position = new Position(Window.Instance.Size.Width * 0.3f, Window.Instance.Size.Height * 0.4f), + Size = new Size(Window.Instance.Size.Width * 0.4166f, Window.Instance.Size.Height * 0.0462f), CurrentValue = 10, }; + _view.Add(_slider); return _slider; } - 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); + _button = new Button(); + _button.Text = information; + _button.PointSize = _pointSize; + _button.Position = new Position(Window.Instance.Size.Width * 0.45f, Window.Instance.Size.Height * 0.5f); + _button.Size = new Size(Window.Instance.Size.Width * 0.1041f, Window.Instance.Size.Height * 0.0462f); + _button.BackgroundColor = Color.Cyan; + _view.Add(_button); + _testPage.ExecuteTC(_view); } private void OnValueChangedEvent(object sender, EventArgs e) { - Tizen.Log.Fatal("NUI", "ValueChangedEvent event !!!!!"); + Tizen.Log.Fatal("NUI.Components", "ValueChangedEvent event !!!!!"); ManualTest.Confirm(); _window.Remove(_slider); } private void OnSlidingFinishedEvent(object sender, EventArgs e) { - Tizen.Log.Fatal("NUI", "SlidingFinishedEvent event !!!!!"); + Tizen.Log.Fatal("NUI.Components", "SlidingFinishedEvent event !!!!!"); ManualTest.Confirm(); _window.Remove(_slider); } private void OnStateChangedEvent(object sender, EventArgs e) { - Tizen.Log.Fatal("NUI", "StateChangedEvent event !!!!!"); + Tizen.Log.Fatal("NUI.Components", "StateChangedEvent event !!!!!"); ManualTest.Confirm(); _window.Remove(_slider); } @@ -153,14 +149,12 @@ namespace Tizen.NUI.Components.Tests { CreateView("Press Key-Down"); _slider = CreateSlider(); - _window.Add(_slider); - _slider.ValueChangedEvent += OnValueChangedEvent; // Waits for user confirmation. await ManualTest.WaitForConfirm(); _slider.ValueChangedEvent -= OnValueChangedEvent; - _testPage.ClearTestCase(_button); + _testPage.ClearTestCase(_view); } } @@ -189,13 +183,11 @@ namespace Tizen.NUI.Components.Tests { CreateView("Press Key-Down"); _slider = CreateSlider(); - - _window.Add(_slider); _slider.SlidingFinishedEvent += OnSlidingFinishedEvent; // Waits for user confirmation. await ManualTest.WaitForConfirm(); _slider.SlidingFinishedEvent -= OnSlidingFinishedEvent; - _testPage.ClearTestCase(_button); + _testPage.ClearTestCase(_view); } } @@ -224,12 +216,11 @@ namespace Tizen.NUI.Components.Tests { CreateView("Press Key-Down"); _slider = CreateSlider(); - _window.Add(_slider); _slider.StateChangedEvent += OnStateChangedEvent; // Waits for user confirmation. await ManualTest.WaitForConfirm(); _slider.StateChangedEvent -= OnStateChangedEvent; - _testPage.ClearTestCase(_button); + _testPage.ClearTestCase(_view); } } } diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs old mode 100644 new mode 100755 index 45b375cd4..e79ae8db8 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs @@ -32,21 +32,14 @@ namespace Tizen.NUI.Components.Tests private ManualTestComponents _testPage; private WearableManualTestNUI _wearTestPage; private Switch _switch; - private float _pointSize = 5.0f; private string _resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; [SetUp] public void Init() { LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - if (ManualTest.IsWearable()) { - _pointSize = 4.0f; _wearTestPage = WearableManualTestNUI.GetInstance(); } else @@ -66,8 +59,9 @@ namespace Tizen.NUI.Components.Tests _switch = new Switch(); Assert.IsNotNull(_switch, "Should be not null"); Assert.IsInstanceOf(_switch, "Should be equal!"); - _switch.Size2D = new Size2D(96, 60); - _switch.Style.Thumb.Size = new Size(60, 60); + _switch.Size = new Size(Window.Instance.Size.Width * 0.05f, Window.Instance.Size.Height * 0.0555f); + _switch.Position = new Position(Window.Instance.Size.Width * 0.5f, Window.Instance.Size.Height * 0.5f); + _switch.Style.Thumb.Size = new Size(Window.Instance.Size.Width * 0.0312f, Window.Instance.Size.Height * 0.0555f); _switch.Style.Track.ResourceUrl = new Selector { Normal = _resourcePath + "/images/controller_switch_bg_off.png", @@ -91,7 +85,7 @@ namespace Tizen.NUI.Components.Tests private void OnSelectedEvent(object sender, Switch.SelectEventArgs e) { - Tizen.Log.Fatal("Components", "SelectButton Selected!!!!!!!!!!!!!!!!!!!!!"); + Tizen.Log.Fatal("NUI.Components", "SelectButton Selected!!!!!!!!!!!!!!!!!!!!!"); ManualTest.Confirm(); }