From: nguyen.vtan Date: Wed, 6 Mar 2019 09:29:42 +0000 (+0700) Subject: [None-ACR] Fix issue for Tizen.PrivacyPrivilegeManager.Manual.Tests suite X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=799da10f3aa859dbe593080f34b5933901686d8a;p=test%2Ftct%2Fcsharp%2Fapi.git [None-ACR] Fix issue for Tizen.PrivacyPrivilegeManager.Manual.Tests suite Change-Id: I1d3a94cb991726da868ef29d3b5753920e56cfa4 --- diff --git a/tct-suite-vs/Template/ManualTemplate/TestPage.cs b/tct-suite-vs/Template/ManualTemplate/TestPage.cs index 8b46496d7..3f9cdcfaa 100755 --- a/tct-suite-vs/Template/ManualTemplate/TestPage.cs +++ b/tct-suite-vs/Template/ManualTemplate/TestPage.cs @@ -1,588 +1,595 @@ -/* - * 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.Collections.Generic; -using NUnitLite.TUnit; -using NUnit.Framework.TUnit; -using NUnit.Framework.Interfaces; -using System.Reflection; -using ManualTemplate; -using Xamarin.Forms; -using Tizen.Applications; - -namespace NUnit.Framework -{ - public class TestPage - { - private static TestPage instance; - private static Object lockObject = new object(); - - private NavigationPage _navigationPage; - private ContentPage _tcContentPage; - private Page _tcUIPage; - private Label _summaryLabel, _tcResultText, _descriptionTitle; - private ListView _tcDescriptions; - private Button _runBtn, _passBtn, _failBtn, _blockBtn; - private Button _mainBtn, _prevBtn, _nextBtn; - private StackLayout _mainLayout, _tcUILayout; - - private int _tcIndex = 0; - private List _tcIDList; - private List _listItem; - private List _tcInfoList; - private List _currentTCInfo; - private TRunner _tunitRunner; - private TSettings _tsettings; - private NavigationButton _pressButton = NavigationButton.NA; - private ToastMessage _toastMessage; - - 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"; - - public event EventHandler TestcaseDone; - - private void OnTestcaseDone(string e) - { - EventHandler handler = TestcaseDone; - if (handler != null) - { - handler(this, e); - } - } - - public NavigationPage getNavigationPage() - { - return _navigationPage; - } - - public static TestPage GetInstance() - { - lock (lockObject) - { - if (instance == null) - { - instance = new TestPage(); - } - } - return instance; - } - - private TestPage() - { - } - - public void Initialize(TRunner tunitRunner, List testcaseIDList, List listItem) - { - _toastMessage = new ToastMessage(); - RunType.Value = RunType.MANUAL; - _tunitRunner = tunitRunner; - _tunitRunner.SingleTestDone += OnSingleTestDone; - _tcInfoList = new List(); - _tcIDList = testcaseIDList; - _tsettings = TSettings.GetInstance(); - _tsettings.IsManual = true; +/* + * 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.Collections.Generic; +using NUnitLite.TUnit; +using NUnit.Framework.TUnit; +using NUnit.Framework.Interfaces; +using System.Reflection; +using ManualTemplate; +using Xamarin.Forms; +using Tizen.Applications; + +namespace NUnit.Framework +{ + public class TestPage + { + private static TestPage instance; + private static Object lockObject = new object(); + + private NavigationPage _navigationPage; + private ContentPage _tcContentPage; + private Page _tcUIPage; + private Label _summaryLabel, _tcResultText, _descriptionTitle; + private ListView _tcDescriptions; + private Button _runBtn, _passBtn, _failBtn, _blockBtn; + private Button _mainBtn, _prevBtn, _nextBtn; + private StackLayout _mainLayout, _tcUILayout; + + private int _tcIndex = 0; + private List _tcIDList; + private List _listItem; + private List _tcInfoList; + private List _currentTCInfo; + private TRunner _tunitRunner; + private TSettings _tsettings; + private NavigationButton _pressButton = NavigationButton.NA; + private ToastMessage _toastMessage; + + 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"; + + public event EventHandler TestcaseDone; + + private void OnTestcaseDone(string e) + { + EventHandler handler = TestcaseDone; + if (handler != null) + { + handler(this, e); + } + } + + public NavigationPage getNavigationPage() + { + return _navigationPage; + } + + public static TestPage GetInstance() + { + lock (lockObject) + { + if (instance == null) + { + instance = new TestPage(); + } + } + return instance; + } + + private TestPage() + { + } + + public void Initialize(TRunner tunitRunner, List testcaseIDList, List listItem) + { + _toastMessage = new ToastMessage(); + RunType.Value = RunType.MANUAL; + _tunitRunner = tunitRunner; + _tunitRunner.SingleTestDone += OnSingleTestDone; + _tcInfoList = new List(); + _tcIDList = testcaseIDList; + _tsettings = TSettings.GetInstance(); + _tsettings.IsManual = true; _listItem = listItem; - MakeTCInfoList(); - _summaryLabel = new Label() - { - Text = "", - HorizontalOptions = LayoutOptions.CenterAndExpand, - MinimumHeightRequest = 60, - TextColor = Color.White - }; - SetResultNumber(0, 0, 0); - MakeTestPage(); - } - - private void OnSingleTestDone(object sender, SingleTestDoneEventArgs e) - { - // check old result - if (_listItem[_tcIndex].Result.Contains(StrResult.FAIL)) - { - ResultNumber.Fail = ResultNumber.Fail - 1; - } - else if (_listItem[_tcIndex].Result.Contains(StrResult.PASS)) - { - ResultNumber.Pass = ResultNumber.Pass - 1; - } - else if (_listItem[_tcIndex].Result.Contains(StrResult.BLOCK)) - ResultNumber.Block = ResultNumber.Block - 1; - - // Update new result - _listItem[_tcIndex].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; - } - - UpdateLayout(); - } - - private void UpdateLayout() - { - SetResultNumber(ResultNumber.Pass, ResultNumber.Fail, ResultNumber.Block); - _tcResultText.Text = _listItem[_tcIndex].Result; - SetColor(_tcResultText.Text); - if (_tcUILayout != null) - { - _tcUILayout.Children.Clear(); - } - if (_pressButton == NavigationButton.Next) - { - Next(); - } - else if (_pressButton == NavigationButton.Previous) - { - Previous(); - } - else if (_pressButton == NavigationButton.Home) - { - _navigationPage.PopAsync(); - } - OnTestcaseDone(null); - _passBtn.IsEnabled = false; - _failBtn.IsEnabled = false; - _blockBtn.IsEnabled = false; - _runBtn.IsEnabled = true; - _mainBtn.IsEnabled = true; - _prevBtn.IsEnabled = true; - _nextBtn.IsEnabled = true; - } - - private void SetResultNumber(int pass, int fail, int block) - { - ResultNumber.NotRun = ResultNumber.Total - pass - fail - block; - _summaryLabel.Text = "Total : " + ResultNumber.Total + ", Pass : " + pass + ", Fail : " + fail + ", Block : " + block + ", Not Run : " + ResultNumber.NotRun; - } - - private void MakeTestPage() - { - _mainLayout = new StackLayout() - { - Orientation = StackOrientation.Vertical, - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Spacing = 10, - Padding = new Thickness(10), - }; - _descriptionTitle = new Label() - { - Text = "DESCRIPTION:", - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Start, - HeightRequest = 50, - TextColor = Color.White - }; - // layout - StackLayout functionLayout = new StackLayout() - { - Orientation = StackOrientation.Horizontal, - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - Spacing = 10, - VerticalOptions = LayoutOptions.End, - }; - - _mainBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "Home", - HeightRequest = 80, - }; - - _mainBtn.Clicked += (sender, e) => - { - _pressButton = NavigationButton.Home; - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - else - { - _navigationPage.PopAsync(); - } - }; - - _prevBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "<<", - HeightRequest = 80, - }; - - _prevBtn.Clicked += (sender, e) => - { - PreviousTestcase(); - }; - - _nextBtn = new Button() - { - Text = ">>", - HorizontalOptions = LayoutOptions.Start, - HeightRequest = 80, - }; - - _nextBtn.Clicked += (sender, e) => - { - NextTestcase(); - }; - - _tcResultText = new Label() - { - HorizontalOptions = LayoutOptions.Start, - VerticalOptions = LayoutOptions.FillAndExpand, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - HeightRequest = 80, - }; - functionLayout.Children.Add(_mainBtn); - functionLayout.Children.Add(_tcResultText); - functionLayout.Children.Add(_prevBtn); - functionLayout.Children.Add(_nextBtn); - // Show description - ShowDescription(); - - var navigationLayout = new StackLayout() - { - Orientation = StackOrientation.Horizontal, - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - Spacing = 10, - VerticalOptions = LayoutOptions.End, - }; - - _passBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "Pass", - HeightRequest = 80, - IsEnabled = false, - }; - - _passBtn.Clicked += (sender, e) => - { - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.PASS; - ManualTest.Confirm(); - } - }; - - _failBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "Fail", - HeightRequest = 80, - IsEnabled = false, - }; - - _failBtn.Clicked += (sender, e) => - { - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.FAIL; - ManualTest.Confirm(); - } - }; - - _blockBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "Block", - HeightRequest = 80, - IsEnabled = false, - }; - - _blockBtn.Clicked += (sender, e) => - { - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.BLOCK; - ManualTest.Confirm(); - } - }; - - _runBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "Run", - HeightRequest = 80, - }; - - _runBtn.Clicked += (sender, e) => - { - LockUIButton(); - _pressButton = NavigationButton.NA; - _tsettings.Testcase_ID = _tcIDList[_tcIndex]; - _tsettings.TCResult = ""; - _tunitRunner.Execute(); - }; - - navigationLayout.Children.Add(_passBtn); - navigationLayout.Children.Add(_failBtn); - navigationLayout.Children.Add(_blockBtn); - navigationLayout.Children.Add(_runBtn); - - _tcUILayout = new StackLayout() - { - Orientation = StackOrientation.Vertical, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = 200 - }; - - _mainLayout.Children.Add(_summaryLabel); - _mainLayout.Children.Add(_descriptionTitle); - _mainLayout.Children.Add(_tcDescriptions); - _mainLayout.Children.Add(_tcUILayout); - _mainLayout.Children.Add(navigationLayout); - _mainLayout.Children.Add(functionLayout); - _tcContentPage = new ContentPage() - { - Content = _mainLayout - }; - NavigationPage.SetHasNavigationBar(_tcContentPage, false); - } - - public void LockUIButton() - { - if (ManualTest.IsWearable()) - { - WearableTemplate.TestPage.GetInstance().LockUIButton(); - } - else - { - _runBtn.IsEnabled = false; - _passBtn.IsEnabled = false; - _failBtn.IsEnabled = false; - _blockBtn.IsEnabled = false; - _mainBtn.IsEnabled = false; - _prevBtn.IsEnabled = false; - _nextBtn.IsEnabled = false; - } - } - - public void UnlockUIButton() - { - if (ManualTest.IsWearable()) - { - WearableTemplate.TestPage.GetInstance().UnlockUIButton(); - } - else - { - _passBtn.IsEnabled = true; - _failBtn.IsEnabled = true; - _blockBtn.IsEnabled = true; - _mainBtn.IsEnabled = true; - _prevBtn.IsEnabled = true; - _nextBtn.IsEnabled = true; - } - } - - public void Show(NavigationPage navigationPage, int testcaseIndex) - { - _navigationPage = navigationPage; - _tcIndex = testcaseIndex - 1; - _descriptionTitle.Text = "DESCRIPTION : #" + testcaseIndex; - _tcResultText.Text = _listItem[_tcIndex].Result; - SetColor(_tcResultText.Text); - UpdateDescriptions(); - navigationPage.PushAsync(_tcContentPage); - _passBtn.IsEnabled = false; - _failBtn.IsEnabled = false; - _blockBtn.IsEnabled = false; - } - - private void NextTestcase() - { - _pressButton = NavigationButton.Next; - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - else - { - Next(); - } - } - - private void Next() - { - if (_tcIndex < _tcIDList.Count - 1) - { - _tcIndex = _tcIndex + 1; - _descriptionTitle.Text = "DESCRIPTION : #" + (_tcIndex + 1); - _tcResultText.Text = _listItem[_tcIndex].Result; - SetColor(_tcResultText.Text); - UpdateDescriptions(); - } - else if (_tcIndex == _tcIDList.Count - 1) - { - _toastMessage.Message = "This is last testcase"; - _toastMessage.Post(); - } - } - - private void PreviousTestcase() - { - _pressButton = NavigationButton.Previous; - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - else - { - Previous(); - } - } - - private void Previous() - { - if (_tcIndex > 0) - { - _tcIndex = _tcIndex - 1; - _descriptionTitle.Text = "DESCRIPTION : #" + (_tcIndex + 1); - _tcResultText.Text = _listItem[_tcIndex].Result; - SetColor(_tcResultText.Text); - UpdateDescriptions(); - } - else if (_tcIndex == 0) - { - _toastMessage.Message = "This is first testcase"; - _toastMessage.Post(); - } - } - - private void SetColor(string result) - { - if (result.Equals(StrResult.PASS)) - { - _tcResultText.TextColor = Color.Green; - } - else if (result.Equals(StrResult.FAIL)) - { - _tcResultText.TextColor = Color.Red; - } - else if (result.Equals(StrResult.BLOCK)) - { - _tcResultText.TextColor = Color.Orange; - } - else - { - _tcResultText.TextColor = Color.White; - } - } - - private int FindMaxLineDescription() - { - int maxLine = 0; - for (int i = 0; i < _tcInfoList.Count; i++) - { - int len = _tcInfoList[i].Steps.Count + _tcInfoList[i].Preconditions.Count + _tcInfoList[i].Postconditions.Count; - maxLine = maxLine < len ? len : maxLine; - } - return maxLine; - } - - private void ShowDescription() - { - int lenght = FindMaxLineDescription() + 3; - var template = new DataTemplate(() => - { - var grid = new Grid(); - - var descriptionLabel = new Label - { - HorizontalOptions = LayoutOptions.FillAndExpand, - LineBreakMode = LineBreakMode.CharacterWrap - }; - - descriptionLabel.SetBinding(Label.TextProperty, new Binding("Description")); - - grid.Children.Add(descriptionLabel); - - return new ViewCell - { - View = grid, - }; - }); - - _tcDescriptions = new ListView() - { - ItemTemplate = template, - HorizontalOptions = LayoutOptions.FillAndExpand, - RowHeight = 150, - Margin = new Thickness(10), - }; - _currentTCInfo = new List(); - - for (int i = 0; i < lenght; i++) - { - _currentTCInfo.Add(new TestcaseDescription("")); - } - UpdateDescriptions(); - _tcDescriptions.ItemsSource = _currentTCInfo; - } - - private void UpdateDescriptions() - { - _prevBtn.IsEnabled = false; - _nextBtn.IsEnabled = false; - int lenght = FindMaxLineDescription() + 3; - for (int i = 0; i < lenght; i++) - { - _currentTCInfo[i].Description = ""; - } - int index = 0; - _currentTCInfo[index].Description = "TC : " + _tcInfoList[_tcIndex].TestcaseName; - foreach (string precondition in _tcInfoList[_tcIndex].Preconditions.ToArray()) - { - index++; - _currentTCInfo[index].Description = precondition; - } - foreach (string step in _tcInfoList[_tcIndex].Steps.ToArray()) - { - index++; - _currentTCInfo[index].Description = step; - } - foreach (string postcondition in _tcInfoList[_tcIndex].Postconditions.ToArray()) - { - index++; - _currentTCInfo[index].Description = postcondition; - } - _prevBtn.IsEnabled = true; - _nextBtn.IsEnabled = true; - } - - private void MakeTCInfoList() - { - foreach (var testcaseItem in _listItem) + MakeTCInfoList(); + _summaryLabel = new Label() + { + Text = "", + HorizontalOptions = LayoutOptions.CenterAndExpand, + MinimumHeightRequest = 60, + TextColor = Color.White + }; + SetResultNumber(0, 0, 0); + MakeTestPage(); + } + + private void OnSingleTestDone(object sender, SingleTestDoneEventArgs e) + { + // check old result + if (_listItem[_tcIndex].Result.Contains(StrResult.FAIL)) + { + ResultNumber.Fail = ResultNumber.Fail - 1; + } + else if (_listItem[_tcIndex].Result.Contains(StrResult.PASS)) + { + ResultNumber.Pass = ResultNumber.Pass - 1; + } + else if (_listItem[_tcIndex].Result.Contains(StrResult.BLOCK)) + ResultNumber.Block = ResultNumber.Block - 1; + + // Update new result + _listItem[_tcIndex].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; + } + + UpdateLayout(); + } + + private void UpdateLayout() + { + SetResultNumber(ResultNumber.Pass, ResultNumber.Fail, ResultNumber.Block); + _tcResultText.Text = _listItem[_tcIndex].Result; + SetColor(_tcResultText.Text); + if (_tcUILayout != null) + { + _tcUILayout.Children.Clear(); + } + if (_pressButton == NavigationButton.Next) + { + Next(); + } + else if (_pressButton == NavigationButton.Previous) + { + Previous(); + } + else if (_pressButton == NavigationButton.Home) + { + _navigationPage.PopAsync(); + } + OnTestcaseDone(null); + _passBtn.IsEnabled = false; + _failBtn.IsEnabled = false; + _blockBtn.IsEnabled = false; + _runBtn.IsEnabled = true; + _mainBtn.IsEnabled = true; + _prevBtn.IsEnabled = true; + _nextBtn.IsEnabled = true; + } + + private void SetResultNumber(int pass, int fail, int block) + { + ResultNumber.NotRun = ResultNumber.Total - pass - fail - block; + _summaryLabel.Text = "Total : " + ResultNumber.Total + ", Pass : " + pass + ", Fail : " + fail + ", Block : " + block + ", Not Run : " + ResultNumber.NotRun; + } + + private void MakeTestPage() + { + _mainLayout = new StackLayout() + { + Orientation = StackOrientation.Vertical, + IsVisible = true, + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.FillAndExpand, + Spacing = 10, + Padding = new Thickness(10), + }; + _descriptionTitle = new Label() + { + Text = "DESCRIPTION:", + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.Start, + HeightRequest = 50, + TextColor = Color.White + }; + // layout + StackLayout functionLayout = new StackLayout() + { + Orientation = StackOrientation.Horizontal, + IsVisible = true, + HorizontalOptions = LayoutOptions.FillAndExpand, + Spacing = 10, + VerticalOptions = LayoutOptions.End, + }; + + _mainBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "Home", + HeightRequest = 80, + }; + + _mainBtn.Clicked += (sender, e) => + { + _pressButton = NavigationButton.Home; + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + else + { + _navigationPage.PopAsync(); + } + }; + + _prevBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "<<", + HeightRequest = 80, + }; + + _prevBtn.Clicked += (sender, e) => + { + PreviousTestcase(); + }; + + _nextBtn = new Button() + { + Text = ">>", + HorizontalOptions = LayoutOptions.Start, + HeightRequest = 80, + }; + + _nextBtn.Clicked += (sender, e) => + { + NextTestcase(); + }; + + _tcResultText = new Label() + { + HorizontalOptions = LayoutOptions.Start, + VerticalOptions = LayoutOptions.FillAndExpand, + HorizontalTextAlignment = TextAlignment.Center, + VerticalTextAlignment = TextAlignment.Center, + HeightRequest = 80, + }; + functionLayout.Children.Add(_mainBtn); + functionLayout.Children.Add(_tcResultText); + functionLayout.Children.Add(_prevBtn); + functionLayout.Children.Add(_nextBtn); + // Show description + ShowDescription(); + + var navigationLayout = new StackLayout() + { + Orientation = StackOrientation.Horizontal, + IsVisible = true, + HorizontalOptions = LayoutOptions.FillAndExpand, + Spacing = 10, + VerticalOptions = LayoutOptions.End, + }; + + _passBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "Pass", + HeightRequest = 80, + IsEnabled = false, + }; + + _passBtn.Clicked += (sender, e) => + { + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.PASS; + ManualTest.Confirm(); + } + }; + + _failBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "Fail", + HeightRequest = 80, + IsEnabled = false, + }; + + _failBtn.Clicked += (sender, e) => + { + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.FAIL; + ManualTest.Confirm(); + } + }; + + _blockBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "Block", + HeightRequest = 80, + IsEnabled = false, + }; + + _blockBtn.Clicked += (sender, e) => + { + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.BLOCK; + ManualTest.Confirm(); + } + }; + + _runBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "Run", + HeightRequest = 80, + }; + + _runBtn.Clicked += (sender, e) => + { + LockUIButton(); + _pressButton = NavigationButton.NA; + _tsettings.Testcase_ID = _tcIDList[_tcIndex]; + _tsettings.TCResult = ""; + _tunitRunner.Execute(); + }; + + navigationLayout.Children.Add(_passBtn); + navigationLayout.Children.Add(_failBtn); + navigationLayout.Children.Add(_blockBtn); + navigationLayout.Children.Add(_runBtn); + + _tcUILayout = new StackLayout() + { + Orientation = StackOrientation.Vertical, + HorizontalOptions = LayoutOptions.FillAndExpand, + HeightRequest = 200 + }; + + _mainLayout.Children.Add(_summaryLabel); + _mainLayout.Children.Add(_descriptionTitle); + _mainLayout.Children.Add(_tcDescriptions); + _mainLayout.Children.Add(_tcUILayout); + _mainLayout.Children.Add(navigationLayout); + _mainLayout.Children.Add(functionLayout); + _tcContentPage = new ContentPage() + { + Content = _mainLayout + }; + NavigationPage.SetHasNavigationBar(_tcContentPage, false); + } + + public void LockUIButton() + { + if (ManualTest.IsWearable()) + { + WearableTemplate.TestPage.GetInstance().LockUIButton(); + } + else + { + _runBtn.IsEnabled = false; + _passBtn.IsEnabled = false; + _failBtn.IsEnabled = false; + _blockBtn.IsEnabled = false; + _mainBtn.IsEnabled = false; + _prevBtn.IsEnabled = false; + _nextBtn.IsEnabled = false; + } + } + + public void UnlockUIButton() + { + if (ManualTest.IsWearable()) + { + WearableTemplate.TestPage.GetInstance().UnlockUIButton(); + } + else + { + _passBtn.IsEnabled = true; + _failBtn.IsEnabled = true; + _blockBtn.IsEnabled = true; + _mainBtn.IsEnabled = true; + _prevBtn.IsEnabled = true; + _nextBtn.IsEnabled = true; + } + } + + public void Show(NavigationPage navigationPage, int testcaseIndex) + { + _navigationPage = navigationPage; + _tcIndex = testcaseIndex - 1; + _descriptionTitle.Text = "DESCRIPTION : #" + testcaseIndex; + _tcResultText.Text = _listItem[_tcIndex].Result; + SetColor(_tcResultText.Text); + UpdateDescriptions(); + navigationPage.PushAsync(_tcContentPage); + _passBtn.IsEnabled = false; + _failBtn.IsEnabled = false; + _blockBtn.IsEnabled = false; + } + + private void NextTestcase() + { + _pressButton = NavigationButton.Next; + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + else + { + Next(); + } + } + + private void Next() + { + if (_tcIndex < _tcIDList.Count - 1) + { + _tcIndex = _tcIndex + 1; + _descriptionTitle.Text = "DESCRIPTION : #" + (_tcIndex + 1); + _tcResultText.Text = _listItem[_tcIndex].Result; + SetColor(_tcResultText.Text); + UpdateDescriptions(); + } + else if (_tcIndex == _tcIDList.Count - 1) + { + _toastMessage.Message = "This is last testcase"; + _toastMessage.Post(); + } + } + + private void PreviousTestcase() + { + _pressButton = NavigationButton.Previous; + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + else + { + Previous(); + } + } + + private void Previous() + { + if (_tcIndex > 0) + { + _tcIndex = _tcIndex - 1; + _descriptionTitle.Text = "DESCRIPTION : #" + (_tcIndex + 1); + _tcResultText.Text = _listItem[_tcIndex].Result; + SetColor(_tcResultText.Text); + UpdateDescriptions(); + } + else if (_tcIndex == 0) + { + _toastMessage.Message = "This is first testcase"; + _toastMessage.Post(); + } + } + + private void SetColor(string result) + { + if (result.Equals(StrResult.PASS)) + { + _tcResultText.TextColor = Color.Green; + } + else if (result.Equals(StrResult.FAIL)) + { + _tcResultText.TextColor = Color.Red; + } + else if (result.Equals(StrResult.BLOCK)) + { + _tcResultText.TextColor = Color.Orange; + } + else + { + _tcResultText.TextColor = Color.White; + } + } + + private int FindMaxLineDescription() + { + int maxLine = 0; + for (int i = 0; i < _tcInfoList.Count; i++) + { + int len = _tcInfoList[i].Steps.Count + _tcInfoList[i].Preconditions.Count + _tcInfoList[i].Postconditions.Count; + maxLine = maxLine < len ? len : maxLine; + } + return maxLine; + } + + private void ShowDescription() + { + int lenght = FindMaxLineDescription() + 3; + var template = new DataTemplate(() => + { + var grid = new Grid(); + + var descriptionLabel = new Label + { + HorizontalOptions = LayoutOptions.FillAndExpand, + LineBreakMode = LineBreakMode.CharacterWrap + }; + + descriptionLabel.SetBinding(Label.TextProperty, new Binding("Description")); + + grid.Children.Add(descriptionLabel); + + return new ViewCell + { + View = grid, + }; + }); + + _tcDescriptions = new ListView() + { + ItemTemplate = template, + HorizontalOptions = LayoutOptions.FillAndExpand, + RowHeight = 150, + Margin = new Thickness(10), + }; + _currentTCInfo = new List(); + + for (int i = 0; i < lenght; i++) + { + _currentTCInfo.Add(new TestcaseDescription("")); + } + UpdateDescriptions(); + _tcDescriptions.ItemsSource = _currentTCInfo; + } + + private void UpdateDescriptions() + { + _prevBtn.IsEnabled = false; + _nextBtn.IsEnabled = false; + int lenght = FindMaxLineDescription() + 3; + for (int i = 0; i < lenght; i++) + { + _currentTCInfo[i].Description = ""; + } + int index = 0; + if(_tcInfoList.Count == 0) + { + _toastMessage.Message = "Some testing class wrong, plz recheck"; + _toastMessage.Post(); + return; + } + + _currentTCInfo[index].Description = "TC : " + _tcInfoList[_tcIndex].TestcaseName; + foreach (string precondition in _tcInfoList[_tcIndex].Preconditions.ToArray()) + { + index++; + _currentTCInfo[index].Description = precondition; + } + foreach (string step in _tcInfoList[_tcIndex].Steps.ToArray()) + { + index++; + _currentTCInfo[index].Description = step; + } + foreach (string postcondition in _tcInfoList[_tcIndex].Postconditions.ToArray()) + { + index++; + _currentTCInfo[index].Description = postcondition; + } + _prevBtn.IsEnabled = true; + _nextBtn.IsEnabled = true; + } + + private void MakeTCInfoList() + { + foreach (var testcaseItem in _listItem) { foreach (KeyValuePair pair in _tunitRunner.GetTestList()) { @@ -618,37 +625,37 @@ namespace NUnit.Framework }); break; } - } - } - } - - public void ExecuteTC(Layout layout) - { - if (ManualTest.IsWearable()) - { - WearableTemplate.TestPage.GetInstance().ExecuteTC(layout); - } - else - { - _tcUILayout.Children.Add(layout); - } - } - - public void ExecuteTC(Page page) - { - if (ManualTest.IsWearable()) - { - if (String.IsNullOrEmpty(page.Title)) - { - NavigationPage.SetHasNavigationBar(page, false); - } - WearableTemplate.TestPage.GetInstance().ExecuteTC(page); - } - else - { - _tcUIPage = page; - _navigationPage.PushAsync(page); - } - } - } -} + } + } + } + + public void ExecuteTC(Layout layout) + { + if (ManualTest.IsWearable()) + { + WearableTemplate.TestPage.GetInstance().ExecuteTC(layout); + } + else + { + _tcUILayout.Children.Add(layout); + } + } + + public void ExecuteTC(Page page) + { + if (ManualTest.IsWearable()) + { + if (String.IsNullOrEmpty(page.Title)) + { + NavigationPage.SetHasNavigationBar(page, false); + } + WearableTemplate.TestPage.GetInstance().ExecuteTC(page); + } + else + { + _tcUIPage = page; + _navigationPage.PushAsync(page); + } + } + } +} diff --git a/tct-suite-vs/Template/ManualTemplateForWearable/TestPage.cs b/tct-suite-vs/Template/ManualTemplateForWearable/TestPage.cs index 95575ea64..d1c54d2ef 100755 --- a/tct-suite-vs/Template/ManualTemplateForWearable/TestPage.cs +++ b/tct-suite-vs/Template/ManualTemplateForWearable/TestPage.cs @@ -1,620 +1,627 @@ -/* - * 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.Collections.Generic; -using NUnitLite.TUnit; -using NUnit.Framework.TUnit; -using NUnit.Framework.Interfaces; -using System.Reflection; -using Xamarin.Forms; -using Tizen.Applications; - -namespace WearableTemplate -{ - public class TestPage - { - private static TestPage instance; - private static Object lockObject = new object(); - - private NavigationPage _navigationPage; - private ContentPage _tcContentPage; - private Page _tcUIPage; - private Label _summaryLabel1, _summaryLabel2, _tcResultText, _descriptionTitle; - private ListView _tcDescriptions; - private Button _runBtn, _passBtn, _failBtn, _blockBtn; - private Button _mainBtn, _prevBtn, _nextBtn; - private StackLayout _mainLayout, _tcUILayout; - - private int _tcIndex = 0; - private List _tcIDList; - private List _listItem; - private List _tcInfoList; - private List _currentTCInfo; - private TRunner _tunitRunner; - private TSettings _tsettings; - private NavigationButton _pressButton = NavigationButton.NA; - private ToastMessage _toastMessage; - - 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"; - - public event EventHandler TestcaseDone; - - private void OnTestcaseDone(string e) - { - EventHandler handler = TestcaseDone; - if (handler != null) - { - handler(this, e); - } - } - - public NavigationPage getNavigationPage() - { - return _navigationPage; - } - - public static TestPage GetInstance() - { - - lock (lockObject) - { - if (instance == null) - { - instance = new TestPage(); - } - } - return instance; - } - - private TestPage() - { - } - - public void Initialize(TRunner tunitRunner, List testcaseIDList, List listItem) - { - _toastMessage = new ToastMessage(); - RunType.Value = RunType.MANUAL; - _tunitRunner = tunitRunner; - _tunitRunner.SingleTestDone += OnSingleTestDone; - _tcInfoList = new List(); - _tcIDList = testcaseIDList; - _tsettings = TSettings.GetInstance(); - _tsettings.IsManual = true; - _listItem = listItem; - MakeTCInfoList(); - - _summaryLabel1 = new Label() - { - Text = "", - HeightRequest = 25, - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Color.White, - FontSize = 5, - }; - _summaryLabel2 = new Label() - { - Text = "", - HeightRequest = 25, - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - TextColor = Color.White, - FontSize = 5, - }; - SetResultNumber(0, 0, 0); - MakeTestPage(); - } - - private void OnSingleTestDone(object sender, SingleTestDoneEventArgs e) - { - // check old result - if (_listItem[_tcIndex].Result.Contains(StrResult.FAIL)) - { - ResultNumber.Fail = ResultNumber.Fail - 1; - } - else if (_listItem[_tcIndex].Result.Contains(StrResult.PASS)) - { - ResultNumber.Pass = ResultNumber.Pass - 1; - } - else if (_listItem[_tcIndex].Result.Contains(StrResult.BLOCK)) - ResultNumber.Block = ResultNumber.Block - 1; - - // Update new result - _listItem[_tcIndex].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; - } - - UpdateLayout(); - } - - private void UpdateLayout() - { - SetResultNumber(ResultNumber.Pass, ResultNumber.Fail, ResultNumber.Block); - _tcResultText.Text = _listItem[_tcIndex].Result; - SetColor(_tcResultText.Text); - if (_tcUILayout != null) - { - _tcUILayout.Children.Clear(); - } - if (_pressButton == NavigationButton.Next) - { - Next(); - } - else if (_pressButton == NavigationButton.Previous) - { - Previous(); - } - else if (_pressButton == NavigationButton.Home) - { - _navigationPage.PopAsync(); - } - OnTestcaseDone(null); - _passBtn.IsEnabled = false; - _failBtn.IsEnabled = false; - _blockBtn.IsEnabled = false; - _runBtn.IsEnabled = true; - _mainBtn.IsEnabled = true; - _prevBtn.IsEnabled = true; - _nextBtn.IsEnabled = true; - } - - private void SetResultNumber(int pass, int fail, int block) - { - ResultNumber.NotRun = ResultNumber.Total - pass - fail - block; - _summaryLabel1.Text = "T : " + ResultNumber.Total + ", P : " + pass; - _summaryLabel2.Text = "F : " + fail + ", B : " + block + ", NR : " + ResultNumber.NotRun; - } - - private void MakeTestPage() - { - _mainLayout = new StackLayout() - { - Orientation = StackOrientation.Vertical, - IsVisible = true, - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - Spacing = 5, - Padding = new Thickness(10), - }; - _descriptionTitle = new Label() - { - Text = "DESCRIPTION:", - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Start, - HeightRequest = 23, - Margin = new Thickness(40, 0, 0, 0), - FontSize = 5, - TextColor = Color.White, - }; - - StackLayout functionLayout = new StackLayout() - { - Orientation = StackOrientation.Horizontal, - IsVisible = true, - HeightRequest = 30, - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.Start, - Spacing = 2, - Margin = new Thickness(0, 0, 0, 15) - }; - - _mainBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "H", - HeightRequest = 30, - WidthRequest = 55, - FontSize = 5 - }; - - _mainBtn.Clicked += (sender, e) => - { - _pressButton = NavigationButton.Home; - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - else - { - _navigationPage.PopAsync(); - } - }; - - _prevBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "<<", - HeightRequest = 30, - WidthRequest = 55, - FontSize = 4 - }; - - _prevBtn.Clicked += (sender, e) => - { - PreviousTestcase(); - }; - - _nextBtn = new Button() - { - Text = ">>", - HorizontalOptions = LayoutOptions.Start, - HeightRequest = 30, - WidthRequest = 55, - FontSize = 4 - }; - - _nextBtn.Clicked += (sender, e) => - { - NextTestcase(); - }; - - _tcResultText = new Label() - { - HorizontalOptions = LayoutOptions.Start, - VerticalOptions = LayoutOptions.FillAndExpand, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - HeightRequest = 30, - FontSize = 3 - }; - functionLayout.Children.Add(_mainBtn); - functionLayout.Children.Add(_tcResultText); - functionLayout.Children.Add(_prevBtn); - functionLayout.Children.Add(_nextBtn); - // Show description - ShowDescription(); - - var navigationLayout = new StackLayout() - { - Orientation = StackOrientation.Horizontal, - IsVisible = true, - HeightRequest = 30, - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.Start, - Spacing = 5, - }; - - _passBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "P", - HeightRequest = 30, - IsEnabled = false, - FontSize = 5, - WidthRequest = 60 - }; - - _passBtn.Clicked += (sender, e) => - { - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.PASS; - ManualTest.Confirm(); - } - }; - - _failBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "F", - HeightRequest = 30, - IsEnabled = false, - FontSize = 5, - WidthRequest = 60 - }; - - _failBtn.Clicked += (sender, e) => - { - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.FAIL; - ManualTest.Confirm(); - } - }; - - _blockBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "B", - HeightRequest = 30, - IsEnabled = false, - FontSize = 5, - WidthRequest = 60 - }; - - _blockBtn.Clicked += (sender, e) => - { - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.BLOCK; - ManualTest.Confirm(); - } - }; - - _runBtn = new Button() - { - HorizontalOptions = LayoutOptions.Start, - Text = "R", - HeightRequest = 30, - FontSize = 5, - WidthRequest = 60 - }; - - _runBtn.Clicked += (sender, e) => - { - LockUIButton(); - _pressButton = NavigationButton.NA; - _tsettings.Testcase_ID = _tcIDList[_tcIndex]; - _tsettings.TCResult = ""; - _tunitRunner.Execute(); - }; - - navigationLayout.Children.Add(_passBtn); - navigationLayout.Children.Add(_failBtn); - navigationLayout.Children.Add(_blockBtn); - navigationLayout.Children.Add(_runBtn); - - _tcUILayout = new StackLayout() - { - Orientation = StackOrientation.Vertical, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Start, - HeightRequest = 40, - WidthRequest = 280, - Margin = new Thickness(10, 0, 10, 0) - }; - - _mainLayout.Children.Add(_summaryLabel1); - _mainLayout.Children.Add(_summaryLabel2); - _mainLayout.Children.Add(_descriptionTitle); - _mainLayout.Children.Add(_tcDescriptions); - _mainLayout.Children.Add(_tcUILayout); - _mainLayout.Children.Add(navigationLayout); - _mainLayout.Children.Add(functionLayout); - _tcContentPage = new ContentPage() - { - Content = _mainLayout - }; - NavigationPage.SetHasNavigationBar(_tcContentPage, false); - } - - public void LockUIButton() - { - _runBtn.IsEnabled = false; - _passBtn.IsEnabled = false; - _failBtn.IsEnabled = false; - _blockBtn.IsEnabled = false; - _mainBtn.IsEnabled = false; - _prevBtn.IsEnabled = false; - _nextBtn.IsEnabled = false; - - } - - public void UnlockUIButton() - { - _passBtn.IsEnabled = true; - _failBtn.IsEnabled = true; - _blockBtn.IsEnabled = true; - _mainBtn.IsEnabled = true; - _prevBtn.IsEnabled = true; - _nextBtn.IsEnabled = true; - } - - public void Show(NavigationPage navigationPage, int testcaseIndex) - { +/* + * 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.Collections.Generic; +using NUnitLite.TUnit; +using NUnit.Framework.TUnit; +using NUnit.Framework.Interfaces; +using System.Reflection; +using Xamarin.Forms; +using Tizen.Applications; + +namespace WearableTemplate +{ + public class TestPage + { + private static TestPage instance; + private static Object lockObject = new object(); + + private NavigationPage _navigationPage; + private ContentPage _tcContentPage; + private Page _tcUIPage; + private Label _summaryLabel1, _summaryLabel2, _tcResultText, _descriptionTitle; + private ListView _tcDescriptions; + private Button _runBtn, _passBtn, _failBtn, _blockBtn; + private Button _mainBtn, _prevBtn, _nextBtn; + private StackLayout _mainLayout, _tcUILayout; + + private int _tcIndex = 0; + private List _tcIDList; + private List _listItem; + private List _tcInfoList; + private List _currentTCInfo; + private TRunner _tunitRunner; + private TSettings _tsettings; + private NavigationButton _pressButton = NavigationButton.NA; + private ToastMessage _toastMessage; + + 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"; + + public event EventHandler TestcaseDone; + + private void OnTestcaseDone(string e) + { + EventHandler handler = TestcaseDone; + if (handler != null) + { + handler(this, e); + } + } + + public NavigationPage getNavigationPage() + { + return _navigationPage; + } + + public static TestPage GetInstance() + { + + lock (lockObject) + { + if (instance == null) + { + instance = new TestPage(); + } + } + return instance; + } + + private TestPage() + { + } + + public void Initialize(TRunner tunitRunner, List testcaseIDList, List listItem) + { + _toastMessage = new ToastMessage(); + RunType.Value = RunType.MANUAL; + _tunitRunner = tunitRunner; + _tunitRunner.SingleTestDone += OnSingleTestDone; + _tcInfoList = new List(); + _tcIDList = testcaseIDList; + _tsettings = TSettings.GetInstance(); + _tsettings.IsManual = true; + _listItem = listItem; + MakeTCInfoList(); + + _summaryLabel1 = new Label() + { + Text = "", + HeightRequest = 25, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Color.White, + FontSize = 5, + }; + _summaryLabel2 = new Label() + { + Text = "", + HeightRequest = 25, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Color.White, + FontSize = 5, + }; + SetResultNumber(0, 0, 0); + MakeTestPage(); + } + + private void OnSingleTestDone(object sender, SingleTestDoneEventArgs e) + { + // check old result + if (_listItem[_tcIndex].Result.Contains(StrResult.FAIL)) + { + ResultNumber.Fail = ResultNumber.Fail - 1; + } + else if (_listItem[_tcIndex].Result.Contains(StrResult.PASS)) + { + ResultNumber.Pass = ResultNumber.Pass - 1; + } + else if (_listItem[_tcIndex].Result.Contains(StrResult.BLOCK)) + ResultNumber.Block = ResultNumber.Block - 1; + + // Update new result + _listItem[_tcIndex].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; + } + + UpdateLayout(); + } + + private void UpdateLayout() + { + SetResultNumber(ResultNumber.Pass, ResultNumber.Fail, ResultNumber.Block); + _tcResultText.Text = _listItem[_tcIndex].Result; + SetColor(_tcResultText.Text); + if (_tcUILayout != null) + { + _tcUILayout.Children.Clear(); + } + if (_pressButton == NavigationButton.Next) + { + Next(); + } + else if (_pressButton == NavigationButton.Previous) + { + Previous(); + } + else if (_pressButton == NavigationButton.Home) + { + _navigationPage.PopAsync(); + } + OnTestcaseDone(null); + _passBtn.IsEnabled = false; + _failBtn.IsEnabled = false; + _blockBtn.IsEnabled = false; + _runBtn.IsEnabled = true; + _mainBtn.IsEnabled = true; + _prevBtn.IsEnabled = true; + _nextBtn.IsEnabled = true; + } + + private void SetResultNumber(int pass, int fail, int block) + { + ResultNumber.NotRun = ResultNumber.Total - pass - fail - block; + _summaryLabel1.Text = "T : " + ResultNumber.Total + ", P : " + pass; + _summaryLabel2.Text = "F : " + fail + ", B : " + block + ", NR : " + ResultNumber.NotRun; + } + + private void MakeTestPage() + { + _mainLayout = new StackLayout() + { + Orientation = StackOrientation.Vertical, + IsVisible = true, + HorizontalOptions = LayoutOptions.CenterAndExpand, + VerticalOptions = LayoutOptions.CenterAndExpand, + Spacing = 5, + Padding = new Thickness(10), + }; + _descriptionTitle = new Label() + { + Text = "DESCRIPTION:", + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.Start, + HeightRequest = 23, + Margin = new Thickness(40, 0, 0, 0), + FontSize = 5, + TextColor = Color.White, + }; + + StackLayout functionLayout = new StackLayout() + { + Orientation = StackOrientation.Horizontal, + IsVisible = true, + HeightRequest = 30, + HorizontalOptions = LayoutOptions.CenterAndExpand, + VerticalOptions = LayoutOptions.Start, + Spacing = 2, + Margin = new Thickness(0, 0, 0, 15) + }; + + _mainBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "H", + HeightRequest = 30, + WidthRequest = 55, + FontSize = 5 + }; + + _mainBtn.Clicked += (sender, e) => + { + _pressButton = NavigationButton.Home; + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + else + { + _navigationPage.PopAsync(); + } + }; + + _prevBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "<<", + HeightRequest = 30, + WidthRequest = 55, + FontSize = 4 + }; + + _prevBtn.Clicked += (sender, e) => + { + PreviousTestcase(); + }; + + _nextBtn = new Button() + { + Text = ">>", + HorizontalOptions = LayoutOptions.Start, + HeightRequest = 30, + WidthRequest = 55, + FontSize = 4 + }; + + _nextBtn.Clicked += (sender, e) => + { + NextTestcase(); + }; + + _tcResultText = new Label() + { + HorizontalOptions = LayoutOptions.Start, + VerticalOptions = LayoutOptions.FillAndExpand, + HorizontalTextAlignment = TextAlignment.Center, + VerticalTextAlignment = TextAlignment.Center, + HeightRequest = 30, + FontSize = 3 + }; + functionLayout.Children.Add(_mainBtn); + functionLayout.Children.Add(_tcResultText); + functionLayout.Children.Add(_prevBtn); + functionLayout.Children.Add(_nextBtn); + // Show description + ShowDescription(); + + var navigationLayout = new StackLayout() + { + Orientation = StackOrientation.Horizontal, + IsVisible = true, + HeightRequest = 30, + HorizontalOptions = LayoutOptions.CenterAndExpand, + VerticalOptions = LayoutOptions.Start, + Spacing = 5, + }; + + _passBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "P", + HeightRequest = 30, + IsEnabled = false, + FontSize = 5, + WidthRequest = 60 + }; + + _passBtn.Clicked += (sender, e) => + { + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.PASS; + ManualTest.Confirm(); + } + }; + + _failBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "F", + HeightRequest = 30, + IsEnabled = false, + FontSize = 5, + WidthRequest = 60 + }; + + _failBtn.Clicked += (sender, e) => + { + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.FAIL; + ManualTest.Confirm(); + } + }; + + _blockBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "B", + HeightRequest = 30, + IsEnabled = false, + FontSize = 5, + WidthRequest = 60 + }; + + _blockBtn.Clicked += (sender, e) => + { + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.BLOCK; + ManualTest.Confirm(); + } + }; + + _runBtn = new Button() + { + HorizontalOptions = LayoutOptions.Start, + Text = "R", + HeightRequest = 30, + FontSize = 5, + WidthRequest = 60 + }; + + _runBtn.Clicked += (sender, e) => + { + LockUIButton(); + _pressButton = NavigationButton.NA; + _tsettings.Testcase_ID = _tcIDList[_tcIndex]; + _tsettings.TCResult = ""; + _tunitRunner.Execute(); + }; + + navigationLayout.Children.Add(_passBtn); + navigationLayout.Children.Add(_failBtn); + navigationLayout.Children.Add(_blockBtn); + navigationLayout.Children.Add(_runBtn); + + _tcUILayout = new StackLayout() + { + Orientation = StackOrientation.Vertical, + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.Start, + HeightRequest = 40, + WidthRequest = 280, + Margin = new Thickness(10, 0, 10, 0) + }; + + _mainLayout.Children.Add(_summaryLabel1); + _mainLayout.Children.Add(_summaryLabel2); + _mainLayout.Children.Add(_descriptionTitle); + _mainLayout.Children.Add(_tcDescriptions); + _mainLayout.Children.Add(_tcUILayout); + _mainLayout.Children.Add(navigationLayout); + _mainLayout.Children.Add(functionLayout); + _tcContentPage = new ContentPage() + { + Content = _mainLayout + }; + NavigationPage.SetHasNavigationBar(_tcContentPage, false); + } + + public void LockUIButton() + { + _runBtn.IsEnabled = false; + _passBtn.IsEnabled = false; + _failBtn.IsEnabled = false; + _blockBtn.IsEnabled = false; + _mainBtn.IsEnabled = false; + _prevBtn.IsEnabled = false; + _nextBtn.IsEnabled = false; + + } + + public void UnlockUIButton() + { + _passBtn.IsEnabled = true; + _failBtn.IsEnabled = true; + _blockBtn.IsEnabled = true; + _mainBtn.IsEnabled = true; + _prevBtn.IsEnabled = true; + _nextBtn.IsEnabled = true; + } + + public void Show(NavigationPage navigationPage, int testcaseIndex) + { _navigationPage = navigationPage; _tcIndex = testcaseIndex - 1; - _descriptionTitle.Text = "DESCRIPTION : #" + testcaseIndex; - _tcResultText.Text = _listItem[_tcIndex].Result; - SetColor(_tcResultText.Text); - UpdateDescriptions(); - navigationPage.PushAsync(_tcContentPage); - _passBtn.IsEnabled = false; - _failBtn.IsEnabled = false; - _blockBtn.IsEnabled = false; - } - - private void NextTestcase() - { - _pressButton = NavigationButton.Next; - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - else - { - Next(); - } - } - - private void Next() - { - if (_tcIndex < _tcIDList.Count - 1) - { - _tcIndex = _tcIndex + 1; - _descriptionTitle.Text = "DESCRIPTION : #" + (_tcIndex + 1); - _tcResultText.Text = _listItem[_tcIndex].Result; - SetColor(_tcResultText.Text); - UpdateDescriptions(); - } - else if (_tcIndex == _tcIDList.Count - 1) - { - _toastMessage.Message = "This is last testcase"; - _toastMessage.Post(); - } - } - - private void PreviousTestcase() - { - _pressButton = NavigationButton.Previous; - if (!ManualTest.IsConfirmed()) - { - _tsettings.TCResult = StrResult.NOTRUN; - ManualTest.Confirm(); - } - else - { - Previous(); - } - } - - private void Previous() - { - if (_tcIndex > 0) - { - _tcIndex = _tcIndex - 1; - _descriptionTitle.Text = "DESCRIPTION : #" + (_tcIndex + 1); - _tcResultText.Text = _listItem[_tcIndex].Result; - SetColor(_tcResultText.Text); - UpdateDescriptions(); - } - else if (_tcIndex == 0) - { - _toastMessage.Message = "This is first testcase"; - _toastMessage.Post(); - } - } - - private void SetColor(string result) - { - if (result.Equals(StrResult.PASS)) - { - _tcResultText.TextColor = Color.Green; - } - else if (result.Equals(StrResult.FAIL)) - { - _tcResultText.TextColor = Color.Red; - } - else if (result.Equals(StrResult.BLOCK)) - { - _tcResultText.TextColor = Color.Orange; - } - else - { - _tcResultText.TextColor = Color.White; - } - } - - private int FindMaxLineDescription() - { - int maxLine = 0; - for (int i = 0; i < _tcInfoList.Count; i++) - { - int len = _tcInfoList[i].Steps.Count + _tcInfoList[i].Preconditions.Count + _tcInfoList[i].Postconditions.Count; - maxLine = maxLine < len ? len : maxLine; - } - return maxLine; - } - - private void ShowDescription() - { - int lenght = FindMaxLineDescription() + 3; - var template = new DataTemplate(() => - { - var grid = new Grid(); - - var descriptionLabel = new Label - { - HorizontalOptions = LayoutOptions.FillAndExpand, - LineBreakMode = LineBreakMode.CharacterWrap, - FontSize = 6 - }; - - descriptionLabel.SetBinding(Label.TextProperty, new Binding("Description")); - - grid.Children.Add(descriptionLabel); - - return new ViewCell - { - View = grid, - }; - }); - - _tcDescriptions = new ListView() - { - ItemTemplate = template, - HorizontalOptions = LayoutOptions.FillAndExpand, - RowHeight = 110, - Margin = new Thickness(10, 0, 10, 0), - }; - _currentTCInfo = new List(); - for (int i = 0; i < lenght; i++) - { - _currentTCInfo.Add(new TestcaseDescription("")); - } - UpdateDescriptions(); - _tcDescriptions.ItemsSource = _currentTCInfo; - } - - private void UpdateDescriptions() - { - _prevBtn.IsEnabled = false; - _nextBtn.IsEnabled = false; - int lenght = FindMaxLineDescription() + 3; - for (int i = 0; i < lenght; i++) - { - _currentTCInfo[i].Description = ""; - } - int index = 0; - _currentTCInfo[index].Description = "TC : " + _tcInfoList[_tcIndex].TestcaseName; - foreach (string precondition in _tcInfoList[_tcIndex].Preconditions.ToArray()) - { - index++; - _currentTCInfo[index].Description = precondition; - } - foreach (string step in _tcInfoList[_tcIndex].Steps.ToArray()) - { - index++; - _currentTCInfo[index].Description = step; - } - foreach (string postcondition in _tcInfoList[_tcIndex].Postconditions.ToArray()) - { - index++; - _currentTCInfo[index].Description = postcondition; - } - _prevBtn.IsEnabled = true; - _nextBtn.IsEnabled = true; - } - - private void MakeTCInfoList() - { - foreach (var testcaseItem in _listItem) - { - foreach (KeyValuePair pair in _tunitRunner.GetTestList()) - { - if (testcaseItem.TCName.Equals(pair.Key)) - { - IEnumerator customAttributes = pair.Value.Method.MethodInfo.CustomAttributes.GetEnumerator(); - List _preconditonsStr = new List(); _preconditonsStr.Add("Preconditions:"); - List _stepsStr = new List(); _stepsStr.Add("Steps:"); + _descriptionTitle.Text = "DESCRIPTION : #" + testcaseIndex; + _tcResultText.Text = _listItem[_tcIndex].Result; + SetColor(_tcResultText.Text); + UpdateDescriptions(); + navigationPage.PushAsync(_tcContentPage); + _passBtn.IsEnabled = false; + _failBtn.IsEnabled = false; + _blockBtn.IsEnabled = false; + } + + private void NextTestcase() + { + _pressButton = NavigationButton.Next; + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + else + { + Next(); + } + } + + private void Next() + { + if (_tcIndex < _tcIDList.Count - 1) + { + _tcIndex = _tcIndex + 1; + _descriptionTitle.Text = "DESCRIPTION : #" + (_tcIndex + 1); + _tcResultText.Text = _listItem[_tcIndex].Result; + SetColor(_tcResultText.Text); + UpdateDescriptions(); + } + else if (_tcIndex == _tcIDList.Count - 1) + { + _toastMessage.Message = "This is last testcase"; + _toastMessage.Post(); + } + } + + private void PreviousTestcase() + { + _pressButton = NavigationButton.Previous; + if (!ManualTest.IsConfirmed()) + { + _tsettings.TCResult = StrResult.NOTRUN; + ManualTest.Confirm(); + } + else + { + Previous(); + } + } + + private void Previous() + { + if (_tcIndex > 0) + { + _tcIndex = _tcIndex - 1; + _descriptionTitle.Text = "DESCRIPTION : #" + (_tcIndex + 1); + _tcResultText.Text = _listItem[_tcIndex].Result; + SetColor(_tcResultText.Text); + UpdateDescriptions(); + } + else if (_tcIndex == 0) + { + _toastMessage.Message = "This is first testcase"; + _toastMessage.Post(); + } + } + + private void SetColor(string result) + { + if (result.Equals(StrResult.PASS)) + { + _tcResultText.TextColor = Color.Green; + } + else if (result.Equals(StrResult.FAIL)) + { + _tcResultText.TextColor = Color.Red; + } + else if (result.Equals(StrResult.BLOCK)) + { + _tcResultText.TextColor = Color.Orange; + } + else + { + _tcResultText.TextColor = Color.White; + } + } + + private int FindMaxLineDescription() + { + int maxLine = 0; + for (int i = 0; i < _tcInfoList.Count; i++) + { + int len = _tcInfoList[i].Steps.Count + _tcInfoList[i].Preconditions.Count + _tcInfoList[i].Postconditions.Count; + maxLine = maxLine < len ? len : maxLine; + } + return maxLine; + } + + private void ShowDescription() + { + int lenght = FindMaxLineDescription() + 3; + var template = new DataTemplate(() => + { + var grid = new Grid(); + + var descriptionLabel = new Label + { + HorizontalOptions = LayoutOptions.FillAndExpand, + LineBreakMode = LineBreakMode.CharacterWrap, + FontSize = 6 + }; + + descriptionLabel.SetBinding(Label.TextProperty, new Binding("Description")); + + grid.Children.Add(descriptionLabel); + + return new ViewCell + { + View = grid, + }; + }); + + _tcDescriptions = new ListView() + { + ItemTemplate = template, + HorizontalOptions = LayoutOptions.FillAndExpand, + RowHeight = 110, + Margin = new Thickness(10, 0, 10, 0), + }; + _currentTCInfo = new List(); + for (int i = 0; i < lenght; i++) + { + _currentTCInfo.Add(new TestcaseDescription("")); + } + UpdateDescriptions(); + _tcDescriptions.ItemsSource = _currentTCInfo; + } + + private void UpdateDescriptions() + { + _prevBtn.IsEnabled = false; + _nextBtn.IsEnabled = false; + int lenght = FindMaxLineDescription() + 3; + for (int i = 0; i < lenght; i++) + { + _currentTCInfo[i].Description = ""; + } + int index = 0; + if (_tcInfoList.Count == 0) + { + _toastMessage.Message = "Some testing class wrong, plz recheck"; + _toastMessage.Post(); + return; + } + + _currentTCInfo[index].Description = "TC : " + _tcInfoList[_tcIndex].TestcaseName; + foreach (string precondition in _tcInfoList[_tcIndex].Preconditions.ToArray()) + { + index++; + _currentTCInfo[index].Description = precondition; + } + foreach (string step in _tcInfoList[_tcIndex].Steps.ToArray()) + { + index++; + _currentTCInfo[index].Description = step; + } + foreach (string postcondition in _tcInfoList[_tcIndex].Postconditions.ToArray()) + { + index++; + _currentTCInfo[index].Description = postcondition; + } + _prevBtn.IsEnabled = true; + _nextBtn.IsEnabled = true; + } + + private void MakeTCInfoList() + { + foreach (var testcaseItem in _listItem) + { + foreach (KeyValuePair pair in _tunitRunner.GetTestList()) + { + if (testcaseItem.TCName.Equals(pair.Key)) + { + IEnumerator customAttributes = pair.Value.Method.MethodInfo.CustomAttributes.GetEnumerator(); + List _preconditonsStr = new List(); _preconditonsStr.Add("Preconditions:"); + List _stepsStr = new List(); _stepsStr.Add("Steps:"); List _postconditionsStr = new List(); _postconditionsStr.Add("Postconditions:\n"); while (customAttributes.MoveNext()) @@ -631,30 +638,30 @@ namespace WearableTemplate { _postconditionsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value); } - } - - _tcInfoList.Add(new TestcaseInfo - { - TestcaseName = pair.Key, - Preconditions = _preconditonsStr, - Steps = _stepsStr, - Postconditions = _postconditionsStr, - }); - break; - } - } - } - } - - public void ExecuteTC(Layout layout) - { - _tcUILayout.Children.Add(layout); - } - - public void ExecuteTC(Page page) - { - _tcUIPage = page; - _navigationPage.PushAsync(page); - } - } -} + } + + _tcInfoList.Add(new TestcaseInfo + { + TestcaseName = pair.Key, + Preconditions = _preconditonsStr, + Steps = _stepsStr, + Postconditions = _postconditionsStr, + }); + break; + } + } + } + } + + public void ExecuteTC(Layout layout) + { + _tcUILayout.Children.Add(layout); + } + + public void ExecuteTC(Page page) + { + _tcUIPage = page; + _navigationPage.PushAsync(page); + } + } +} diff --git a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSCheckPermission.cs b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSCheckPermission.cs index d503eaaac..fe6b329e6 100644 --- a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSCheckPermission.cs +++ b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSCheckPermission.cs @@ -25,6 +25,8 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests /// Contains class /// It`s used test if works as expected. /// + [TestFixture] + [Description("Tizen.PrivacyPrivilegeManager Manual test")] public class TSCheckPermission : TestBase { /// diff --git a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSCheckPermissions.cs b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSCheckPermissions.cs index c30e22e5d..eba37ed53 100644 --- a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSCheckPermissions.cs +++ b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSCheckPermissions.cs @@ -14,7 +14,7 @@ * limitations under the License */ -namespace Tizen.PrivacyPrivilegeManager.Manual.Tests.testcase +namespace Tizen.PrivacyPrivilegeManager.Manual.Tests { using global::Xamarin.Forms; using NUnit.Framework; @@ -25,6 +25,8 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests.testcase /// Contains class /// It`s used test if works as expected. /// + [TestFixture] + [Description("Tizen.PrivacyPrivilegeManager Manual test")] class TSCheckPermissions : TestBase { /// diff --git a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSGetResponseContext.cs b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSGetResponseContext.cs index 4927d83e7..210429598 100644 --- a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSGetResponseContext.cs +++ b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSGetResponseContext.cs @@ -26,6 +26,8 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests /// Contains class /// It is used test if works as expected. /// + [TestFixture] + [Description("Tizen.PrivacyPrivilegeManager Manual test")] public class TSGetResponseContext : TestHelpers { /// diff --git a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSPermissionRequestResponse.cs b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSPermissionRequestResponse.cs index 7de45a58c..eb4f75ea4 100644 --- a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSPermissionRequestResponse.cs +++ b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSPermissionRequestResponse.cs @@ -14,13 +14,15 @@ * limitations under the License */ -namespace Tizen.PrivacyPrivilegeManager.Manual.Tests.testcase +namespace Tizen.PrivacyPrivilegeManager.Manual.Tests { using global::System; using NUnit.Framework; using NUnit.Framework.TUnit; using Tizen.Security; - class TSPermissionRequestResponse + [TestFixture] + [Description("Tizen.PrivacyPrivilegeManager Manual test")] + public class TSPermissionRequestResponse { /// /// Initializes environment before TCT test runs. diff --git a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestMultipleResponseEventArgs.cs b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestMultipleResponseEventArgs.cs index 08ea91681..781ef0214 100644 --- a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestMultipleResponseEventArgs.cs +++ b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestMultipleResponseEventArgs.cs @@ -14,7 +14,7 @@ * limitations under the License */ -namespace Tizen.PrivacyPrivilegeManager.Manual.Tests.testcase +namespace Tizen.PrivacyPrivilegeManager.Manual.Tests { using global::System; using NUnit.Framework; @@ -25,7 +25,9 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests.testcase /// Contains class /// It is used test if works as expected. /// - class TSRequestMultipleResponseEventArgs + [TestFixture] + [Description("Tizen.PrivacyPrivilegeManager Manual test")] + public class TSRequestMultipleResponseEventArgs { /// /// Initializes environment before TCT test runs. diff --git a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestPermission.cs b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestPermission.cs index 8c512e131..a41c2c119 100644 --- a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestPermission.cs +++ b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestPermission.cs @@ -27,6 +27,8 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests /// Contains class /// It is used test if works as expected. /// + [TestFixture] + [Description("Tizen.PrivacyPrivilegeManager Manual test")] public class TSRequestPermission : TestBase { private readonly TestUI testUI = new TestUI(); diff --git a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestPermissions.cs b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestPermissions.cs index fc78268c5..450c3d1f8 100644 --- a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestPermissions.cs +++ b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestPermissions.cs @@ -14,7 +14,7 @@ * limitations under the License */ -namespace Tizen.PrivacyPrivilegeManager.Manual.Tests.testcase +namespace Tizen.PrivacyPrivilegeManager.Manual.Tests { using global::System; using global::System.Threading.Tasks; @@ -25,6 +25,8 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests.testcase /// Contains class /// It is used test if works as expected. /// + [TestFixture] + [Description("Tizen.PrivacyPrivilegeManager Manual test")] class TSRequestPermissions : TestHelpers { diff --git a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestResponseEventArgs.cs b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestResponseEventArgs.cs index cb76cbf6c..0ae58c14a 100644 --- a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestResponseEventArgs.cs +++ b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestResponseEventArgs.cs @@ -25,7 +25,9 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests /// Contains class /// It is used test if works as expected. /// - class TSRequestResponseEventArgs + [TestFixture] + [Description("Tizen.PrivacyPrivilegeManager Manual test")] + public class TSRequestResponseEventArgs { /// /// Initializes environment before TCT test runs.