From 58ff97bd6889106e38b98f47cca29742762e9307 Mon Sep 17 00:00:00 2001 From: "huiyu.eun" Date: Thu, 7 Oct 2021 15:48:30 +0900 Subject: [PATCH] [NUI][Non-ACR][TSDF-4064] Lock UI while running test https://code.sec.samsung.net/jira/browse/TSDF-4064 Block the button from being pressed several times. Change-Id: I1b25af10e5ef292844545c68b0cfc99e83524243 Signed-off-by: huiyu.eun --- tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs | 11 +++++++++++ tct-suite-vs/Tizen.NUI.Manual.Tests/Utils.cs | 13 ++++++++++++- .../Tizen.NUI.Manual.Tests/WearableManualTestPage.cs | 11 +++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs index 56758e1..32b6711 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs @@ -232,6 +232,16 @@ namespace Tizen.NUI.Tests 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) @@ -517,6 +527,7 @@ namespace Tizen.NUI.Tests SetCommonButtonStyle(_runButton, "Run"); _runButton.Clicked += (obj, ee) => { + LockUIButton(); Clear(); //should update the _caseView by the test case _tsettings.Testcase_ID = _tcIDList[_currentTCNum]; diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/Utils.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/Utils.cs index ae6ca51..ed25d35 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/Utils.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/Utils.cs @@ -21,7 +21,8 @@ using System.Collections.Generic; using System.ComponentModel; using Tizen.NUI.BaseComponents; using Tizen.NUI; - +using Tizen.NUI.Components; + namespace Tizen.NUI.Tests { @@ -168,12 +169,22 @@ namespace Tizen.NUI.Tests { 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() diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs index d9cd50a..d0b33c7 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs @@ -424,6 +424,7 @@ namespace Tizen.NUI.Tests _runButton.Position = new Position(216, 0); _runButton.Clicked += (obj, ee) => { + LockUIButton(); Clear(); _tsettings.Testcase_ID = _tcIDList[_currentTCNum]; _tsettings.TCResult = ""; @@ -711,6 +712,16 @@ namespace Tizen.NUI.Tests } SetSummaryResult(); _notRun.Text = _listItem[_currentTCNum].Result; + } + + public void LockUIButton() + { + _runButton.IsEnabled = false; + } + + public void UnlockUIButton() + { + _runButton.IsEnabled = true; } } } -- 2.7.4