--- /dev/null
+/*
+* Copyright (c) 2017 Samsung Electronics Co., Ltd.
+*
+* 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.Runtime.InteropServices;
+using System.Collections.Generic;
+using NUnitLite.TUnit;
+using NUnit.Framework.Interfaces;
+using NUnit.Framework.TUnit;
+using System.Reflection;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using Tizen.Applications;
+
+namespace Tizen.NUI.Tests
+{
+ class ManualTestNUI
+ {
+ class ListBridge : FlexibleViewAdapter
+ {
+ private List<string> _mDatas;
+ private List<ItemData> _mlistItem;
+
+ public ListBridge(List<string> datas, List<ItemData> item)
+ {
+ _mDatas = datas;
+ _mlistItem = item;
+ }
+
+ public void UpdateItemData(int position, List<ItemData> item)
+ {
+ _mlistItem = item;
+ }
+
+ public override FlexibleViewViewHolder OnCreateViewHolder(int viewType)
+ {
+ FlexibleViewViewHolder viewHolder = new FlexibleViewViewHolder(new Button());
+ return viewHolder;
+ }
+
+ public override void OnBindViewHolder(FlexibleViewViewHolder 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.Feedback = false;
+ btn.Name = position.ToString();
+ btn.PointSize = ManualTest.GetPointSize();
+ btn.Size = new Size(Window.Instance.Size.Width, Window.Instance.Size.Height * 0.046f);
+ btn.TextColor = new Color(0, 0, 0, 1);
+ btn.ImageShadow = new ImageShadow
+ (
+ Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png",
+ new Rectangle(5, 5, 5, 5)
+ );
+ btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
+ btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
+ btn.FocusGained += (obj, e) =>
+ {
+ btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
+ };
+ btn.FocusLost += (obj, e) =>
+ {
+ btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
+ };
+ btn.ParentOrigin = Position.ParentOriginTopLeft;
+ btn.PivotPoint = PivotPoint.TopLeft;
+ btn.TextAlignment = HorizontalAlignment.Begin;
+ btn.CellIndex = new Vector2(position, 0);
+ }
+ }
+
+ public override void OnDestroyViewHolder(FlexibleViewViewHolder holder)
+ {
+ if (holder.ItemView != null)
+ {
+ holder.ItemView.Dispose();
+ }
+ }
+
+ public override int GetItemCount()
+ {
+ return _mDatas.Count;
+ }
+ }
+
+ private List<string> _tcIDList;
+ private List<ItemData> _listItem;
+ private TSettings _tsettings;
+ private TRunner _tRunner;
+ private Button _passButton, _failButton, _blockButton, _homeButton, _preButton, _nextButton, _doneButton;
+ private TextLabel _notRun;
+ private const string STEP_ATTRIBUTE_NAME = "NUnit.Framework.StepAttribute";
+ private const string PRECONDITION_ATTRIBUTE_NAME = "NUnit.Framework.PreconditionAttribute";
+ private const string POSTCONDITION_ATTRIBUTE_NAME = "NUnit.Framework.PostconditionAttribute";
+ private List<string> _listNotPass;
+ private ToastMessage _toastMessage;
+ //For TV
+ private float _pointSize = 20.0f;
+
+ //Save the information of every single test case
+ private List<TestcaseInfo> _tcInfoList;
+ private List<string> _currentTCInfo;
+
+ private static ManualTestNUI _instance;
+ private static Object _lockObject = new object();
+
+ //Show the result of all the test case
+ private TextLabel _summaryLabel;
+ private View _initView;
+ private View _detailView;
+ private View _caseView;
+ private FlexibleView _initList;
+ private ListBridge _adapter;
+ private TableView _detailList;
+ private ScrollableBase _scrollableBase;
+ private View _buttonContainer;
+ private View _buttonContainer2;
+ private TableView _firstPageContainer;
+ private Button _run;
+ private Button _runButton;
+
+ //Always save the current TC number;
+ private int _currentTCNum = 0;
+
+
+ public static ManualTestNUI GetInstance()
+ {
+ lock (_lockObject)
+ {
+ if (_instance == null)
+ {
+ _instance = new ManualTestNUI();
+ }
+ }
+ return _instance;
+ }
+
+ private ManualTestNUI()
+ {
+ Initialize();
+ }
+ public void Initialize()
+ {
+ FocusManager.Instance.FocusIndicator = new View()
+ {
+ PositionUsesPivotPoint = true,
+ PivotPoint = new Position(0, 0, 0),
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ BorderlineColor = Color.Orange,
+ BorderlineWidth = 4.0f,
+ BorderlineOffset = -1f,
+ BackgroundColor = new Color(0.2f, 0.2f, 0.2f, 0.2f),
+ };
+
+ 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 = ManualTest.GetPointSize();
+ RunType.Value = RunType.MANUAL;
+ _tRunner = new TRunner();
+ _tRunner.LoadTestsuite();
+ _tRunner.SingleTestDone += OnSingleTestDone;
+ _tcIDList = new List<string>();
+ _listItem = new List<ItemData>();
+ _listNotPass = TSettings.GetInstance().GetNotPassListManual();
+ int count = 0;
+ if (_listNotPass.Count == 0)
+ {
+ foreach (KeyValuePair<string, ITest> pair in _tRunner.GetTestList())
+ {
+ count++;
+ _listItem.Add(new ItemData { No = count, TCName = pair.Key, Result = StrResult.NOTRUN });
+ _tcIDList.Add(pair.Key);
+ }
+ }
+ else
+ {
+ foreach (var tc in _listNotPass)
+ {
+ count++;
+ _listItem.Add(new ItemData { No = count, TCName = tc, Result = StrResult.NOTRUN });
+ _tcIDList.Add(tc);
+ }
+ }
+ Tizen.Log.Fatal("NUI", "TCT : count:" + count.ToString());
+ foreach (String nameTc in _tcIDList)
+ {
+ Tizen.Log.Fatal("NUI", "TCT : TCName:" + nameTc.ToString());
+ }
+
+ _tsettings = TSettings.GetInstance();
+ _tsettings.IsManual = true;
+
+ InitData();
+ _caseView = new View();
+
+ _summaryLabel = new TextLabel();
+ _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.HorizontalAlignment = HorizontalAlignment.Center;
+ _summaryLabel.VerticalAlignment = VerticalAlignment.Center;
+ Window.Instance.GetDefaultLayer().Add(_summaryLabel);
+ SetSummaryResult();
+
+ _initView = new View();
+ _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;
+ InitializeFirstPage();
+ _initView.Show();
+ Window.Instance.GetDefaultLayer().Add(_initView);
+
+ _detailView = new View();
+ _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;
+ InitializeDetailPage();
+ _detailView.Hide();
+ Window.Instance.GetDefaultLayer().Add(_detailView);
+
+ FocusManager.Instance.SetCurrentFocusView(_run);
+ }
+
+ public void LockUIButton()
+ {
+ _runButton.IsEnabled = false;
+ }
+
+ public void UnlockUIButton()
+ {
+ _runButton.IsEnabled = true;
+ }
+
+ void SetCommonButtonStyle(Button btn, string text)
+ {
+ if (!btn) return;
+ btn.Focusable = true;
+ btn.Text = text;
+ btn.Feedback = false;
+ btn.PointSize = _pointSize;
+ float buttonWidth = ManualTest.IsMobile() ? Window.Instance.Size.Width * 0.18f : Window.Instance.Size.Width * 0.06f;
+ btn.Size = new Size(buttonWidth, Window.Instance.Size.Height * 0.046f);
+ btn.TextColor = new Color(0, 0, 0, 1);
+ btn.ImageShadow = new ImageShadow
+ (
+ Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png",
+ new Rectangle(5, 5, 5, 5)
+ );
+ btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
+ btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
+ btn.ParentOrigin = Position.ParentOriginTopLeft;
+ btn.PivotPoint = PivotPoint.TopLeft;
+ btn.FocusGained += (obj, e) =>
+ {
+ btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
+ };
+ btn.FocusLost += (obj, e) =>
+ {
+ btn.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 Button();
+ SetCommonButtonStyle(_doneButton, "Done");
+ _doneButton.Clicked += (obj, ee) =>
+ {
+ TSettings.GetInstance().SubmitManualResult();
+ };
+
+ _run = new Button();
+ SetCommonButtonStyle(_run, "Runner");
+ _run.Clicked += (obj, ee) =>
+ {
+ Tizen.Log.Fatal("NUI", "Check all the test case from the first one.");
+ _currentTCNum = 0;
+ _initView.Hide();
+ _caseView.Hide();
+ UpdateDetailPage();
+ _detailView.Show();
+ FocusManager.Instance.SetCurrentFocusView(_runButton);
+ };
+ _run.RightFocusableView = _doneButton;
+ _doneButton.LeftFocusableView = _run;
+
+ //To show all the test case information(Number _className._TCName [result]).
+ _initList = new FlexibleView();
+ _initList.Position = new Position(0, Window.Instance.Size.Height * 0.0925f);
+ _initList.Size = new Size(Window.Instance.Size.Width, 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.ItemClicked += (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) =>
+ {
+ FlexibleViewViewHolder 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
+ {
+ FlexibleViewViewHolder 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++;
+ }
+ FlexibleViewViewHolder 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.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.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);
+ }
+
+ //Update the Test Page before you want to show it(Click Run/Pre/nect Button, or Click on item in the List).
+ void UpdateDetailPage()
+ {
+ UpdateCurrentTCInfo();
+ Tizen.Log.Fatal("NUI", "UpdateDetailPage:");
+ CreateTestCase();
+ }
+
+ void InitializeDetailPage()
+ {
+ _scrollableBase = new ScrollableBase
+ {
+ Size = new Size(Window.Instance.Size.Width * 0.9739f, Window.Instance.Size.Height * 0.6629f),
+ ScrollingDirection = ScrollableBase.Direction.Vertical,
+ };
+ _detailList = new TableView(23, 1);
+ _detailList.Focusable = true;
+ _detailList.Size = new Size(Window.Instance.Size.Width * 0.9739f, Window.Instance.Size.Height * 0.9f);
+ _detailList.ParentOrigin = Position.ParentOriginTopLeft;
+ _detailList.PivotPoint = PivotPoint.TopLeft;
+ _detailList.Position = new Position(0.0f, 0.0f, 0.0f);
+ CreateDetailList();
+ _scrollableBase.Add(_detailList);
+ _detailView.Add(_scrollableBase);
+
+ //To Place the function button, such as PASS, FAIL.....
+ _buttonContainer = new View();
+ _buttonContainer.PivotPoint = PivotPoint.TopLeft;
+ _buttonContainer.ParentOrigin = Position.ParentOriginTopLeft;
+ _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
+ //Preconditions
+ //Steps
+ //PostConditions
+ void CreateTestCase()
+ {
+ if (_detailList != null && _scrollableBase != null)
+ {
+ _detailView.Remove(_scrollableBase);
+ _scrollableBase.Remove(_detailList);
+ _detailList.Dispose();
+ _detailList = null;
+ _scrollableBase.Dispose();
+ _scrollableBase = null;
+ }
+ Tizen.Log.Fatal("NUI", "Print the CurrentTCNum here::" + _currentTCNum);
+ _scrollableBase = new ScrollableBase
+ {
+ Size = new Size(Window.Instance.Size.Width * 0.9739f, Window.Instance.Size.Height * 0.6629f),
+ ScrollingDirection = ScrollableBase.Direction.Vertical,
+ };
+ _detailList = new TableView(10, 1);
+ _detailList.Focusable = true;
+ _detailList.Size = new Size(Window.Instance.Size.Width * 0.9739f, Window.Instance.Size.Height * 0.9f);
+ _detailList.ParentOrigin = Position.ParentOriginTopLeft;
+ _detailList.PivotPoint = PivotPoint.TopLeft;
+ _detailList.Position = new Position(0.0f, 0.0f, 0.0f);
+ CreateDetailList();
+ _scrollableBase.Add(_detailList);
+ _detailView.Add(_scrollableBase);
+ if (_notRun)
+ {
+ _notRun.Text = _listItem[_currentTCNum].Result;
+ }
+ }
+
+ //Create all the function buttons here, such as PASS, FAIL.....
+ void CreateButtons()
+ {
+ _notRun = new TextLabel();
+ _notRun.HorizontalAlignment = HorizontalAlignment.Center;
+ _notRun.VerticalAlignment = VerticalAlignment.Center;
+ _notRun.PointSize = _pointSize;
+ _notRun.Text = "Not Run";
+ float buttonWidth = ManualTest.IsMobile() ? Window.Instance.Size.Width * 0.18f : Window.Instance.Size.Width * 0.06f;
+ _notRun.Size = new Size(buttonWidth, Window.Instance.Size.Height * 0.046f);
+
+ _passButton = new Button();
+ SetCommonButtonStyle(_passButton, "Pass");
+ _passButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.PASS;
+ ManualTest.Confirm();
+ }
+ Tizen.Log.Fatal("TBT", "Pass Button clicked!");
+ };
+
+ _failButton = new Button();
+ SetCommonButtonStyle(_failButton, "Fail");
+ _failButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.FAIL;
+ ManualTest.Confirm();
+ }
+ Tizen.Log.Fatal("TBT", "Fail Button clicked!");
+ };
+
+ _blockButton = new Button();
+ SetCommonButtonStyle(_blockButton, "Block");
+ _blockButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.BLOCK;
+ ManualTest.Confirm();
+ }
+ };
+
+ _runButton = new Button();
+ SetCommonButtonStyle(_runButton, "Run");
+ _runButton.Clicked += (obj, ee) =>
+ {
+ LockUIButton();
+ Clear();
+ //should update the _caseView by the test case
+ _tsettings.Testcase_ID = _tcIDList[_currentTCNum];
+ _tsettings.TCResult = "";
+ _tRunner.Execute();
+ };
+
+ _homeButton = new Button();
+ SetCommonButtonStyle(_homeButton, "Home");
+ _homeButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.NOTRUN;
+ ManualTest.Confirm();
+ }
+ else
+ {
+ _detailView.Hide();
+ _initView.Show();
+ FocusManager.Instance.SetCurrentFocusView(_run);
+ }
+ };
+
+ _preButton = new Button();
+ SetCommonButtonStyle(_preButton, "<<");
+ _preButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.NOTRUN;
+ ManualTest.Confirm();
+ }
+ else
+ {
+ if (_currentTCNum != 0)
+ {
+ _currentTCNum--;
+ _notRun.Text = _listItem[_currentTCNum].Result;
+ ManualTest.Confirm();
+ UpdateDetailPage();
+ }
+ else if (_currentTCNum == 0)
+ {
+ _toastMessage.Message = "This is first testcase";
+ _toastMessage.Post();
+ }
+ }
+ };
+
+ _nextButton = new Button();
+ SetCommonButtonStyle(_nextButton, ">>");
+ _nextButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.NOTRUN;
+ ManualTest.Confirm();
+ }
+ if (_currentTCNum + 1 != ResultNumber.Total)
+ {
+ Tizen.Log.Fatal("NUI", "Print the [not run] CurrentTCNum::" + _currentTCNum);
+ _currentTCNum++;
+ _notRun.Text = _listItem[_currentTCNum].Result;
+ UpdateDetailPage();
+ }
+ else if (_currentTCNum + 1 == ResultNumber.Total)
+ {
+ _toastMessage.Message = "This is last testcase";
+ _toastMessage.Post();
+ }
+ };
+
+ _passButton.RightFocusableView = _failButton;
+ _passButton.DownFocusableView = _homeButton;
+ _failButton.LeftFocusableView = _passButton;
+ _failButton.RightFocusableView = _blockButton;
+ _blockButton.LeftFocusableView = _failButton;
+ _blockButton.RightFocusableView = _runButton;
+ _blockButton.DownFocusableView = _preButton;
+ _runButton.LeftFocusableView = _blockButton;
+ _runButton.DownFocusableView = _nextButton;
+ _homeButton.UpFocusableView = _passButton;
+ _homeButton.RightFocusableView = _preButton;
+ _preButton.UpFocusableView = _blockButton;
+ _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", "Execute the manual test case!");
+
+ _caseView = view;
+ _caseView.ParentOrigin = Position.ParentOriginTopLeft;
+ _caseView.PivotPoint = PivotPoint.TopLeft;
+ _caseView.Position = new Position(Window.Instance.Size.Width * 0.01f, Window.Instance.Size.Height * 0.74f, 0.0f);
+ _detailView.Add(_caseView);
+ _caseView.Show();
+ FocusManager.Instance.SetCurrentFocusView(_caseView);
+ }
+
+ private bool OnKeyPressed(object source, View.KeyEventArgs e)
+ {
+ Tizen.Log.Fatal("NUI", "CaseView OnKeyPressed 1 Down..." + e.Key.KeyPressedName);
+
+ if (e.Key.State == Key.StateType.Down)
+ {
+ if (e.Key.KeyPressedName == "Down")
+ {
+ FocusManager.Instance.SetCurrentFocusView(_passButton);
+
+ }
+ }
+ return false;
+ }
+
+ private bool OnRunnerKeyPressed(object source, View.KeyEventArgs e)
+ {
+ Tizen.Log.Fatal("NUI", "Runner OnKeyPressed Down..." + e.Key.KeyPressedName);
+
+ if (e.Key.State == Key.StateType.Down)
+ {
+ if (e.Key.KeyPressedName == "Up")
+ {
+ Tizen.Log.Fatal("NUI", "Set current focus view :: doneButton");
+ FocusManager.Instance.SetCurrentFocusView(_doneButton);
+ }
+ }
+ return false;
+ }
+
+ private bool OnDownButtonKeyPressed(object source, View.KeyEventArgs e)
+ {
+ Tizen.Log.Fatal("NUI", "DownButton OnKeyPressed Down..." + e.Key.KeyPressedName);
+
+ if (e.Key.State == Key.StateType.Down)
+ {
+ if (e.Key.KeyPressedName == "Down")
+ {
+ Tizen.Log.Fatal("NUI", "Set current focus view :: run");
+ FocusManager.Instance.SetCurrentFocusView(_run);
+ }
+ }
+ return false;
+ }
+
+ private void Clear()
+ {
+ if (_caseView.IsOnWindow == true)
+ {
+ _detailView.Remove(_caseView);
+ }
+ }
+
+ public void ClearTestCase(View view)
+ {
+ FocusManager.Instance.SetCurrentFocusView(_runButton);
+ Tizen.Log.Fatal("NUI", "Clear test case!");
+ _detailView.Remove(view);
+ }
+
+ //Use to update the _summaryLabel.
+ private void SetSummaryResult()
+ {
+ ResultNumber.NotRun = ResultNumber.Total - ResultNumber.Pass - ResultNumber.Fail - ResultNumber.Block;
+ _summaryLabel.Text = "Total : " + ResultNumber.Total + ", Pass : " + ResultNumber.Pass + ", Fail : " + ResultNumber.Fail + ", Block : " + ResultNumber.Block + ", Not Run : " + ResultNumber.NotRun;
+ }
+
+ private void CreateDetailList()
+ {
+ Tizen.Log.Fatal("NUI", "Print the CreateDetailList::");
+ 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 * 0.9895), (int)(Window.Instance.Size.Height * 0.0462));
+ description.HorizontalAlignment = HorizontalAlignment.Begin;
+ description.PointSize = _pointSize;
+ description.Text = _currentTCInfo[(int)index];
+ description.MultiLine = true;
+ _detailList.AddChild(description, new TableView.CellPosition((uint)index, 0));
+ _detailList.SetFixedHeight((uint)index, Window.Instance.Size.Height * 0.0462f);
+ }
+ }
+
+ //Init all the data, should be offered by Test Framework
+ void InitData()
+ {
+ ResultNumber.Total = _tcIDList.Count;
+ ResultNumber.Pass = 0;
+ ResultNumber.Fail = 0;
+ ResultNumber.Block = 0;
+ _tcInfoList = new List<TestcaseInfo>();
+ foreach (var testcaseItem in _listItem)
+ {
+ foreach (KeyValuePair<string, ITest> pair in _tRunner.GetTestList())
+ {
+ if (testcaseItem.TCName.Equals(pair.Key))
+ {
+ IEnumerator<CustomAttributeData> customAttributes = pair.Value.Method.MethodInfo.CustomAttributes.GetEnumerator();
+ List<string> preconditions = new List<string>();
+ preconditions.Add("Preconditions:");
+ List<string> steps = new List<string>();
+ steps.Add("Steps:");
+ List<string> postconditions = new List<string>();
+ postconditions.Add("Postconditions:\n");
+
+ while (customAttributes.MoveNext())
+ {
+ if (customAttributes.Current.AttributeType.FullName.Equals(STEP_ATTRIBUTE_NAME))
+ {
+ steps.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
+ }
+ else if (customAttributes.Current.AttributeType.FullName.Equals(PRECONDITION_ATTRIBUTE_NAME))
+ {
+ preconditions.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
+ }
+ else if (customAttributes.Current.AttributeType.FullName.Equals(POSTCONDITION_ATTRIBUTE_NAME))
+ {
+ postconditions.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
+ }
+ }
+
+ _tcInfoList.Add(new TestcaseInfo
+ {
+ TestcaseName = pair.Key,
+ Preconditions = preconditions,
+ Steps = steps,
+ Postconditions = postconditions,
+ });
+ break;
+ }
+ }
+ }
+ UpdateCurrentTCInfo();
+ }
+
+ //The data in CurrentTCInfo list will be show in _detailList.
+ void UpdateCurrentTCInfo()
+ {
+ _currentTCInfo = new List<string>();
+ Tizen.Log.Fatal("NUI.Components", "Print the CurrentTCNum::" + _currentTCNum);
+ _currentTCInfo.Add("DESCRIPTION:#" + (_currentTCNum + 1));
+ string[] str = _tcInfoList[_currentTCNum].TestcaseName.Split('.');
+ _currentTCInfo.Add("CLASS:" + str[str.Length - 2]);
+ _currentTCInfo.Add("METHOD:" + str[str.Length - 1]);
+ for (int index = 0; index < _tcInfoList[_currentTCNum].Preconditions.Count; index++)
+ {
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Preconditions[index]);
+ }
+ for (int index = 0; index < _tcInfoList[_currentTCNum].Steps.Count; index++)
+ {
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Steps[index]);
+ }
+ for (int index = 0; index < _tcInfoList[_currentTCNum].Postconditions.Count; index++)
+ {
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Postconditions[index]);
+ }
+ Tizen.Log.Fatal("NUI", "The CurrentTCNum::" + _currentTCNum);
+ }
+
+ private void OnSingleTestDone(object sender, SingleTestDoneEventArgs e)
+ {
+ //Test when will this event will be triggered
+ Tizen.Log.Fatal("NUI", "OnSingleTestDone has been triggered!");
+ // check old result
+ if (_listItem[_currentTCNum].Result.Contains(StrResult.FAIL))
+ {
+ ResultNumber.Fail = ResultNumber.Fail - 1;
+ }
+ else if (_listItem[_currentTCNum].Result.Contains(StrResult.PASS))
+ {
+ ResultNumber.Pass = ResultNumber.Pass - 1;
+ }
+ else if (_listItem[_currentTCNum].Result.Contains(StrResult.BLOCK))
+ ResultNumber.Block = ResultNumber.Block - 1;
+
+ // Update new result
+ _listItem[_currentTCNum].Result = e.Result;
+ if (e.Result.Contains(StrResult.PASS))
+ {
+ ResultNumber.Pass += 1;
+ }
+ else if (e.Result.Contains(StrResult.FAIL))
+ {
+ ResultNumber.Fail += 1;
+ }
+ else if (e.Result.Contains(StrResult.BLOCK))
+ {
+ ResultNumber.Block += 1;
+ }
+
+ FlexibleViewViewHolder holder = _initList?.FindViewHolderForAdapterPosition(_currentTCNum);
+ if (holder != null)
+ {
+ string testcaseName = "#." + (_currentTCNum + 1).ToString() + _tcIDList[_currentTCNum];
+ string resultText = "[" + _listItem[(int)_currentTCNum].Result + "]";
+ string text = testcaseName + resultText;
+ Button btn = holder.ItemView as Button;
+ btn.Text = text;
+ _adapter?.UpdateItemData(_currentTCNum, _listItem);
+ }
+
+ SetSummaryResult();
+ _notRun.Text = _listItem[_currentTCNum].Result;
+ }
+ }
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+using System;
+using NUnitLite.TUnit;
+using Tizen.NUI;
+
+namespace Tizen.NUI.Tests
+{
+
+ public class App : Tizen.NUI.NUIApplication
+ {
+ protected override void OnCreate()
+ {
+ Window window = Window.Instance;
+ if(ManualTest.IsWearable())
+ {
+ WearableManualTestNUI.GetInstance();
+ }
+ else
+ {
+ ManualTestNUI.GetInstance();
+ }
+ }
+
+ static void Main(string[] args)
+ {
+ Tizen.Log.Fatal("NUI", "Manual TCT for NUI start!");
+ App example = new App();
+ example.Run(args);
+ }
+ };
+
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <!-- Property Group for .NET Core Project -->
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>tizen11.0</TargetFramework>
+ <TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
+ </PropertyGroup>
+
+ <!-- Property Group for Tizen Project -->
+ <PropertyGroup>
+ <TizenCreateTpkOnBuild>true</TizenCreateTpkOnBuild>
+ </PropertyGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>portable</DebugType>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>None</DebugType>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Folder Include="lib\" />
+ </ItemGroup>
+
+ <Import Project="..\Common\dependencies.props" />
+
+ <ItemGroup>
+ <PackageReference Include="Tizen.NET" Version="11.0.0.17857">
+ <ExcludeAssets>Runtime</ExcludeAssets>
+ </PackageReference>
+ <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
+ </ItemGroup>
+
+ <!-- Include Nuget Package for Tizen Project building -->
+ <ItemGroup>
+ <ProjectReference Include="..\nunit.framework\nunit.framework.csproj" />
+ <ProjectReference Include="..\nunitlite\nunitlite.csproj" />
+ </ItemGroup>
+
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>./NuiTest.snk</AssemblyOriginatorKeyFile>
+ <PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
+ <!--<XFKeepXamlResources>true</XFKeepXamlResources>-->
+ <Version>1.0.0</Version>
+ </PropertyGroup>
+</Project>
--- /dev/null
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29905.134
+MinimumVisualStudioVersion = 15.0.26124.0
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.Devel.Manual.Tests", "Tizen.NUI.Devel.Manual.Tests.csproj", "{66D8A33C-59A0-4F95-86BB-D4B98DB350B8}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{8537EA70-6272-4CCD-BCD4-EA8678519A42}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{F125594F-E09F-4444-8DD7-ACAE72830C55}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Debug|x64.Build.0 = Debug|Any CPU
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Debug|x86.Build.0 = Debug|Any CPU
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Release|x64.ActiveCfg = Release|Any CPU
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Release|x64.Build.0 = Release|Any CPU
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Release|x86.ActiveCfg = Release|Any CPU
+ {66D8A33C-59A0-4F95-86BB-D4B98DB350B8}.Release|x86.Build.0 = Release|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Debug|x64.Build.0 = Debug|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Debug|x86.Build.0 = Debug|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Release|x64.ActiveCfg = Release|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Release|x64.Build.0 = Release|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Release|x86.ActiveCfg = Release|Any CPU
+ {8537EA70-6272-4CCD-BCD4-EA8678519A42}.Release|x86.Build.0 = Release|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Debug|x64.Build.0 = Debug|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Debug|x86.Build.0 = Debug|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Release|x64.ActiveCfg = Release|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Release|x64.Build.0 = Release|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Release|x86.ActiveCfg = Release|Any CPU
+ {F125594F-E09F-4444-8DD7-ACAE72830C55}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {70518B32-7051-446F-9251-03D863BBD75E}
+ EndGlobalSection
+EndGlobal
--- /dev/null
+/*
+ * Copyright (c) 2016 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 System.Runtime.InteropServices;
+using System.Collections.Generic;
+using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI;
+using Tizen.NUI.Components;
+
+namespace Tizen.NUI.Tests
+{
+
+ public class ResultNumber
+ {
+ public static int Total { get; set; }
+ public static int Pass { get; set; }
+ public static int Fail { get; set; }
+ public static int NotRun { get; set; }
+ public static int Block { get; set; }
+ }
+
+ public class TestcaseInfo
+ {
+ private string _tescaseName;
+ public string TestcaseName
+ {
+ get
+ {
+ return _tescaseName;
+ }
+ set
+ {
+ _tescaseName = value;
+ }
+ }
+
+ private List<string> _preconditions;
+ public List<string> Preconditions
+ {
+ get
+ {
+ return _preconditions;
+ }
+ set
+ {
+ _preconditions = value;
+ }
+ }
+
+ private List<string> _steps;
+ public List<string> Steps
+ {
+ get
+ {
+ return _steps;
+ }
+ set
+ {
+ _steps = value;
+ }
+ }
+
+ private List<string> _postconditions;
+ public List<string> Postconditions
+ {
+ get
+ {
+ return _postconditions;
+ }
+ set
+ {
+ _postconditions = value;
+ }
+ }
+ }
+ public class ItemData : INotifyPropertyChanged
+ {
+ public event PropertyChangedEventHandler PropertyChanged;
+ private void OnPropertyChanged(object sender, string propertyName)
+ {
+ if (this.PropertyChanged != null)
+ {
+ PropertyChanged(sender, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ public int No { get; set; }
+
+ public string TCName { get; set; }
+
+ private string _result;
+ public string Result
+ {
+ get
+ {
+ return _result;
+ }
+ set
+ {
+ _result = value;
+ if (_result.Equals(StrResult.PASS))
+ {
+ ResultColor = Color.Green;
+ }
+ else if (_result.Equals(StrResult.FAIL))
+ {
+ ResultColor = Color.Red;
+ }
+ else if (_result.Equals(StrResult.BLOCK))
+ {
+ ResultColor = Color.Red;
+ }
+ else
+ {
+ ResultColor = Color.Black;
+ }
+ OnPropertyChanged(this, "Result");
+ }
+ }
+
+ private Color _resultColor;
+ public Color ResultColor
+ {
+ get { return _resultColor; }
+ set
+ {
+ _resultColor = value;
+ OnPropertyChanged(this, "ResultColor");
+ }
+ }
+ }
+
+ public class StrResult
+ {
+ public static string PASS = "PASS";
+ public static string FAIL = "FAIL";
+ public static string NOTRUN = "NOT RUN";
+ public static string BLOCK = "BLOCK";
+ }
+
+ public class RunType
+ {
+ public static string AUTO = "AUTO";
+ public static string MANUAL = "MANUAL";
+
+ public static string Value { get; set; }
+ }
+
+ public class ManualTest
+ {
+ private static bool Confirmed = true;
+
+ public static async Task WaitForConfirm()
+ {
+ Confirmed = false;
+ //ManualTestNUI.GetInstance().UnlockUIButton();
+
+ while (true)
+ {
+ await Task.Delay(200);
+ if (Confirmed)
+ break;
+ }
+
+ if (ManualTest.IsWearable())
+ {
+ WearableManualTestNUI.GetInstance().UnlockUIButton();
+ }
+ else
+ {
+ ManualTestNUI.GetInstance().UnlockUIButton();
+ }
+ }
+
+ public static bool IsConfirmed()
+ {
+ return Confirmed;
+ }
+
+ public static void Confirm()
+ {
+ Confirmed = true;
+ }
+
+ public static bool IsMobile()
+ {
+ string value;
+ var result = Tizen.System.Information.TryGetValue("tizen.org/feature/profile", out value);
+ if (result && value.Equals("mobile"))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsWearable()
+ {
+ string value;
+ var result = Tizen.System.Information.TryGetValue("tizen.org/feature/profile", out value);
+ if (result && value.Equals("wearable"))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsEmulator()
+ {
+ string value;
+ var result = Tizen.System.Information.TryGetValue("tizen.org/system/model_name", out value);
+ if (result && value.Equals("Emulator"))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static float GetPointSize()
+ {
+ float retValue = 10.0f; //default
+ string value;
+ Tizen.System.Information.TryGetValue("tizen.org/feature/profile", out value);
+ switch (value)
+ {
+ case "wearable":
+ retValue = 4.0f;
+ break;
+ case "mobile":
+ retValue = 5.0f;
+ break;
+ case "tv":
+ retValue = 20.0f;
+ break;
+ }
+ return retValue;
+ }
+
+ public static TextLabel CreateLabel(string information)
+ {
+ TextLabel mLabel = new TextLabel();
+ mLabel.TextColor = Color.White;
+ mLabel.PointSize = 4.0f;
+ mLabel.VerticalAlignment = VerticalAlignment.Center;
+ mLabel.HorizontalAlignment = HorizontalAlignment.Begin;
+ mLabel.MultiLine = true;
+ mLabel.Text = information;
+ mLabel.Size2D = new Size2D(300, 50);
+ return mLabel;
+ }
+ }
+
+ enum NavigationButton
+ {
+ Next,
+ Previous,
+ Home,
+ NA
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2020 Samsung Electronics Co., Ltd.
+*
+* 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.Runtime.InteropServices;
+using System.Collections.Generic;
+using NUnitLite.TUnit;
+using NUnit.Framework.Interfaces;
+using NUnit.Framework.TUnit;
+using System.Reflection;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+
+namespace Tizen.NUI.Tests
+{
+ class WearableManualTestNUI
+ {
+ class ListBridge : FlexibleViewAdapter
+ {
+ private List<string> _mDatas;
+ private List<ItemData> _mlistItem;
+
+ public ListBridge(List<string> datas, List<ItemData> item)
+ {
+ _mDatas = datas;
+ _mlistItem = item;
+ }
+
+ public void UpdateItemData(int position, List<ItemData> item)
+ {
+ _mlistItem = item;
+ }
+
+ public override FlexibleViewViewHolder OnCreateViewHolder(int viewType)
+ {
+ FlexibleViewViewHolder viewHolder = new FlexibleViewViewHolder(new Button(new ButtonStyle()));
+ return viewHolder;
+ }
+
+ public override void OnBindViewHolder(FlexibleViewViewHolder 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.TextColor = Color.White;
+ btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";
+ btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
+ }
+ }
+
+ public override void OnDestroyViewHolder(FlexibleViewViewHolder holder)
+ {
+ if (holder.ItemView != null)
+ {
+ holder.ItemView.Dispose();
+ }
+ }
+
+ public override int GetItemCount()
+ {
+ return _mDatas.Count;
+ }
+ }
+
+ class DetailListBridge : FlexibleViewAdapter
+ {
+ private List<string> _mDatas;
+
+ public DetailListBridge(List<string> datas)
+ {
+ _mDatas = datas;
+ }
+
+ public override FlexibleViewViewHolder OnCreateViewHolder(int viewType)
+ {
+ FlexibleViewViewHolder viewHolder = new FlexibleViewViewHolder(new TextLabel());
+ return viewHolder;
+ }
+
+ public override void OnBindViewHolder(FlexibleViewViewHolder 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(FlexibleViewViewHolder holder)
+ {
+ if (holder.ItemView != null)
+ {
+ holder.ItemView.Dispose();
+ }
+ }
+
+ public override int GetItemCount()
+ {
+ return _mDatas.Count;
+ }
+ }
+
+ private List<string> _tcIDList;
+ private List<ItemData> _listItem;
+ private TSettings _tsettings;
+ private TRunner _tRunner;
+ private Button _passButton, _failButton, _blockButton, _homeButton, _preButton, _nextButton, _doneButton;
+ private TextLabel _notRun;
+ private const string STEP_ATTRIBUTE_NAME = "NUnit.Framework.StepAttribute";
+ private const string PRECONDITION_ATTRIBUTE_NAME = "NUnit.Framework.PreconditionAttribute";
+ private const string POSTCONDITION_ATTRIBUTE_NAME = "NUnit.Framework.PostconditionAttribute";
+ private List<string> _listNotPass;
+
+ //Save the information of every single test case
+ private List<TestcaseInfo> _tcInfoList;
+ private List<string> _currentTCInfo;
+
+ 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 FlexibleView _initList;
+ private ListBridge _adapter;
+ private FlexibleView _detailList;
+ private DetailListBridge _adapter_detail;
+ private View _caseView;
+ private Button _run;
+ private Button _runButton;
+
+ //Always save the current TC number;
+ private int _currentTCNum = 0;
+ private static int _detailScrollHeight = 60;
+
+ public static WearableManualTestNUI GetInstance()
+ {
+ lock (_lockObject)
+ {
+ if (_instance == null)
+ {
+ _instance = new WearableManualTestNUI();
+ }
+ }
+ return _instance;
+ }
+
+ private WearableManualTestNUI()
+ {
+ Initialize();
+ }
+ public void Initialize()
+ {
+ Window.Instance.BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 1.0f);
+ Tizen.Log.Fatal("NUI", "Initialize=========================================");
+ RunType.Value = RunType.MANUAL;
+ _tRunner = new TRunner();
+ _tRunner.LoadTestsuite();
+ _tRunner.SingleTestDone += OnSingleTestDone;
+ _listNotPass = new List<string>();
+ _tcIDList = new List<string>();
+ _listItem = new List<ItemData>();
+ _listNotPass = TSettings.GetInstance().GetNotPassListManual();
+ int count = 0;
+ foreach (var tc in _listNotPass)
+ {
+ _listItem.Add(new ItemData { No = count, TCName = tc, Result = StrResult.NOTRUN });
+ _tcIDList.Add(tc);
+ count++;
+ }
+ Tizen.Log.Fatal("NUI", "TCT : count:" + count.ToString());
+ foreach (String nameTc in _tcIDList)
+ {
+ 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;
+
+ _summaryLabel1 = new TextLabel();
+ _summaryLabel1.TextColor = Color.White;
+ _summaryLabel1.PointSize = 5.0f;
+ _summaryLabel1.Size2D = new Size2D(200, 30);
+ _summaryLabel1.ParentOrigin = ParentOrigin.TopLeft;
+ _summaryLabel1.PivotPoint = PivotPoint.TopLeft;
+ _summaryLabel1.Position = new Position(70, 12, 0);
+ _summaryLabel1.HorizontalAlignment = HorizontalAlignment.Center;
+ _summaryLabel1.VerticalAlignment = VerticalAlignment.Center;
+
+ _summaryLabel2 = new TextLabel();
+ _summaryLabel2.TextColor = Color.White;
+ _summaryLabel2.PointSize = 5.0f;
+ _summaryLabel2.Size2D = new Size2D(300, 30);
+ _summaryLabel2.ParentOrigin = ParentOrigin.TopLeft;
+ _summaryLabel2.PivotPoint = PivotPoint.TopLeft;
+ _summaryLabel2.Position = new Position(20, 33, 0);
+ _summaryLabel2.HorizontalAlignment = HorizontalAlignment.Center;
+ _summaryLabel2.VerticalAlignment = VerticalAlignment.Center;
+
+ SetSummaryResult();
+ Window.Instance.GetDefaultLayer().Add(_summaryLabel1);
+ Window.Instance.GetDefaultLayer().Add(_summaryLabel2);
+
+ _initView = new View();
+
+ _initView.Size2D = new Size2D((int)Window.Instance.Size.Width, 200);
+ _initView.ParentOrigin = ParentOrigin.TopLeft;
+ _initView.PivotPoint = PivotPoint.TopLeft;
+ _initView.Position = new Position(0.0f, 60.0f, 0.0f);
+ InitializeFirstPage();
+ _initView.Show();
+
+ _detailView = new View();
+ _detailView.Size2D = new Size2D((int)Window.Instance.Size.Width, (int)Window.Instance.Size.Height - 65);
+ _detailView.ParentOrigin = ParentOrigin.TopLeft;
+ _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);
+ }
+
+ void SetCommonButtonStyle(Button btn, string text)
+ {
+ if (!btn) return;
+ btn.Text = text;
+ btn.PointSize = 4.0f;
+ btn.TextColor = new Color(0, 0, 0, 1);
+ btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";
+ btn.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 Button(new ButtonStyle());
+ _doneButton.Position = new Position(0, 0);
+ _doneButton.Size = new Size(120, 60);
+ SetCommonButtonStyle(_doneButton, "Done");
+ _doneButton.Clicked += (obj, ee) =>
+ {
+ TSettings.GetInstance().SubmitManualResult();
+ };
+
+ _run = new Button(new ButtonStyle());
+ _run.Position2D = new Position2D(150, 0);
+ _run.Size = new Size(120, 60);
+ SetCommonButtonStyle(_run, "Runner");
+ _run.Clicked += (obj, ee) =>
+ {
+ Tizen.Log.Fatal("NUI", "Check all the test case from the first one.");
+ _currentTCNum = 0;
+ _initView.Hide();
+ _caseView.Hide();
+ UpdateDetailPage();
+ _detailView.Show();
+ };
+
+ CreateInitList();
+
+ _initView.Add(_doneButton);
+ _initView.Add(_run);
+ _initView.Add(_initList);
+ Tizen.Log.Fatal("NUI", "TCT : InitializeFirstPage:");
+ }
+
+ //Update the Test Page before you want to show it(Click Run/Pre/nect Button, or Click on item in the List).
+ void UpdateDetailPage()
+ {
+ UpdateCurrentTCInfo();
+ Tizen.Log.Fatal("NUI", "UpdateDetailPage::::::::::::::::::::::");
+ CreateTestCase();
+ }
+
+ void InitializeDetailPage()
+ {
+ _description = new TextLabel();
+ _description.TextColor = Color.White;
+ _description.PointSize = 3.0f;
+ _description.ParentOrigin = ParentOrigin.TopLeft;
+ _description.PivotPoint = PivotPoint.TopLeft;
+ _description.Size2D = new Size2D(200, 20);
+ _description.Position2D = new Position2D(50, 0);
+ _detailView.Add(_description);
+
+ CreateDetailList();
+ //To Place the function button, such as PASS, FAIL.....
+ CreateButtons();
+ }
+
+ //To show the detail information of the test case
+ //Preconditions
+ //Steps
+ //PostConditions
+ void CreateTestCase()
+ {
+ if(_detailList)
+ {
+ _detailView.Remove(_detailList);
+ _detailList.Dispose();
+ }
+ Tizen.Log.Fatal("NUI", "Print the CurrentTCNum here::" + _currentTCNum);
+ CreateDetailList();
+ if (_notRun)
+ {
+ _notRun.Text = _listItem[_currentTCNum].Result;
+ }
+ }
+ private TextLabel CreateTextLabel(string textStr, int left)
+ {
+ TextLabel text = new TextLabel();
+ text.TextColor = Color.White;
+ text.ParentOrigin = ParentOrigin.TopLeft;
+ text.PivotPoint = PivotPoint.TopLeft;
+ text.Text = textStr;
+ text.PointSize = 5.0f;
+ text.VerticalAlignment = VerticalAlignment.Bottom;
+ text.HorizontalAlignment = HorizontalAlignment.Center;
+ text.Size2D = new Size2D(30, 30);
+ text.Position2D = new Position2D(left, 0);
+ return text;
+ }
+ //Create all the function buttons here, such as PASS, FAIL.....
+ void CreateButtons()
+ {
+ _notRun = new TextLabel();
+ _notRun.TextColor = Color.White;
+ _notRun.Size = new Size(40, 30);
+ _notRun.PointSize = 2.5f;
+ _notRun.Position = new Position(100, 32);
+ _notRun.HorizontalAlignment = HorizontalAlignment.Center;
+ _notRun.VerticalAlignment = VerticalAlignment.Center;
+ _notRun.MultiLine = true;
+ _notRun.Text = "Not Run";
+ _passButton = new Button(new ButtonStyle());
+ SetCommonButtonStyle(_passButton, "P");
+ _passButton.Size = new Size(70, 30);
+ _passButton.Position = new Position(0, 0);
+ _passButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.PASS;
+ ManualTest.Confirm();
+ }
+ Tizen.Log.Fatal("TBT", "Pass Button clicked!");
+ };
+
+ _failButton = new Button(new ButtonStyle());
+ SetCommonButtonStyle(_failButton, "F");
+ _failButton.Size = new Size(70, 30);
+ _failButton.Position = new Position(72, 0);
+ _failButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.FAIL;
+ ManualTest.Confirm();
+ }
+ Tizen.Log.Fatal("TBT", "Fail Button clicked!");
+ };
+
+ _blockButton = new Button(new ButtonStyle());
+ SetCommonButtonStyle(_blockButton, "B");
+ _blockButton.Size = new Size(70, 30);
+ _blockButton.Position = new Position(144, 0);
+ _blockButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.BLOCK;
+ ManualTest.Confirm();
+ }
+ };
+
+ _runButton = new Button(new ButtonStyle());
+ SetCommonButtonStyle(_runButton, "R");
+ _runButton.Size = new Size(70, 30);
+ _runButton.Position = new Position(216, 0);
+ _runButton.Clicked += (obj, ee) =>
+ {
+ LockUIButton();
+ Clear();
+ _tsettings.Testcase_ID = _tcIDList[_currentTCNum];
+ _tsettings.TCResult = "";
+ _tRunner.Execute();
+ };
+
+ _homeButton = new Button(new ButtonStyle());
+ SetCommonButtonStyle(_homeButton, "H");
+ _homeButton.Size = new Size(70, 30);
+ _homeButton.Position = new Position(0, 32);
+ _homeButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.NOTRUN;
+ ManualTest.Confirm();
+ }
+ else
+ {
+ _detailView.Hide();
+ _initView.Show();
+ }
+ };
+
+ _preButton = new Button(new ButtonStyle());
+ SetCommonButtonStyle(_preButton, "<<");
+ _preButton.Size = new Size(60, 30);
+ _preButton.Position = new Position(160, 32);
+ _preButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.NOTRUN;
+ ManualTest.Confirm();
+ }
+ else
+ {
+ if (_currentTCNum != 0)
+ {
+ _currentTCNum--;
+ _notRun.Text = _listItem[_currentTCNum].Result;
+ ManualTest.Confirm();
+ UpdateDetailPage();
+ }
+ }
+ };
+
+ _nextButton = new Button(new ButtonStyle());
+ SetCommonButtonStyle(_nextButton, ">>");
+ _nextButton.Size = new Size(60, 30);
+ _nextButton.Position = new Position(222, 32);
+ _nextButton.Clicked += (obj, ee) =>
+ {
+ Clear();
+ if (!ManualTest.IsConfirmed())
+ {
+ _tsettings.TCResult = StrResult.NOTRUN;
+ ManualTest.Confirm();
+ }
+ if (_currentTCNum + 1 != ResultNumber.Total)
+ {
+ Tizen.Log.Fatal("NUI", "Print the [not run] CurrentTCNum::" + _currentTCNum);
+ _currentTCNum++;
+ _notRun.Text = _listItem[_currentTCNum].Result;
+ UpdateDetailPage();
+ }
+ };
+
+ View buttonView = new View();
+ buttonView.ParentOrigin = ParentOrigin.TopLeft;
+ buttonView.PivotPoint = PivotPoint.TopLeft;
+ buttonView.Size2D = new Size2D(Window.Instance.Size.Width, 80);
+ buttonView.Position2D = new Position2D(30, 170);
+
+ 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);
+ }
+
+ public void ExecuteTC(View view)
+ {
+ Tizen.Log.Fatal("ManualTCT", "Execute the manual test case!");
+
+ _caseView = view;
+ _caseView.ParentOrigin = Position.ParentOriginTopLeft;
+ _caseView.PivotPoint = PivotPoint.TopLeft;
+ _caseView.Position = new Position(40.0f, 120.0f, 0.0f);
+ _detailView.Add(_caseView);
+ _caseView.Show();
+ }
+
+ private void Clear()
+ {
+ if (_caseView.IsOnWindow == true)
+ {
+ _detailView.Remove(_caseView);
+ }
+ }
+
+ public void ClearTestCase(View view)
+ {
+ Tizen.Log.Fatal("NUI", "Clear test case!");
+ _detailView.Remove(view);
+ }
+
+ //Use to update the _summaryLabel.
+ private void SetSummaryResult()
+ {
+ ResultNumber.NotRun = ResultNumber.Total - ResultNumber.Pass - ResultNumber.Fail - ResultNumber.Block;
+ _summaryLabel1.Text = "T : " + ResultNumber.Total + ", P : " + ResultNumber.Pass;
+ _summaryLabel2.Text = "F : " + ResultNumber.Fail + ", B : " + ResultNumber.Block + ", NR: " + ResultNumber.NotRun;
+ Tizen.Log.Fatal("ManualTCT", "Set the result Text");
+ }
+
+ private void CreateInitList()
+ {
+ 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.ItemClicked += (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", "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
+ void InitData()
+ {
+ ResultNumber.Total = _tcIDList.Count;
+ ResultNumber.Pass = 0;
+ ResultNumber.Fail = 0;
+ ResultNumber.Block = 0;
+ _tcInfoList = new List<TestcaseInfo>();
+ foreach (var testcaseItem in _listItem)
+ {
+ foreach (KeyValuePair<string, ITest> pair in _tRunner.GetTestList())
+ {
+ if (testcaseItem.TCName.Equals(pair.Key))
+ {
+ List<string> preconditions = new List<string>();
+ preconditions.Add("Preconditions:");
+ List<string> steps = new List<string>();
+ steps.Add("Steps:");
+ List<string> postconditions = new List<string>();
+ postconditions.Add("Postconditions:\n");
+ IEnumerator<CustomAttributeData> customAttributes = pair.Value.Method.MethodInfo.CustomAttributes.GetEnumerator();
+ while (customAttributes.MoveNext())
+ {
+ if (customAttributes.Current.AttributeType.FullName.Equals(STEP_ATTRIBUTE_NAME))
+ {
+ steps.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
+ }
+ else if (customAttributes.Current.AttributeType.FullName.Equals(PRECONDITION_ATTRIBUTE_NAME))
+ {
+ preconditions.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
+ }
+ else if (customAttributes.Current.AttributeType.FullName.Equals(POSTCONDITION_ATTRIBUTE_NAME))
+ {
+ postconditions.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
+ }
+ }
+ _tcInfoList.Add(new TestcaseInfo
+ {
+ TestcaseName = pair.Key,
+ Preconditions = preconditions,
+ Steps = steps,
+ Postconditions = postconditions,
+ });
+ break;
+ }
+ }
+ UpdateCurrentTCInfo();
+ }
+ }
+
+ //The data in CurrentTCInfo list will be show in _detailList.
+ void UpdateCurrentTCInfo()
+ {
+ _currentTCInfo = new List<string>();
+ Tizen.Log.Fatal("NUI", "Print the CurrentTCNum::" + _currentTCNum);
+ _currentTCInfo.Add("DESCRIPTION:#" + (_currentTCNum + 1));
+ string[] str = _tcInfoList[_currentTCNum].TestcaseName.Split('.');
+ _currentTCInfo.Add("CLASS:" + str[str.Length - 2]);
+ _currentTCInfo.Add("METHOD:" + str[str.Length - 1]);
+ for(int index = 0; index < _tcInfoList[_currentTCNum].Preconditions.Count; index++)
+ {
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Preconditions[index]);
+ }
+ for(int index = 0; index < _tcInfoList[_currentTCNum].Steps.Count; index++ )
+ {
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Steps[index]);
+ }
+ for(int index = 0; index < _tcInfoList[_currentTCNum].Postconditions.Count; index++ )
+ {
+ _currentTCInfo.Add(_tcInfoList[_currentTCNum].Postconditions[index]);
+ }
+ Tizen.Log.Fatal("NUI", "the CurrentTCNum::" + _currentTCNum);
+ }
+
+ private void OnSingleTestDone(object sender, SingleTestDoneEventArgs e)
+ {
+ //Test when will this event will be triggered
+ Tizen.Log.Fatal("NUI", "OnSingleTestDone has been triggered!");
+ // check old result
+ if (_listItem[_currentTCNum].Result.Contains(StrResult.FAIL))
+ {
+ ResultNumber.Fail = ResultNumber.Fail - 1;
+ }
+ else if (_listItem[_currentTCNum].Result.Contains(StrResult.PASS))
+ {
+ ResultNumber.Pass = ResultNumber.Pass - 1;
+ }
+ else if (_listItem[_currentTCNum].Result.Contains(StrResult.BLOCK))
+ ResultNumber.Block = ResultNumber.Block - 1;
+
+ // Update new result
+ _listItem[_currentTCNum].Result = e.Result;
+ if (e.Result.Contains(StrResult.PASS))
+ {
+ ResultNumber.Pass += 1;
+ }
+ else if (e.Result.Contains(StrResult.FAIL))
+ {
+ ResultNumber.Fail += 1;
+ }
+ else if (e.Result.Contains(StrResult.BLOCK))
+ {
+ ResultNumber.Block += 1;
+ }
+
+ FlexibleViewViewHolder 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;
+ }
+
+ public void LockUIButton()
+ {
+ _runButton.IsEnabled = false;
+ }
+
+ public void UnlockUIButton()
+ {
+ _runButton.IsEnabled = true;
+ }
+ }
+}
+
--- /dev/null
+<html>
+<head>
+ <title>Testing Context Menu</title>
+ <style>
+ body {
+ text-align: center;
+ }
+ </style>
+</head>
+<body>
+ <h2>Context Menu Test Page</h2>
+ <p>Please <b>right click</b> below image.</p>
+ <img src="tizen.png" alt="Test image">
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Title of the document</title>
+ </head>
+ <body>
+ <h1>Heading </h1>
+ <p>This is photo</p>
+ <img src="./tizen.png" alt="tizen" width="150" height="150"/>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function openWin() {
+ window.open("about:blank");
+}
+</script>
+</head>
+<body>
+
+<form>
+ <input type="button" value="Open Window" onclick="openWin()">
+</form>
+
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html>
+<body>
+
+ <h1>Display a Password Field</h1>
+
+ <form action="/action_page.php">
+ <label for="email">Email:</label>
+ <input type="email" id="email" name="email" value="test@test.com"><br><br>
+ <label for="pwd">Password:</label>
+ <input type="password" id="pwd" name="pwd" minlength="6" value="password"><br><br>
+ <input type="submit">
+ </form>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<title>Page Title</title>
+</head>
+<body>
+
+<h1>This is a testing page for scrolling to bottom edge</h1>
+<p>Please scroll to bottom!</p>
+<br />
+<br />
+<br />
+<p>Please continue to scroll to bottom!</p>
+<br />
+<br />
+<br />
+<br />
+<br />
+<br />
+<p>Please continue to scroll to bottom!</p>
+<br />
+<br />
+<br />
+<br />
+<br />
+<p>Please continue to scroll to bottom!</p>
+<br />
+<br />
+<br />
+<br />
+<br />
+<br />
+<br />
+<p>Please continue to scroll to bottom!</p>
+<br />
+<br />
+<br />
+<br />
+<br />
+<br />
+<br />
+<br />
+<p>You have scrolled to bottom edge!</p>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+using System;
+using System.Threading.Tasks;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.View test")]
+ public class WebViewTests
+ {
+ private const string tag = "NUITEST";
+ private WearableManualTestNUI _wearTestPage;
+ private TextLabel _label;
+
+ private BaseComponents.WebView _webView = null;
+ private Window _window = null;
+ private string url = $"file://{Tizen.Applications.Application.Current.DirectoryInfo.Resource}webview/index.html";
+ private string urlForContextMenu = $"file://{Tizen.Applications.Application.Current.DirectoryInfo.Resource}webview/contextmenu.html";
+ //private string urlForFormSubmit = $"file://{Tizen.Applications.Application.Current.DirectoryInfo.Resource}webview/webform.html";
+ private string urlForScrollEdge = $"file://{Tizen.Applications.Application.Current.DirectoryInfo.Resource}webview/webscrolledge.html";
+ private string urlForOpenWindow = $"file://{Tizen.Applications.Application.Current.DirectoryInfo.Resource}webview/openwindow.html";
+ private Button _menu = null;
+ private WebContextMenu _contextMenu;
+
+ [SetUp]
+ public void Init()
+ {
+ Log.Info(tag, "Preconditions for each TEST");
+ if (ManualTest.IsWearable())
+ {
+ _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!");
+ _wearTestPage = WearableManualTestNUI.GetInstance();
+ }
+ else
+ {
+ _webView = new BaseComponents.WebView()
+ {
+ Size = new Size(1920, 540),
+ ParentOrigin = ParentOrigin.Center,
+ PivotPoint = PivotPoint.Center,
+ PositionUsesPivotPoint = true,
+ };
+ _window = Window.Instance;
+ }
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Log.Info(tag, "Postconditions for each TEST, webview is being destroyed.");
+ _webView.Dispose();
+ Log.Info(tag, "Postconditions for each TEST");
+ }
+
+ private void OnContextMenuShown(object sender, WebViewContextMenuShownEventArgs e)
+ {
+ Log.Info(tag, "TUnit WebView.WebViewContextMenuShownEvent!!!!!!!!!!!!!!!!!!!!!");
+ ManualTest.Confirm();
+ }
+
+ private void OnMenuClicked(object sender, ClickedEventArgs e)
+ {
+ Log.Info(tag, "TUnit OnMenuClicked!!!!!!!!!!!!!!!!!!!!!");
+ _contextMenu.Hide();
+ }
+
+ private void OnContextMenuHidden(object sender, WebViewContextMenuHiddenEventArgs e)
+ {
+ Log.Info(tag, "TUnit WebView.WebViewContextMenuShownEvent!!!!!!!!!!!!!!!!!!!!!");
+ ManualTest.Confirm();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test: Handle event. Try to long-press to trigger the event.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.WebView.ContextMenuShown E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Precondition(1, "In case of Emulator, only use PC keyboard or remote controller of emulator itself.")]
+ [Precondition(2, "If test on TV, prepare mouse and connect to TV.")]
+ [Step(1, "Click to runt TC.")]
+ [Step(2, "Long press image of test page.")]
+ [Step(3, "If there is no exception, test will be automatically passed.")]
+ [Postcondition(1, "NA")]
+ public async Task ContextMenuShown_CB()
+ {
+ if (ManualTest.IsWearable())
+ {
+ _wearTestPage.ExecuteTC(_label);
+ await ManualTest.WaitForConfirm();
+ _wearTestPage.ClearTestCase(_label);
+ }
+ else
+ {
+ _window.GetDefaultLayer().Add(_webView);
+ FocusManager.Instance.SetCurrentFocusView(_webView);
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
+ {
+ Log.Info(tag, "onLoadFinished is called.");
+ tcs.TrySetResult(true);
+ };
+ Log.Info(tag, "onLoadFinished is called.");
+ _webView.PageLoadFinished += onLoadFinished;
+ _webView.ContextMenuShown += OnContextMenuShown;
+ Log.Info(tag, "onLoadFinished is called.");
+ _webView.LoadUrl(urlForContextMenu);
+
+ Log.Info(tag, "onLoadFinished is called.");
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "PageLoadFinished event should be invoked");
+
+ Log.Info(tag, "onLoadFinished is called.");
+
+ // Waits for user confirmation.
+ await ManualTest.WaitForConfirm();
+ _webView.PageLoadFinished -= onLoadFinished;
+ _webView.ContextMenuShown -= OnContextMenuShown;
+ _window.GetDefaultLayer().Remove(_webView);
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test: Handle event. Try to long-press to trigger the event.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.WebView.ContextMenuShown E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Precondition(1, "In case of Emulator, only use PC keyboard or remote controller of emulator itself.")]
+ [Precondition(2, "If test on TV, prepare mouse and connect to TV.")]
+ [Step(1, "Click to runt TC.")]
+ [Step(2, "Long press image of test page.")]
+ [Step(3, "If there is no exception, test will be automatically passed.")]
+ [Postcondition(1, "NA")]
+ public async Task ContextMenuHidden_CB()
+ {
+ if (ManualTest.IsWearable())
+ {
+ _wearTestPage.ExecuteTC(_label);
+ await ManualTest.WaitForConfirm();
+ _wearTestPage.ClearTestCase(_label);
+ }
+ else
+ {
+ _window.GetDefaultLayer().Add(_webView);
+ FocusManager.Instance.SetCurrentFocusView(_webView);
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
+ {
+ Log.Info(tag, "onLoadFinished is called.");
+ tcs.TrySetResult(true);
+ };
+ Log.Info(tag, "onLoadFinished is called.");
+ _webView.PageLoadFinished += onLoadFinished;
+
+ EventHandler<WebViewContextMenuShownEventArgs> onContextMenuShown = (s, e) =>
+ {
+ Log.Info(tag, "onContextMenuShown is called.");
+ if (_menu == null)
+ {
+ _menu = new Button();
+ _menu.Text = "Click here to trigger menu hide event.";
+ _menu.Feedback = false;
+ _menu.PointSize = 20.0f;
+ _menu.BackgroundColor = Color.Cyan;
+ _menu.Size = new Size(Window.Instance.Size.Width * 0.1f, Window.Instance.Size.Height * 0.05f);
+ _menu.Clicked += OnMenuClicked;
+ _window.GetDefaultLayer().Add(_menu);
+ }
+ _contextMenu = e.ContextMenu;
+ };
+ _webView.ContextMenuShown += onContextMenuShown;
+
+ _webView.ContextMenuHidden += OnContextMenuHidden;
+ Log.Info(tag, "onLoadFinished is called.");
+ _webView.LoadUrl(urlForContextMenu);
+
+ Log.Info(tag, "onLoadFinished is called.");
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "PageLoadFinished event should be invoked");
+
+ Log.Info(tag, "onLoadFinished is called.");
+
+ // Waits for user confirmation.
+ await ManualTest.WaitForConfirm();
+ _webView.PageLoadFinished -= onLoadFinished;
+ _webView.ContextMenuShown -= OnContextMenuShown;
+ _webView.ContextMenuHidden -= OnContextMenuHidden;
+ _window.GetDefaultLayer().Remove(_webView);
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test: Handle event. Try to sroll to edge to trigger the event.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.WebView.ScrollEdgeReached E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Precondition(1, "In case of Emulator, only use PC keyboard or remote controller of emulator itself.")]
+ [Precondition(2, "If test on TV, prepare mouse and connect to TV.")]
+ [Step(1, "Click to runt TC.")]
+ [Step(2, "Scroll testing page to edge.")]
+ [Step(3, "If there is no exception, test will be automatically passed.")]
+ [Postcondition(1, "NA")]
+ public async Task ScrollEdgeReached_CB()
+ {
+ if (ManualTest.IsWearable())
+ {
+ _wearTestPage.ExecuteTC(_label);
+ await ManualTest.WaitForConfirm();
+ _wearTestPage.ClearTestCase(_label);
+ }
+ else
+ {
+ _window.GetDefaultLayer().Add(_webView);
+ FocusManager.Instance.SetCurrentFocusView(_webView);
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
+ {
+ Log.Info(tag, "onLoadFinished is called.");
+ tcs.TrySetResult(true);
+ };
+ Log.Info(tag, "onLoadFinished is called.");
+ _webView.PageLoadFinished += onLoadFinished;
+
+ EventHandler<WebViewScrollEdgeReachedEventArgs> onScrollEdgeReached = (s, e) =>
+ {
+ Log.Info(tag, "TUnit WebView.ScrollEdgeReached!!!!!!!!!!!!!!!!!!!!!");
+ ManualTest.Confirm();
+ };
+ _webView.ScrollEdgeReached += onScrollEdgeReached;
+ Log.Info(tag, "onLoadFinished is called.");
+ _webView.LoadUrl(urlForScrollEdge);
+
+ Log.Info(tag, "onLoadFinished is called.");
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "PageLoadFinished event should be invoked");
+
+ Log.Info(tag, "onLoadFinished is called.");
+
+ // Waits for user confirmation.
+ await ManualTest.WaitForConfirm();
+ _webView.PageLoadFinished -= onLoadFinished;
+ _webView.ScrollEdgeReached -= onScrollEdgeReached;
+ _window.GetDefaultLayer().Remove(_webView);
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test: Handle event. Try to sroll to edge to trigger the event.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.WebView.NewWindowCreated E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Precondition(1, "In case of Emulator, only use PC keyboard or remote controller of emulator itself.")]
+ [Precondition(2, "If test on TV, prepare mouse and connect to TV.")]
+ [Step(1, "Click to runt TC.")]
+ [Step(2, "Click button to open new window.")]
+ [Step(3, "If there is no exception, test will be automatically passed.")]
+ [Postcondition(1, "NA")]
+ public async Task NewWindowCreated_CB()
+ {
+ if (ManualTest.IsWearable())
+ {
+ _wearTestPage.ExecuteTC(_label);
+ await ManualTest.WaitForConfirm();
+ _wearTestPage.ClearTestCase(_label);
+ }
+ else
+ {
+ _window.GetDefaultLayer().Add(_webView);
+ FocusManager.Instance.SetCurrentFocusView(_webView);
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
+ {
+ Log.Info(tag, "onLoadFinished is called.");
+ tcs.TrySetResult(true);
+ };
+ Log.Info(tag, "onLoadFinished is called.");
+ _webView.PageLoadFinished += onLoadFinished;
+
+ EventHandlerWithReturnType<object, EventArgs, BaseComponents.WebView> onNewWindowCreated = (s, e) =>
+ {
+ Log.Info(tag, "TUnit WebView.NewWindowCreated!!!!!!!!!!!!!!!!!!!!!");
+ ManualTest.Confirm();
+ return null;
+ };
+ _webView.NewWindowCreated += onNewWindowCreated;
+ Log.Info(tag, "onLoadFinished is called.");
+ _webView.LoadUrl(urlForOpenWindow);
+
+ Log.Info(tag, "onLoadFinished is called.");
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "PageLoadFinished event should be invoked");
+
+ Log.Info(tag, "onLoadFinished is called.");
+
+ // Waits for user confirmation.
+ await ManualTest.WaitForConfirm();
+ _webView.PageLoadFinished -= onLoadFinished;
+ _webView.NewWindowCreated -= onNewWindowCreated;
+ _window.GetDefaultLayer().Remove(_webView);
+ }
+ }
+
+ //TODO... FormRepostPolicyDecided event is very hard to be triggered. And this event is used rarely.
+ //[Test]
+ //[Category("P1")]
+ //[Description("Test: Handle event. Try to sroll to edge to trigger the event.")]
+ //[Property("SPEC", "Tizen.NUI.BaseComponents.WebView.FormRepostPolicyDecided E")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "EVL")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //[Precondition(1, "In case of Emulator, only use PC keyboard or remote controller of emulator itself.")]
+ //[Precondition(2, "If test on TV, prepare mouse and connect to TV.")]
+ //[Step(1, "Click to runt TC.")]
+ //[Step(2, "Click submit button.")]
+ //[Step(3, "Click submit button again to simulate form repost.")]
+ //[Step(4, "If there is no exception, test will be automatically passed.")]
+ //[Postcondition(1, "NA")]
+ //public async Task FormRepostPolicyDecided_CB()
+ //{
+ // if (ManualTest.IsWearable())
+ // {
+ // _wearTestPage.ExecuteTC(_label);
+ // await ManualTest.WaitForConfirm();
+ // _wearTestPage.ClearTestCase(_label);
+ // }
+ // else
+ // {
+ // _window.GetDefaultLayer().Add(_webView);
+ // FocusManager.Instance.SetCurrentFocusView(_webView);
+
+ // TaskCompletionSource<bool> tcs1 = new TaskCompletionSource<bool>(false);
+ // EventHandler<WebViewPageLoadEventArgs> onLoadFinished = async (s, e) =>
+ // {
+ // if (_webView.Url.Contains("index.html"))
+ // {
+ // tcs1.TrySetResult(true);
+ // }
+ // };
+ // Log.Info(tag, "onLoadFinished is called.");
+ // _webView.PageLoadFinished += onLoadFinished;
+
+ // EventHandler<WebViewFormRepostPolicyDecidedEventArgs> onFormRepostPolicyDecided = (s, e) =>
+ // {
+ // Log.Info(tag, "TUnit WebView.FormRepostPolicyDecided!!!!!!!!!!!!!!!!!!!!!");
+ // ManualTest.Confirm();
+ // };
+ // _webView.FormRepostPolicyDecided += onFormRepostPolicyDecided;
+ // EventHandlerWithReturnType<object, View.TouchEventArgs, bool> onTouched = (s, e) =>
+ // {
+ // // Load index.html.
+ // Log.Info(tag, "TUnit WebView.TouchEvent !!!!!!!!!!!!!!!!!!!!!");
+ // _webView.LoadUrl(url);
+ // return false;
+ // };
+ // _webView.TouchEvent += onTouched;
+ // Log.Info(tag, "onLoadFinished is called.");
+ // _webView.LoadUrl(urlForFormSubmit);
+
+ // Log.Info(tag, "onLoadFinished is called.");
+ // var result = await tcs1.Task;
+ // Assert.IsTrue(result, "PageLoadFinished event should be invoked");
+
+ // if (_webView.CanGoBack())
+ // {
+ // Log.Info(tag, $"GoBack is called. url: {_webView.Url}");
+ // _webView.GoBack();
+ // }
+
+ // _webView.PageLoadFinished -= onLoadFinished;
+
+ // // Waits for user confirmation.
+ // await ManualTest.WaitForConfirm();
+ // _webView.FormRepostPolicyDecided -= onFormRepostPolicyDecided;
+ // _window.GetDefaultLayer().Remove(_webView);
+ // }
+ //}
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="7.5" package="Tizen.NUI.Devel.Manual.Tests" version="1.0.0">
+ <profile name="common" />
+ <ui-application appid="Tizen.NUI.Devel.Manual.Tests"
+ exec="Tizen.NUI.Devel.Manual.Tests.dll"
+ type="dotnet"
+ multiple="false"
+ taskmanage="true"
+ launch_mode="single">
+ <icon>Tizen.NUI.Devel.Manual.Tests.png</icon>
+ <label>Tizen.NUI.Devel.Manual.Tests</label>
+ </ui-application>
+ <privileges>
+ <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+ <privilege>http://tizen.org/privilege/window.priority.set</privilege>
+ <privilege>http://tizen.org/privilege/filesystem.write</privilege>
+ <privilege>http://tizen.org/privilege/internet</privilege>
+ <privilege>http://tizen.org/privilege/mediastorage</privilege>
+ <privilege>http://tizen.org/privilege/externalstorage</privilege>
+ </privileges>
+</manifest>