From: raycad Date: Thu, 31 May 2018 09:24:02 +0000 (+0700) Subject: [ManualTemplate][Non-ACR] Adding confirm fail api and fix some buttons locked X-Git-Tag: tct5.0_m2~205 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b630173a05f71929db7ac34be289522f137b58a;p=test%2Ftct%2Fcsharp%2Fapi.git [ManualTemplate][Non-ACR] Adding confirm fail api and fix some buttons locked Change-Id: I21af4908319060cd6e5c50fba8e8d42f5a29f10f --- diff --git a/tct-suite-vs/Template/ManualTemplate/TestPage.cs b/tct-suite-vs/Template/ManualTemplate/TestPage.cs old mode 100644 new mode 100755 index a7f1281..524ccff --- a/tct-suite-vs/Template/ManualTemplate/TestPage.cs +++ b/tct-suite-vs/Template/ManualTemplate/TestPage.cs @@ -164,6 +164,9 @@ namespace NUnit.Framework _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) diff --git a/tct-suite-vs/Template/ManualTemplate/Utils.cs b/tct-suite-vs/Template/ManualTemplate/Utils.cs index a93de67..9741edc 100755 --- a/tct-suite-vs/Template/ManualTemplate/Utils.cs +++ b/tct-suite-vs/Template/ManualTemplate/Utils.cs @@ -297,6 +297,21 @@ namespace NUnit.Framework } } + public static async Task ConfirmFail(String message) + { + if (IsWearable()) + { + await WearableTemplate.ManualTest.ConfirmFail(message); + } + else + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "[Common] ConfirmFail(String message)"); + TestPage.GetInstance().UnlockUIButton(); + await Task.Delay(2000); + Assert.Fail(message); + } + } + public static bool IsMobile() { string value; @@ -335,7 +350,7 @@ namespace NUnit.Framework public static void DisplayLabel(String msg) { - if(IsWearable()) + if (IsWearable()) { WearableTemplate.ManualTest.DisplayLabel(msg); } diff --git a/tct-suite-vs/Template/ManualTemplateForWearable/TestPage.cs b/tct-suite-vs/Template/ManualTemplateForWearable/TestPage.cs index 9f0aedf..365845f 100755 --- a/tct-suite-vs/Template/ManualTemplateForWearable/TestPage.cs +++ b/tct-suite-vs/Template/ManualTemplateForWearable/TestPage.cs @@ -176,6 +176,9 @@ namespace WearableTemplate _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) diff --git a/tct-suite-vs/Template/ManualTemplateForWearable/Utils.cs b/tct-suite-vs/Template/ManualTemplateForWearable/Utils.cs index 951ed35..c4a152f 100755 --- a/tct-suite-vs/Template/ManualTemplateForWearable/Utils.cs +++ b/tct-suite-vs/Template/ManualTemplateForWearable/Utils.cs @@ -21,7 +21,7 @@ using System.Collections.Generic; using System.ComponentModel; using Xamarin.Forms; using WearableTemplate; - +using NUnit.Framework; namespace WearableTemplate { @@ -269,6 +269,13 @@ namespace WearableTemplate Confirmed = true; } + public static async Task ConfirmFail(String message) + { + TestPage.GetInstance().UnlockUIButton(); + await Task.Delay(2000); + Assert.Fail(message); + } + public static void DisplayLabel(String msg) { var _testPage = TestPage.GetInstance();