[PrivacyPrivilegeManager][Non-ACR]Fix to run in wearable profile 58/209158/7
authorYunjin Lee <yunjin-.lee@samsung.com>
Wed, 3 Jul 2019 05:01:39 +0000 (14:01 +0900)
committerYunjin Lee <yunjin-.lee@samsung.com>
Thu, 4 Jul 2019 10:40:14 +0000 (19:40 +0900)
- Removed TestUI and modify it to run in wearable profile
- Fixed pre/post condition description because menutree of settings app
can be different between mobile and wearable

Change-Id: Ic0f53a2eb40a59ec19affb0d3c1900aa1d259d15
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
12 files changed:
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSCheckPermission.cs [changed mode: 0644->0755]
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSCheckPermissions.cs [changed mode: 0644->0755]
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSGetResponseContext.cs
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSPermissionRequestResponse.cs [changed mode: 0644->0755]
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestMultipleResponseEventArgs.cs [changed mode: 0644->0755]
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestPermission.cs [changed mode: 0644->0755]
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestPermissions.cs
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/TSRequestResponseEventArgs.cs [changed mode: 0644->0755]
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/support/Constans.cs [changed mode: 0644->0755]
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/support/TestBase.cs [changed mode: 0644->0755]
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/support/TestHelpers.cs [deleted file]
tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/support/TestUI.cs [deleted file]

old mode 100644 (file)
new mode 100755 (executable)
index fe6b329..24abd1c
@@ -40,9 +40,9 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         private CheckResult _correctResult;
 
         /// <summary>
-        /// Holds information if ArgumentException is expected
+        /// Holds information about expected error status for testcase
         /// </summary>
-        private bool _expectedArgumentException;
+        private string _correctException;
 
         /// <summary>
         /// Initializes environment before TCT test runs.
@@ -50,11 +50,11 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [SetUp]
         public void Init()
         {
-            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0)
+            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0 && Profile.GetProfile().CompareTo(Profile.WearableProfile) != 0)
             {
                 Assert.Pass("Privacy privileges not supported");
             }
-
+            _correctException = "";
             LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
         }
 
@@ -65,31 +65,57 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         {
             foreach (string privilege in _privileges)
             {
-                CheckResult result = CheckPermission(privilege, _expectedArgumentException);
-                Color backgroundColor = Color.Green;
-                string labelText = " Privilege: \n" + privilege + "\nStatus: " + result;
-                Assert.IsFalse(ErrorOccured, "Error occured during CheckPermission test: " + ErrorMessage);
-                Assert.AreEqual(result, _correctResult, "wrong result for privilege: " + privilege + " expected " + _correctResult + " and got: " + result);
+                CheckResult result = CheckPermission(privilege);
+                if (!(_correctException == null || _correctException == ""))
+                {
+                    Assert.IsTrue(ErrorOccured, "Expected " + _correctException + " but not occurred ");
+                    Assert.AreEqual(_correctException, ExceptionName, "Expected " + _correctException + " but " + ExceptionName + " occurred");
+                }
+                else if (ErrorOccured)
+                {
+                    Assert.Fail("Unexpected exception occured : " + ExceptionName);
+                }
+                Assert.AreEqual(result, _correctResult, "Wrong result for privilege: " + privilege + " expected " + _correctResult + " and got: " + result);
             }
         }
 
         [Test]
         [Category("P1")]
-        [Description("Test: Check if CheckPermission method works.")]
+        [Description("Test: Check if CheckPermission method works and can get status of allowed privilege.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.CheckPermission M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "EVL")]
-        [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t ALLOW")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t ALLOW")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t ALLOW")]
+        [Step(1, " Click Run button")]
+        [Postcondition(1, "NA")]
+        public void CheckPermission_REAL_PRIVILEGES_ALLOW()
+        {
+            _privileges = Constans.Privileges;
+            _correctResult = CheckResult.Allow;
+            Check();
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test: Check if CheckPermission method works and can get status of askable privilege.")]
+        [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.CheckPermission M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "EVL")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Step(1, " Click Run button")]
         [Postcondition(1, "NA")]
-        public void CheckPermission_REAL_PRIVILEGES()
+        public void CheckPermission_REAL_PRIVILEGES_ASK()
         {
-            _expectedArgumentException = false;
             _privileges = Constans.Privileges;
             _correctResult = CheckResult.Ask;
             Check();
@@ -97,35 +123,57 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
 
         [Test]
         [Category("P1")]
+        [Description("Test: Check if CheckPermission method works and can get status of denied privilege.")]
+        [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.CheckPermission M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "EVL")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t DENY")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t DENY")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t DENY")]
+        [Step(1, " Click Run button")]
+        [Postcondition(1, "NA")]
+        public void CheckPermission_REAL_PRIVILEGES_DENY()
+        {
+            _privileges = Constans.Privileges;
+            _correctResult = CheckResult.Deny;
+            Check();
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Test: Check if CheckPermission method works with long string.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.CheckPermission M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MAC")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void CheckPermission_LONG_STRING()
         {
-            _expectedArgumentException = false;
             _privileges = new string[] { Constans.LongString };
             _correctResult = CheckResult.Deny;
             Check();
         }
 
         [Test]
-        [Category("P1")]
-        [Description("Test: Check if CheckPermission method works with empty string.")]
+        [Category("P2")]
+        [Description("Test: Check if CheckPermission method throws ArgumentException when empty string is given.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.CheckPermission M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void CheckPermission_STRING_EMPTY()
         {
-            _expectedArgumentException = true;
+            _correctException = "ArgumentException";
             _privileges = new string[] { Constans.Empty };
             _correctResult = CheckResult.Deny;
             Check();
@@ -138,12 +186,12 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MAC")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void CheckPermission_NON_EXISTING()
         {
-            _expectedArgumentException = false;
             _privileges = new string[] { Constans.NoExisting };
             _correctResult = CheckResult.Deny;
             Check();
@@ -156,12 +204,12 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MAC")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void CheckPermission_RANDOM_LETTER_CASE_PRIVILEGE()
         {
-            _expectedArgumentException = false;
             _privileges = new string[] { Constans.RandomLetterCasePrivilege };
             _correctResult = CheckResult.Deny;
             Check();
@@ -174,30 +222,31 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MAC")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void CheckPermission_SPECIAL_CHARACTERS()
         {
-            _expectedArgumentException = false;
             _privileges = new string[] { Constans.SpecialCharacters };
             _correctResult = CheckResult.Deny;
             Check();
         }
 
         [Test]
-        [Category("P1")]
-        [Description("Test: Check if CheckPermission method works with string.null.")]
+        [Category("P2")]
+        [Description("Test: Check if CheckPermission method throws ArgumentException when null string is given.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.CheckPermission M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void CheckPermission_STRING_NULL()
         {
-            _expectedArgumentException = true;
+            _correctException = "ArgumentException";
             _privileges = new string[] { Constans.Null };
             _correctResult = CheckResult.Deny;
             Check();
@@ -210,12 +259,12 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MAC")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void CheckPermission_UPPER_LETTER_CASE_PRIVILEGE()
         {
-            _expectedArgumentException = false;
             _privileges = new string[] { Constans.UpperLetterCasePrivilege };
             _correctResult = CheckResult.Deny;
             Check();
old mode 100644 (file)
new mode 100755 (executable)
index eba37ed..42e84e7
@@ -45,7 +45,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [SetUp]
         public void Init()
         {
-            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0)
+            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0 && Profile.GetProfile().CompareTo(Profile.WearableProfile) != 0)
             {
                 Assert.Pass("Privacy privileges not supported");
             }
@@ -59,28 +59,11 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         private void Check()
         {
             CheckResult[] results = CheckPermissions(_privileges);
-            Color backgroundColor = Color.Green;
-
-            string labelText = "";
-            if (ErrorOccured)
-            {
-                labelText += "\n" + ErrorMessage;
-                backgroundColor = Color.Red;
-                Assert.Fail("Error occured during CheckPermissions test");
-            }
-            else
+            Assert.IsFalse(ErrorOccured, "Unexpected error occurred: " + ExceptionName);
+            for (int it = 0; it < _privileges.Length; ++it)
             {
-                for (int it = 0; it < _privileges.Length; ++it)
-                {
-                    if (results[it] != _correctResult)
-                    {
-                        backgroundColor = Color.Red;
-                        Assert.Fail("Wrong CheckPermissions status:\nPrivilege: \n" + _privileges[it] + "\nStatus: " + results[it]);
-                    }
-                    labelText += "\n Privilege: \n" + _privileges[it] + "\nStatus: " + results[it];
-                }
+                Assert.AreEqual(results[it], _correctResult, "Wrong CheckPermissions result for " + _privileges[it] + "\nExpected: " + _correctResult + " but " + results[it] + " returned");
             }
-
         }
 
         [Test]
@@ -90,12 +73,13 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Step(1, " Click Run button")]
         public void CheckPermissions_REAL_PRIVILEGES()
         {
             _correctResult = CheckResult.Ask;
@@ -110,12 +94,13 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Step(1, " Click Run button")]
         public void CheckPermissions_REAL_PRIVILEGES_WITH_DUPLICATES()
         {
             _correctResult = CheckResult.Ask;
@@ -132,12 +117,8 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Step(1, " Click Run button")]
         public void CheckPermissions_FAKE_PRIVILEGES()
         {
             _correctResult = CheckResult.Deny;
index d98340e..1bfcbf7 100755 (executable)
@@ -28,21 +28,31 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
     /// </summary>
     [TestFixture]
     [Description("Tizen.PrivacyPrivilegeManager Manual test")]
-    public class TSGetResponseContext : TestHelpers
+    public class TSGetResponseContext : TestBase
     {
+
+        private RequestResult _correctResponse;
+        private static bool _requestAdditionalPrivilegesInCallback = false;
+        private int _responseCount = 0;
+
+        /// <summary>
+        /// Holds privilege that will be tested
+        /// </summary>
+        private string[] _privileges;
+
         /// <summary>
         /// Initializes environment before TCT test runs.
         /// </summary>
         [SetUp]
         public void Init()
         {
-            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0)
+            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0 && Profile.GetProfile().CompareTo(Profile.WearableProfile) != 0)
             {
                 Assert.Pass("Privacy privileges not supported");
             }
-
+            _requestAdditionalPrivilegesInCallback = false;
+            _responseCount = 0;
             LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
-            executeCount = 1;
         }
 
         /// <summary>
@@ -59,30 +69,39 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         }
 
         /// <summary>
-        /// Handles catching PrivilegeManager responses.
+        /// Handles catched PrivacyPrivilegeManager's single privilege request responses.
         /// </summary>
         /// <param name="sender">Sender object</param>
         /// <param name="e">Event arguments</param>
-        private void PPM_RequestResponse(object sender, RequestResponseEventArgs e)
+        private void PPMRequestResponse(object sender, RequestResponseEventArgs e)
         {
+            _responseCount++;
             if (e.cause == CallCause.Answer)
             {
-                executeCount++;
-                LogPrivilegeRequestResponse(e.privilege, e.result);
+                LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "For privilege: " + e.privilege + " expected " + _correctResponse + " and got: " + e.result);
+                if (e.result != _correctResponse)
+                {
+                    ManualTest.ConfirmFail("Wrong result for privilege: " + e.privilege + " expected " + _correctResponse + " and got: " + e.result);
+                }
+                else
+                {
+                    if (_responseCount == _privileges.Length)
+                        ManualTest.Confirm();
+                }
             }
             else
             {
-                LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "Error occured during requesting permission for " + e.privilege);
+                LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "Unexpected CallCause returned: " + e.cause);
+                ManualTest.ConfirmFail("Unexpected CallCause returned: " + e.cause);
             }
             DestroyPPMHandler(e.privilege);
-            ChangeButtonState(true);
         }
 
         /// <summary>
-        /// Setups event handler for catching PrivilegeManager responses.
+        /// Setups event handler for catching PrivacyPrivilegeManager's single privilege request responses.
         /// </summary>
         /// <param name="privilege">Privilege name</param>
-        protected override void SetupPPMHandler(string privilege)
+        private void SetupPPMHandler(string privilege)
         {
             if (privilege == null)
             {
@@ -90,31 +109,19 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
             }
             if (PrivacyPrivilegeManager.GetResponseContext(privilege).TryGetTarget(out PrivacyPrivilegeManager.ResponseContext context))
             {
-                context.ResponseFetched += PPM_RequestResponse;
-                context.ResponseFetched -= PPM_RequestResponse;
-                context.ResponseFetched += PPM_RequestResponse;
-                if (PrivacyPrivilegeManager.GetResponseContext(privilege).TryGetTarget(out PrivacyPrivilegeManager.ResponseContext context2))
-                {
-                    context.ResponseFetched -= PPM_RequestResponse;
-                    context2.ResponseFetched += PPM_RequestResponse;
-                    GC.Collect();
-                    GC.WaitForPendingFinalizers();
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "Error occured during Settuping second ppm handler permission for " + privilege);
-                }
+                context.ResponseFetched += PPMRequestResponse;
             }
             else
             {
-                LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "Error occured during Settuping ppm handler permission for " + privilege);
+                LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "Unexpected error occurred while setting up ppm handler for " + privilege);
+                ManualTest.ConfirmFail("Unexpected error occurred while setting up ppm handler for " + privilege);
             }
             GC.Collect();
             GC.WaitForPendingFinalizers();
         }
 
         /// <summary>
-        /// Destroys hander for PrivilegeManager single privilege request response
+        /// Destroys handler for PrivacyPrivilegeManager's single privilege request response
         /// </summary>
         /// <param name="privilege">Privilege with subscribled handler</param>
         private void DestroyPPMHandler(string privilege)
@@ -125,301 +132,241 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
             }
             if (PrivacyPrivilegeManager.GetResponseContext(privilege).TryGetTarget(out PrivacyPrivilegeManager.ResponseContext context))
             {
-                context.ResponseFetched -= PPM_RequestResponse;
+                context.ResponseFetched -= PPMRequestResponse;
             }
         }
 
         /// <summary>
-        /// Handles Buttons OnClick event.
+        /// Request permission for privilges one by one and set handler to check the user response for each privilege
         /// </summary>
-        /// <param name="sender">Sender</param>
-        /// <param name="e">Event arguments</param>
-        private void OnClick(object sender, EventArgs e)
+        private void SRequest()
         {
-            ChangeButtonState(false);
-            Check(_privileges);
+            foreach (string privilege in _privileges)
+            {
+                SetupPPMHandler(privilege);
+                RequestPermission(privilege);
+
+                if (ErrorOccured)
+                {
+                    LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "error occurred : " + ErrorMessage);
+                    ManualTest.ConfirmFail("Unexpected " + ExceptionName + " occurred while calling RequestPermission()");
+                }
+            }
         }
 
         /// <summary>
-        /// Handles Buttons OnClickMultiple event.
+        /// Request permission for multiple privileges at once and check the user response value
         /// </summary>
-        /// <param name="sender">Sender</param>
-        /// <param name="e">Event arguments</param>
-        private async void OnClickMultiple(object sender, EventArgs e)
+        protected async Task CheckMultiple(string[] privileges)
+        {
+            RequestMultipleResponseEventArgs request = null;
+
+            try
+            {
+                int responseCount = 0;
+                request = await PrivacyPrivilegeManager.RequestPermissions(privileges);
+                if (request.Cause == CallCause.Error)
+                {
+                    LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "Unexpected CallCause returned: " + request.Cause);
+                    Assert.Fail("Unexpected CallCause returned: " + request.Cause);
+                }
+                responseCount = 0;
+                foreach (PermissionRequestResponse response in request.Responses)
+                {
+                    responseCount++;
+                    Assert.AreEqual(_correctResponse, response.Result, "Wrong result for privilege: " + response.Privilege + " expected " + _correctResponse + " and got: " + response.Result);
+                }
+
+                Assert.AreNotEqual(0, responseCount, "There must be no asking popup and user response. Check whether the precondition of the test is properly set.");
+
+                if (_requestAdditionalPrivilegesInCallback)
+                {
+                    _privileges = Constans.SecondaryPrivileges;
+                    _requestAdditionalPrivilegesInCallback = false;
+                    await CheckMultiple(_privileges);
+                }
+            }
+            catch (Exception ex)
+            {
+                LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "error occurred : " + ex.Message);
+                Assert.Fail("Unexpected exception occured : " + ex.GetType().Name);
+            }
+        }
+
+        private async Task MRequest()
         {
-            ChangeButtonState(false);
             await CheckMultiple(_privileges);
         }
 
+        private async Task MRequest_Async()
+        {
+            await CheckMultiple(Constans.Privileges);
+            await CheckMultiple(Constans.SecondaryPrivileges);
+        }
 
         [Test]
         [Category("P1")]
-        [Description("Test: Check if popup works.")]
+        [Description("Test: Check whether popup works and user response is properly received.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.ResponseContext.ResponseFetched E")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "EVL")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
-        [Step(2, " Click button")]
-        [Step(3, " Allow Privileges")]
-        [Step(4, " Click button")]
-        [Step(5, " Check Logs output (inside program)")]
-        [Step(6, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: Ask")]
-        [Step(7, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: Ask")]
-        [Step(8, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: Ask")]
-        [Step(9, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: AllowForever")]
-        [Step(10, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: AllowForever")]
-        [Step(11, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: AllowForever")]
-        [Step(12, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: Allow")]
-        [Step(13, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: Allow")]
-        [Step(14, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: Allow")]
-        [Postcondition(1, " Open Settings")]
-        [Postcondition(2, " Open \"Privacy and security\"")]
-        [Postcondition(3, " Open \"Privacy settings\"")]
-        [Postcondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Postcondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Step(1, " Click Run button")]
+        [Step(2, " Click Allow button for 3 asking popups -2 Accounts and 1 Call-")]
+        [Postcondition(1, " Open terminal and enter following commands:")]
+        [Postcondition(2, " sdb root on")]
+        [Postcondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Postcondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Postcondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
         public async Task ResponseFetched_GET_RESPONSE_CONTEXT()
         {
-            CreateLayout();
+            _correctResponse = RequestResult.AllowForever;
             _privileges = Constans.Privileges;
-            _button.Clicked += OnClick;
-            //// Waits for user confirmation.
+            SRequest();
             await ManualTest.WaitForConfirm();
-            _button.Clicked -= OnClick;
         }
 
         [Test]
         [Category("P1")]
-        [Description("Test: Check if popup works.")]
+        [Description("Test: Check whether popup works and user response is properly received.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.MultipleResponseContext.ResponseFetched E")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "EVL")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
-        [Step(2, " Click button")]
-        [Step(3, " Allow Privileges")]
-        [Step(4, " Click button")]
-        [Step(5, " Check Logs output (inside program)")]
-        [Step(6, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: Ask")]
-        [Step(7, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: Ask")]
-        [Step(8, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: Ask")]
-        [Step(9, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: AllowForever")]
-        [Step(10, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: AllowForever")]
-        [Step(11, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: AllowForever")]
-        [Step(12, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: Allow")]
-        [Step(13, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: Allow")]
-        [Step(14, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: Allow")]
-        [Postcondition(1, " Open Settings")]
-        [Postcondition(2, " Open \"Privacy and security\"")]
-        [Postcondition(3, " Open \"Privacy settings\"")]
-        [Postcondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Postcondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Step(1, " Click Run button")]
+        [Step(2, " Click Allow button for all asking popups")]
+        [Postcondition(1, " Open terminal and enter following commands:")]
+        [Postcondition(2, " sdb root on")]
+        [Postcondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Postcondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Postcondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
         public async Task ResponseFetched_GET_MULTIPLE_RESPONSE_CONTEXT()
         {
-            CreateLayout();
+            _correctResponse = RequestResult.AllowForever;
             _privileges = Constans.Privileges;
-            _button.Clicked += OnClickMultiple;
-            //// Waits for user confirmation.
-            await ManualTest.WaitForConfirm();
-            _button.Clicked -= OnClickMultiple;
+            await MRequest();
         }
 
         [Test]
         [Category("P1")]
-        [Description("Test: Check if popup works.")]
+        [Description("Test: Check whether popup works and user response is properly received.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.MultipleResponseContext.ResponseFetched E")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "EVL")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(6, "Open \"Location\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(7, "Open \"Contacts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
-        [Step(2, " Click button")]
-        [Step(3, " Allow Privileges")]
-        [Step(4, " Check Logs output (inside program)")]
-        [Step(5, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: Ask")]
-        [Step(6, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: Ask")]
-        [Step(7, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: Ask")]
-        [Step(8, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: AllowForever")]
-        [Step(9, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: AllowForever")]
-        [Step(10, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: AllowForever")]
-        [Step(11, " Good output: Privilege:\nhttp://tizen.org/privilege/contact.read\nStatus:Ask")]
-        [Step(12, " Good output: Privilege:\nhttp://tizen.org/privilege/contact.write\nStatus:Ask")]
-        [Step(13, " Good output: Privilege:\nhttp://tizen.org/privilege/download\nStatus:Allow")]
-        [Step(14, " Good output: Privilege:\nhttp://tizen.org/privilege/location\nStatus:Ask")]
-        [Step(15, " Good output: Privilege:\nhttp://tizen.org/privilege/contact.read\nStatus: AllowForever")]
-        [Step(16, " Good output: Privilege:\nhttp://tizen.org/privilege/contact.write\nStatus: AllowForever")]
-        [Step(17, " Good output: Privilege:\nhttp://tizen.org/privilege/location\nStatus: AllowForever")]
-        [Postcondition(1, " Open Settings")]
-        [Postcondition(2, " Open \"Privacy and security\"")]
-        [Postcondition(3, " Open \"Privacy settings\"")]
-        [Postcondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Postcondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Postcondition(6, "Open \"Location\" and uncheck Tizen.Security.PrivacyManager")]
-        [Postcondition(7, "Open \"Contacts\" and uncheck Tizen.Security.PrivacyManager")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Precondition(6, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/location -t 0xA")]
+        [Precondition(7, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/contact.read -t 0xA")]
+        [Step(1, " Click Run button")]
+        [Step(2, " Click Allow button for all asking popups")]
+        [Postcondition(1, " Open terminal and enter following commands:")]
+        [Postcondition(2, " sdb root on")]
+        [Postcondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Postcondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Postcondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Postcondition(6, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/location -t 0xA")]
+        [Postcondition(7, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/contact.read -t 0xA")]
         public async Task ResponseFetched_GET_MULTIPLE_RESPONSE_CONTEXT_SECOND_REQUEST()
         {
-            requestAdditionalPrivilegesInCallback = true;
-            CreateLayout();
+            _requestAdditionalPrivilegesInCallback = true;
+            _correctResponse = RequestResult.AllowForever;
             _privileges = Constans.Privileges;
-            _button.Clicked += OnClickMultiple;
-            //// Waits for user confirmation.
-            await ManualTest.WaitForConfirm();
-            _button.Clicked -= OnClickMultiple;
+            await MRequest();
         }
 
         [Test]
         [Category("P1")]
-        [Description("Test: Check if popup works.")]
+        [Description("Test: Check whether popup works and user response is properly received.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.MultipleResponseContext.ResponseFetched E")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "EVL")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
-        [Step(2, " Click button")]
-        [Step(3, " Allow Privileges")]
-        [Step(4, " Click button")]
-        [Step(5, " Check Logs output (inside program)")]
-        [Step(6, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: Ask")]
-        [Step(7, " Good output: privilege:\nhttp://tizen.org/privilege/account.write\nstatus: Ask")]
-        [Step(8, " Good output: privilege:\nhttp://tizen.org/privilege/call\nstatus: Ask")]
-        [Step(9, " Good output: Privilege:\nhttp://tizen.org/privilege/contact.read\nStatus: Ask")]
-        [Step(10, " Good output: privilege:\nhttp://tizen.org/privilege/contact.write\nstatus: Ask")]
-        [Step(11, " Good output: privilege:\nhttp://tizen.org/privilege/download\nstatus: Allow")]
-        [Step(12, " Good output: privilege:\nhttp://tizen.org/privilege/location\nstatus: Ask")]
-        [Step(13, " Good output: privilege:\nhttp://tizen.org/privilege/account.read\nstatus: AllowForever")]
-        [Step(14, " Good output: privilege:\nhttp://tizen.org/privilege/account.write\nstatus: AllowForever")]
-        [Step(15, " Good output: privilege:\nhttp://tizen.org/privilege/call\nstatus: AllowForever")]
-        [Step(16, " Good output: privilege:\nhttp://tizen.org/privilege/contact.read\nstatus: AllowForever")]
-        [Step(17, " Good output: privilege:\nhttp://tizen.org/privilege/contact.write\nstatus: AllowForever")]
-        [Step(18, " Good output: privilege:\nhttp://tizen.org/privilege/location\nstatus: AllowForever")]
-        [Step(19, " Good output: privilege:\nhttp://tizen.org/privilege/account.read\nstatus: Allow")]
-        [Step(20, " Good output: privilege:\nhttp://tizen.org/privilege/account.write\nstatus: Allow")]
-        [Step(21, " Good output: privilege:\nhttp://tizen.org/privilege/call\nstatus: Allow")]
-        [Step(22, " Good output: privilege:\nhttp://tizen.org/privilege/contact.read\nstatus: Allow")]
-        [Step(23, " Good output: privilege:\nhttp://tizen.org/privilege/contact.write\nstatus: Allow")]
-        [Step(24, " Good output: privilege:\nhttp://tizen.org/privilege/download\nstatus: Allow")]
-        [Step(25, " Good output: privilege:\nhttp://tizen.org/privilege/location\nstatus: Allow")]
-        [Postcondition(1, " Open Settings")]
-        [Postcondition(2, " Open \"Privacy and security\"")]
-        [Postcondition(3, " Open \"Privacy settings\"")]
-        [Postcondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Postcondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Postcondition(1, " Open terminal and enter following commands:")]
+        [Postcondition(2, " sdb root on")]
+        [Postcondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Postcondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Postcondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
         public async Task ResponseFetched_GET_MULTIPLE_RESPONSE_CONTEXT_MULTI_REQUESTS()
         {
-            CreateLayout();
-            _button.Clicked += OnClickMultipleRequestsAsync;
-            //// Waits for user confirmation.
-            await ManualTest.WaitForConfirm();
-            _button.Clicked -= OnClickMultipleRequestsAsync;
-        }
-
-        /// <summary>
-        /// Executes multiple requests test case
-        /// </summary>
-        /// <param name="sender">Sender</param>
-        /// <param name="e">Event</param>
-        private async void OnClickMultipleRequestsAsync(object sender, EventArgs e)
-        {
-            ChangeButtonState(false);
-            await CheckMultiple(Constans.Privileges);
-            await CheckMultiple(Constans.SecondaryPrivileges);
+            _correctResponse = RequestResult.AllowForever;
+            await MRequest_Async();
         }
 
         [Test]
         [Category("P1")]
-        [Description("Test: Check if popup will appear again after DenyOnce.")]
+        [Description("Test: Check whether popup works and user response is properly received.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.GetResponseContext M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
-        [Step(2, " Click button")]
-        [Step(3, " Deny forever Privileges (check \"Don`t repeat\" and click \"deny\" button)")]
-        [Step(4, " Click button")]
-        [Step(5, " Check Logs output (inside program)")]
-        [Step(6, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: Ask")]
-        [Step(7, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: Ask")]
-        [Step(8, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: Ask")]
-        [Step(9, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: DenyForever")]
-        [Step(10, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: DenyForever")]
-        [Step(11, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: DenyForever")]
-        [Postcondition(1, " Open Settings")]
-        [Postcondition(2, " Open \"Privacy and security\"")]
-        [Postcondition(3, " Open \"Privacy settings\"")]
-        [Postcondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Postcondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " This testcase doesn't support wearable profile. In wearable profile, just clicking Run button then it will pass.")]
+        [Precondition(2, " Open terminal and enter following commands:")]
+        [Precondition(3, " sdb root on")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Precondition(6, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Step(1, " Click Run button")]
+        [Step(2, " Check 'Don't repeat' checkbox and click Deny button for 3 asking popups -2 Accounts and 1 Call-")]
+        [Postcondition(1, " Open terminal and enter following commands:")]
+        [Postcondition(2, " sdb root on")]
+        [Postcondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Postcondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Postcondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
         public async Task GetResponseContext_DENY_FOREVER()
         {
-            CreateLayout();
+            if (Profile.GetProfile().CompareTo(Profile.WearableProfile) == 0)
+                Assert.Pass("This testcase is not supported in wearable profile.");
             _privileges = Constans.Privileges;
-            _button.Clicked += OnClick;
-            //// Waits for user confirmation.
+            _correctResponse = RequestResult.DenyForever;
+            SRequest();
             await ManualTest.WaitForConfirm();
-            _button.Clicked -= OnClick;
         }
 
         [Test]
         [Category("P1")]
-        [Description("Test: Check if popup will appear again after DenyOnce.")]
+        [Description("Test: Check whether popup works and user response is properly received.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.GetResponseContext M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
-        [Step(2, " Click button")]
-        [Step(3, " Deny once Privileges(do not check \"Don't repeat\" and click \"deny\" button)")]
-        [Step(4, " Click button")]
-        [Step(5, " Check Logs output (inside program)")]
-        [Step(6, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: Ask")]
-        [Step(7, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: Ask")]
-        [Step(8, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: Ask")]
-        [Step(9, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: DenyOnce")]
-        [Step(10, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: DenyOnce")]
-        [Step(11, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: DenyOnce")]
-        [Postcondition(1, " Open Settings")]
-        [Postcondition(2, " Open \"Privacy and security\"")]
-        [Postcondition(3, " Open \"Privacy settings\"")]
-        [Postcondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Postcondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Step(1, " Click Run button")]
+        [Step(2, " Click Deny button for 3 asking popups -2 Accounts and 1 Call-")]
         public async Task GetResponseContext_DENY_ONCE()
         {
-            CreateLayout();
             _privileges = Constans.Privileges;
-            _button.Clicked += OnClick;
-            //// Waits for user confirmation.
+            _correctResponse = RequestResult.DenyOnce;
+            SRequest();
             await ManualTest.WaitForConfirm();
-            _button.Clicked -= OnClick;
         }
     }
 }
old mode 100644 (file)
new mode 100755 (executable)
index eb4f75e..9d3c0a6
@@ -30,7 +30,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [SetUp]
         public void Init()
         {
-            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0)
+            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0 && Profile.GetProfile().CompareTo(Profile.WearableProfile) != 0)
             {
                 Assert.Pass("Privacy privileges not supported");
             }
@@ -46,8 +46,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("CRITERIA", "CONSTR")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void PermissionRequestResponse_CONSTRUCTOR()
         {
@@ -71,8 +70,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("CRITERIA", "PRO")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void Result_READ_ONLY()
         {
@@ -97,8 +95,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("CRITERIA", "PRO")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void Privilege_READ_ONLY()
         {
old mode 100644 (file)
new mode 100755 (executable)
index 781ef02..d1ba2c6
@@ -35,7 +35,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [SetUp]
         public void Init()
         {
-            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0)
+            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0 && Profile.GetProfile().CompareTo(Profile.WearableProfile) != 0)
             {
                 Assert.Pass("Privacy privileges not supported");
             }
@@ -51,8 +51,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("CRITERIA", "CONSTR")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void RequestMultipleResponseEventArgs_CONSTRUCTOR()
         {
@@ -76,8 +75,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("CRITERIA", "PRO")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void Cause_READ_ONLY()
         {
@@ -102,8 +100,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("CRITERIA", "PRO")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void Responses_READ_ONLY()
         {
old mode 100644 (file)
new mode 100755 (executable)
index e05ac0c..8a76be7
@@ -23,6 +23,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
     using NUnit.Framework.TUnit;
 
 
+
     /// <summary>
     /// Contains <see cref="TSRequestPermission"/> class
     /// <para>It is used test if <see cref="Tizen.Security.PrivacyPrivilegeManager.RequestPermission(string)" /> works as expected.</para>
@@ -31,17 +32,15 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
     [Description("Tizen.PrivacyPrivilegeManager Manual test")]
     public class TSRequestPermission : TestBase
     {
-        private readonly TestUI testUI = new TestUI();
-        //private readonly TestBase testBase = new TestBase();
         /// <summary>
         /// Holds privilege that will be tested
         /// </summary>
         private string[] _privileges;
 
         /// <summary>
-        /// Holds information about expected error status for testcase
+        /// Holds information about expected exception for testcase
         /// </summary>
-        protected bool _expectError = false;
+        private string _correctException;
 
         /// <summary>
         /// Initializes environment before TCT test runs.
@@ -49,44 +48,29 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [SetUp]
         public void Init()
         {
-            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0)
+            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0 && Profile.GetProfile().CompareTo(Profile.WearableProfile) != 0)
             {
                 Assert.Pass("Privacy privileges not supported");
             }
 
             LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
-            testUI.executeCount = 1;
-            _expectError = false;
+            _correctException = "";
         }
 
-        /// <summary>
-        /// Handles Buttons OnClick event.
-        /// </summary>
-        /// <param name="sender">Sender</param>
-        /// <param name="e">Event arguments</param>
-        private void OnClick(object sender, EventArgs e)
-        {
-            Request();
-        }
-
-        /// <summary>
-        /// Checks Privileges status and displays results.
-        /// </summary>
-        private void Request()
+        private void SRequest()
         {
             foreach (string privilege in _privileges)
             {
-                Color msgColor = Color.Green;
-                string labelText = "Sending request for privilege: " + privilege;
                 RequestPermission(privilege);
-
-                if (ErrorOccured)
+                if (!(_correctException == null || _correctException == ""))
+                {
+                    Assert.IsTrue(ErrorOccured, "Expected " + _correctException + " but not occurred ");
+                    Assert.AreEqual(_correctException, ExceptionName, "Expected " + _correctException + " but " + ExceptionName + " occurred");
+                }
+                else if (ErrorOccured)
                 {
-                    labelText += "\nError occured: " + ErrorMessage;
-                    if (!_expectError)
-                        msgColor = Color.Red;
+                    Assert.Fail("Unexpected exception occured : " + ExceptionName);
                 }
-                testUI.AddNewLabel(labelText, msgColor);
             }
         }
 
@@ -97,53 +81,38 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
-        [Step(2, " Click button")]
-        [Step(3, " Allow Privileges")]
-        [Step(4, " Click button")]
-        [Step(5, " Check Logs output (inside program)")]
-        [Step(6, "Three popups should appear")]
-        [Postcondition(1, " Open Settings")]
-        [Postcondition(2, " Open \"Privacy and security\"")]
-        [Postcondition(3, " Open \"Privacy settings\"")]
-        [Postcondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Postcondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        public async Task RequestPermission_REAL_PRIVILEGES()
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Step(1, " Click Run button")]
+        [Step(2, " Click Any(Deny/Allow) button for 3 asking popups -2 Accounts and 1 Call-")]
+        [Postcondition(1, " Open terminal and enter following commands:")]
+        [Postcondition(2, " sdb root on")]
+        [Postcondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Postcondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Postcondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        public void RequestPermission_REAL_PRIVILEGES()
         {
-            testUI.CreateLayout();
             _privileges = Constans.Privileges;
-            testUI._button.Clicked += OnClick;
-            await ManualTest.WaitForConfirm();
-            testUI._button.Clicked -= OnClick;
+            SRequest();
         }
 
         [Test]
-        [Category("P1")]
-        [Description("Test: Check if RequestPermission method works with empty string.")]
+        [Category("P2")]
+        [Description("Test: Check if RequestPermission method throws ArgumentException when empty string is given.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.RequestPermission M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
-        [Step(3, " Check Logs output (inside program)")]
-        [Step(4, " Good output: Privilege:\n\nStatus: Deny\nCan not check permission for .\nException message: Invalid parameter")]
-        [Step(5, " Popup should not appear")]
-        [Postcondition(1, "NA")]
-        public async Task RequestPermission_STRING_EMPTY()
+        [Step(1, " Click Run button")]
+        [Step(2, " Popup should not appear")]
+        public void RequestPermission_STRING_EMPTY()
         {
-            _expectError = true;
-            testUI.CreateLayout();
+            _correctException = "ArgumentException";
             _privileges = new string[] { Constans.Empty };
-            testUI._button.Clicked += OnClick;
-            await ManualTest.WaitForConfirm();
-            testUI._button.Clicked -= OnClick;
+            SRequest();
         }
 
         [Test]
@@ -153,19 +122,12 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MAC")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
-        [Step(3, " Check Logs output (inside program)")]
-        [Step(4, " Popup should not appear")]
-        [Postcondition(1, "NA")]
-        public async Task RequestPermission_LONG_STRING()
+        [Step(1, " Click Run button")]
+        [Step(2, " Popup should not appear")]
+        public void RequestPermission_LONG_STRING()
         {
-            testUI.CreateLayout();
             _privileges = new string[] { Constans.LongString };
-            testUI._button.Clicked += OnClick;
-            await ManualTest.WaitForConfirm();
-            testUI._button.Clicked -= OnClick;
+            SRequest();
         }
 
         [Test]
@@ -175,19 +137,12 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MAC")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
-        [Step(3, " Check Logs output (inside program)")]
-        [Step(4, " Popup should not appear")]
-        [Postcondition(1, "NA")]
-        public async Task RequestPermission_NON_EXISTING()
+        [Step(1, " Click Run button")]
+        [Step(2, " Popup should not appear")]
+        public void RequestPermission_NON_EXISTING()
         {
-            testUI.CreateLayout();
             _privileges = new string[] { Constans.NoExisting };
-            testUI._button.Clicked += OnClick;
-            await ManualTest.WaitForConfirm();
-            testUI._button.Clicked -= OnClick;
+            SRequest();
         }
 
         [Test]
@@ -197,19 +152,12 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MAC")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
-        [Step(3, " Check Logs output (inside program)")]
-        [Step(4, " Popup should not appear")]
-        [Postcondition(1, "NA")]
-        public async Task RequestPermission_RANDOM_LETTER_CASE_PRIVILEGE()
+        [Step(1, " Click Run button")]
+        [Step(2, " Popup should not appear")]
+        public void RequestPermission_RANDOM_LETTER_CASE_PRIVILEGE()
         {
-            testUI.CreateLayout();
             _privileges = new string[] { Constans.RandomLetterCasePrivilege };
-            testUI._button.Clicked += OnClick;
-            await ManualTest.WaitForConfirm();
-            testUI._button.Clicked -= OnClick;
+            SRequest();
         }
 
         [Test]
@@ -219,43 +167,28 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MAC")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
-        [Step(3, " Check Logs output (inside program)")]
-        [Step(4, " Popup should not appear")]
-        [Postcondition(1, "NA")]
-        public async Task RequestPermission_SPECIAL_CHARACTERS()
+        [Step(1, " Click Run button")]
+        [Step(2, " Popup should not appear")]
+        public void RequestPermission_SPECIAL_CHARACTERS()
         {
-            testUI.CreateLayout();
             _privileges = new string[] { Constans.SpecialCharacters };
-            testUI._button.Clicked += OnClick;
-            await ManualTest.WaitForConfirm();
-            testUI._button.Clicked -= OnClick;
+            SRequest();
         }
 
         [Test]
-        [Category("P1")]
-        [Description("Test: Check if RequestPermission method works with null string.")]
+        [Category("P2")]
+        [Description("Test: Check if RequestPermission method throws ArgumentException when null string is given.")]
         [Property("SPEC", "Tizen.Security.PrivacyPrivilegeManager.RequestPermission M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
-        [Step(3, " Check Logs output (inside program)")]
-        [Step(4, " Good output: Error occured: Can not request permission for .\nException message: Invalid parameter")]
-        [Step(5, " Popup should not appear")]
-        [Postcondition(1, "NA")]
-        public async Task RequestPermission_STRING_NULL()
+        [Step(1, " Click Run button")]
+        [Step(2, " Popup should not appear")]
+        public void RequestPermission_STRING_NULL()
         {
-            _expectError = true;
-            testUI.CreateLayout();
+            _correctException = "ArgumentException";
             _privileges = new string[] { Constans.Null };
-            testUI._button.Clicked += OnClick;
-            await ManualTest.WaitForConfirm();
-            testUI._button.Clicked -= OnClick;
+            SRequest();
         }
 
         [Test]
@@ -265,19 +198,12 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MAC")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
-        [Step(3, " Check Logs output (inside program)")]
-        [Step(4, " Popup should not appear")]
-        [Postcondition(1, "NA")]
-        public async Task RequestPermission_UPPER_LETTER_CASE_PRIVILEGE()
+        [Step(1, " Click Run button")]
+        [Step(2, " Popup should not appear")]
+        public void RequestPermission_UPPER_LETTER_CASE_PRIVILEGE()
         {
-            testUI.CreateLayout();
             _privileges = new string[] { Constans.UpperLetterCasePrivilege };
-            testUI._button.Clicked += OnClick;
-            await ManualTest.WaitForConfirm();
-            testUI._button.Clicked -= OnClick;
+            SRequest();
         }
     }
 }
index e612300..69515f8 100755 (executable)
@@ -27,8 +27,12 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
     /// </summary>
     [TestFixture]
     [Description("Tizen.PrivacyPrivilegeManager Manual test")]
-    class TSRequestPermissions : TestHelpers
+    class TSRequestPermissions : TestBase
     {
+        /// <summary>
+        /// Holds privilege that will be tested
+        /// </summary>
+        private string[] _privileges;
 
         /// <summary>
         /// Initializes environment before TCT test runs.
@@ -36,24 +40,18 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [SetUp]
         public void Init()
         {
-            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0)
+            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0 && Profile.GetProfile().CompareTo(Profile.WearableProfile) != 0)
             {
                 Assert.Pass("Privacy privileges not supported");
             }
 
             LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
-            executeCount = 1;
         }
 
-        /// <summary>
-        /// Handles Buttons OnClick event.
-        /// </summary>
-        /// <param name="sender">Sender</param>
-        /// <param name="e">Event arguments</param>
-        private async void OnClickMultiplePrivileges(object sender, EventArgs e)
+        private async Task MRequest()
         {
-            ChangeButtonState(false);
-            await CheckMultiple(_privileges);
+            await RequestPermissions(_privileges);
+            Assert.IsFalse(ErrorOccured, "Unexpected error occurred: " + ExceptionName);
         }
 
         [Test]
@@ -63,34 +61,23 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Precondition(1, " Open Settings")]
-        [Precondition(2, " Open \"Privacy and security\"")]
-        [Precondition(3, " Open \"Privacy settings\"")]
-        [Precondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Precondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
-        [Step(1, " Click run TC")]
-        [Step(2, " Click button")]
-        [Step(3, " Allow Privileges")]
-        [Step(4, " Check Logs output (inside program)")]
-        [Step(5, " Good output(Can be printed at the end of the logs): Privileges with ask status:\n(name of 3 privileges)")]
-        [Step(6, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: Ask")]
-        [Step(7, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: Ask")]
-        [Step(8, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: Ask")]
-        [Step(9, " Good output: Privilege:\nhttp://tizen.org/privilege/account.read\nStatus: AllowForever")]
-        [Step(10, " Good output: Privilege:\nhttp://tizen.org/privilege/account.write\nStatus: AllowForever")]
-        [Step(11, " Good output: Privilege:\nhttp://tizen.org/privilege/call\nStatus: AllowForever")]
-        [Postcondition(1, " Open Settings")]
-        [Postcondition(2, " Open \"Privacy and security\"")]
-        [Postcondition(3, " Open \"Privacy settings\"")]
-        [Postcondition(4, " Open \"Accounts\" and uncheck Tizen.Security.PrivacyManager")]
-        [Postcondition(5, " Open \"Call\" and uncheck Tizen.Security.PrivacyManager")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Precondition(1, " Open terminal and enter following commands:")]
+        [Precondition(2, " sdb root on")]
+        [Precondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Precondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Precondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
+        [Step(1, " Click Run button")]
+        [Step(2, " Click Any(Deny/Allow) button for asking messages for 2 privacies - Accounts and Call -")]
+        [Postcondition(1, " Open terminal and enter following commands:")]
+        [Postcondition(2, " sdb root on")]
+        [Postcondition(3, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.read -t 0xA")]
+        [Postcondition(4, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/account.write -t 0xA")]
+        [Postcondition(5, " sdb shell cyad -s -k \"\" -c User::Pkg::Tizen.PrivacyPrivilegeManager.Manual.Tests -u 5001 -p http://tizen.org/privilege/call -t 0xA")]
         public async Task RequestPermissions_REAL_PRIVILEGES()
         {
-            CreateLayout();
             _privileges = Constans.Privileges;
-            _button.Clicked += OnClickMultiplePrivileges;
-            await ManualTest.WaitForConfirm();
-            _button.Clicked -= OnClickMultiplePrivileges;
+            await MRequest();
         }
 
         [Test]
@@ -100,19 +87,14 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
-        [Step(1, " Click run TC")]
-        [Step(2, " Click button")]
-        [Step(3, " Check Logs output (inside program)")]
-        [Step(4, " Good output: No privileges with ask status!")]
-        [Step(5, " Popup should not appear")]
+        [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
+        [Step(1, " Click Run button")]
+        [Step(2, " Popup should not appear")]
         public async Task RequestPermissions_FAKE_PRIVILEGES()
         {
-            CreateLayout();
             _privileges = new string[] {Constans.LongString, Constans.NoExisting, Constans.RandomLetterCasePrivilege,
                                         Constans.SpecialCharacters, Constans.UpperLetterCasePrivilege};
-            _button.Clicked += OnClickMultiplePrivileges;
-            await ManualTest.WaitForConfirm();
-            _button.Clicked -= OnClickMultiplePrivileges;
+            await MRequest();
         }
     }
 }
old mode 100644 (file)
new mode 100755 (executable)
index 0ae58c1..a7ea0c7
@@ -35,7 +35,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [SetUp]
         public void Init()
         {
-            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0)
+            if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0 && Profile.GetProfile().CompareTo(Profile.WearableProfile) != 0)
             {
                 Assert.Pass("Privacy privileges not supported");
             }
@@ -51,8 +51,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("CRITERIA", "CONSTR")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void RequestResponseEventArgs_CONSTRUCTOR()
         {
@@ -76,8 +75,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("CRITERIA", "PRO")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void cause_READ_ONLY()
         {
@@ -102,8 +100,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("CRITERIA", "PRO")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void result_READ_ONLY()
         {
@@ -128,8 +125,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("CRITERIA", "PRO")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void privilege_READ_ONLY()
         {
@@ -154,8 +150,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         [Property("CRITERIA", "PRO")]
         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
         [Precondition(1, "NA")]
-        [Step(1, "Click run TC")]
-        [Step(2, "Click button")]
+        [Step(1, "Click Run button")]
         [Postcondition(1, "NA")]
         public void Response_READ_ONLY()
         {
old mode 100644 (file)
new mode 100755 (executable)
index 5845390..e9f7dd7
@@ -73,8 +73,6 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         private static readonly string[] secondaryPrivileges = new string[]
         {
             "http://tizen.org/privilege/contact.read",
-            "http://tizen.org/privilege/contact.write",
-            "http://tizen.org/privilege/download",
             "http://tizen.org/privilege/location",
         };
 
old mode 100644 (file)
new mode 100755 (executable)
index e4fcf42..de61d13
@@ -18,6 +18,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
 {
     using global::System;
     using global::System.Collections.Generic;
+    using global::System.Threading.Tasks;
     using global::System.Linq;
     using NUnit.Framework.TUnit;
     using Tizen.Security;
@@ -31,7 +32,12 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         /// <summary>
         /// Contains error Message
         /// </summary>
-        private string errorMessage;
+        private string _errorMessage;
+
+        /// <summary>
+        /// Contains exception name
+        /// </summary>
+        private string _exceptionName;
 
         /// <summary>
         /// Gets error Message if exception occurred
@@ -40,12 +46,24 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         {
             get
             {
-                return errorMessage;
+                return _errorMessage;
+            }
+
+            private set
+            {
+                _errorMessage = value;
             }
+        }
 
+        public string ExceptionName
+        {
+            get
+            {
+                return _exceptionName;
+            }
             private set
             {
-                errorMessage = value;
+                _exceptionName = value;
             }
         }
 
@@ -56,7 +74,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         {
             get
             {
-                return !(errorMessage == null || errorMessage == "");
+                return !(_errorMessage == null || _errorMessage == "");
             }
         }
 
@@ -66,32 +84,21 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         /// </summary>
         /// <param name="privilege">Privilege name</param>
         /// <returns>CheckResult state</returns>
-        public CheckResult CheckPermission(string privilege, bool expectedArgumentException = false)
+        public CheckResult CheckPermission(string privilege)
         {
             ErrorMessage = "";
-            CheckResult result;
+            ExceptionName = "";
+            CheckResult result = CheckResult.Deny;
+
             try
             {
                 result = PrivacyPrivilegeManager.CheckPermission(privilege);
             }
-            catch (ArgumentException ex)
-            {
-                if (expectedArgumentException)
-                {
-                    result = CheckResult.Deny;
-                }
-                else
-                {
-                    ErrorMessage = "Can not check permission for " + privilege + ".\nException message:" + ex.Message;
-                    LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, ErrorMessage);
-                    result = CheckResult.Deny;
-                }
-            }
             catch (Exception ex)
             {
                 ErrorMessage = "Can not check permission for " + privilege + ".\nException message:" + ex.Message;
+                ExceptionName = ex.GetType().Name;
                 LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, ErrorMessage);
-                result = CheckResult.Deny;
             }
 
             return result;
@@ -106,6 +113,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         public CheckResult[] CheckPermissions(string[] privileges)
         {
             ErrorMessage = "";
+            ExceptionName = "";
             CheckResult[] results = null;
             try
             {
@@ -114,6 +122,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
             catch (Exception ex)
             {
                 ErrorMessage = "Can not check permission for " + string.Join(" ", privileges) + ".\nException message:" + ex.Message;
+                ExceptionName = ex.GetType().Name;
                 LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, ErrorMessage);
                 results = new CheckResult[privileges.Length];
                 for (int it = 0; it < privileges.Length; ++it)
@@ -131,6 +140,7 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
         public void RequestPermission(string privilege)
         {
             ErrorMessage = "";
+            ExceptionName = "";
             try
             {
                 PrivacyPrivilegeManager.RequestPermission(privilege);
@@ -138,28 +148,30 @@ namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
             catch (Exception ex)
             {
                 ErrorMessage = "Can not request permission for " + privilege + ".\nException message: " + ex.Message;
+                ExceptionName = ex.GetType().Name;
                 LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, ErrorMessage);
             }
         }
 
-        /// <summary>
-        /// Returns priviliges array with ask status
-        /// </summary>
-        /// <returns>Privileges array</returns>
-        public List<string> GetPrivilegesWithAskStatus(string[] privileges, CheckResult[] responses)
+        public async Task RequestPermissions(string[] privileges)
         {
-            List<string> privilegesWithAskStatus = new List<string>();
-            string log = "GetPrivilegesWithAskStatus:\n";
-            for (int it = 0; it < privileges.Length; it++)
+            Tizen.Security.RequestMultipleResponseEventArgs request = null;
+            try
             {
-                if (responses[it] == CheckResult.Ask)
+                request = await PrivacyPrivilegeManager.RequestPermissions(privileges);
+                if (request.Cause == Tizen.Security.CallCause.Error)
                 {
-                    privilegesWithAskStatus.Add(privileges[it]);
+                    ErrorMessage = "request.Cause is CallCause.Error";
+                    ExceptionName = "CallCause.Error";
+                    LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, ErrorMessage);
                 }
-                log += "Priv: " + privileges[it] + " response: " + responses[it];
             }
-            LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, log);
-            return privilegesWithAskStatus;
+            catch (Exception ex)
+            {
+                ErrorMessage = "Exception message: " + ex.Message;
+                ExceptionName = ex.GetType().Name;
+                LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, ErrorMessage);
+            }
         }
     }
 }
diff --git a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/support/TestHelpers.cs b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/support/TestHelpers.cs
deleted file mode 100644 (file)
index 16625d0..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- *  Copyright (c) 2018 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
- */
-
-namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
-{
-    using global::NUnit.Framework.TUnit;
-    using global::System;
-    using global::System.Collections.Generic;
-    using global::System.Threading.Tasks;
-    using global::Xamarin.Forms;
-    using Tizen.Security;
-
-    public abstract class TestHelpers : TestUI
-    {
-        private readonly TestBase testBase = new TestBase();
-        /// <summary>
-        /// Contains privileges for current test case
-        /// </summary>
-        protected static string[] _privileges;
-
-        /// <summary>
-        /// Contains privileges for current test case
-        /// </summary>
-        protected static bool requestAdditionalPrivilegesInCallback = false;
-
-        /// <summary>
-        /// Logs Request result for privilege to system log and UI
-        /// </summary>
-        /// <param name="privilege">Privilege name</param>
-        /// <param name="result">Privilege request result</param>
-        protected void LogPrivilegeRequestResponse(string privilege, RequestResult result)
-        {
-            switch (result)
-            {
-                case RequestResult.AllowForever:
-                    {
-                        LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "User allowed usage of privilege " + privilege + " forever.");
-                        break;
-                    }
-
-                case RequestResult.DenyForever:
-                    {
-                        LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "User denied usage of privilege " + privilege + " forever.");
-                        break;
-                    }
-
-                case RequestResult.DenyOnce:
-                    {
-                        LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "User denied usage of privilege " + privilege + " once.");
-                        break;
-                    }
-            }
-            AddNewLabel("Execute number: " + executeCount + " Privilege: \n" + privilege + "\nStatus: " + result);
-        }
-
-        /// <summary>
-        /// Checks Privileges status and displays results.
-        /// </summary>
-        protected void Check(string[] privileges)
-        {
-            bool gotCheckResult = false;
-            foreach (string privilege in privileges)
-            {
-                CheckResult result = testBase.CheckPermission(privilege);
-                Color backgroundColor = Color.Red;
-                string labelText = "Execute number: " + executeCount++ + "\nPrivilege: \n" + privilege + "\nStatus: " + result;
-
-                if (testBase.ErrorOccured)
-                {
-                    labelText += "\n" + testBase.ErrorMessage;
-                }
-
-                if (result == CheckResult.Ask)
-                {
-                    gotCheckResult = true;
-                    backgroundColor = Color.Green;
-                    SetupPPMHandler(privilege);
-                    testBase.RequestPermission(privilege);
-
-                    if (testBase.ErrorOccured)
-                    {
-                        labelText += "\n" + testBase.ErrorMessage;
-                        backgroundColor = Color.Red;
-                    }
-                }
-
-                if (!gotCheckResult)
-                {
-                    ChangeButtonState(true);
-                }
-                AddNewLabel(labelText, backgroundColor);
-            }
-        }
-
-        protected virtual void SetupPPMHandler(string privilege) { }
-
-        /// <summary>
-        /// Checks Privileges status and displays results.
-        /// </summary>
-        protected async Task CheckMultiple(string[] privileges)
-        {
-            CheckResult[] results = testBase.CheckPermissions(privileges);
-            Color backgroundColor = Color.White;
-
-            string labelText = "Execute number: " + executeCount++;
-            if (testBase.ErrorOccured)
-            {
-                labelText += "\n" + testBase.ErrorMessage;
-                backgroundColor = Color.Red;
-            }
-            for (int it = 0; it < privileges.Length; it++)
-            {
-                labelText += "\nPrivilege: \n" + privileges[it] + "\nStatus: " + results[it];
-            }
-            AddNewLabel(labelText, backgroundColor);
-            backgroundColor = Color.Green;
-            List<string> privilegesWithAskStatus = testBase.GetPrivilegesWithAskStatus(privileges, results);
-            if (privilegesWithAskStatus == null || privilegesWithAskStatus.Count == 0)
-            {
-                LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "NO Privileges with ask status! ");
-                AddNewLabel("No privileges with ask status!", Color.Red);
-                ChangeButtonState(true);
-                return;
-            }
-
-            labelText = "Privileges with ask status: \n" + string.Join("\n", privilegesWithAskStatus);
-            LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, labelText);
-            bool errorOccured = false;
-            RequestMultipleResponseEventArgs request = null;
-            try
-            {
-                LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "before");
-                request = await PrivacyPrivilegeManager.RequestPermissions(privilegesWithAskStatus);
-                LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "after");
-                if (request.Cause == CallCause.Error)
-                {
-                    errorOccured = true;
-                    labelText += "\nRequestPermissions response returned error.";
-                }
-                foreach (PermissionRequestResponse response in request.Responses)
-                {
-                    LogPrivilegeRequestResponse(response.Privilege, response.Result);
-                }
-
-                if (requestAdditionalPrivilegesInCallback)
-                {
-                    _privileges = Constans.SecondaryPrivileges;
-                    requestAdditionalPrivilegesInCallback = false;
-                    await CheckMultiple(_privileges);
-                }
-            }
-            catch (Exception ex)
-            {
-                errorOccured = true;
-                labelText += "\nEx_msg: " + ex.Message;
-            }
-
-            if (errorOccured)
-            {
-                backgroundColor = Color.Red;
-            }
-
-            ChangeButtonState(true);
-            AddNewLabel(labelText, backgroundColor);
-        }
-    }
-}
diff --git a/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/support/TestUI.cs b/tct-suite-vs/Tizen.PrivacyPrivilegeManager.Manual.Tests/testcase/support/TestUI.cs
deleted file mode 100644 (file)
index 25028d5..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- *  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
- */
-
-namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
-{
-    using global::System.Collections.ObjectModel;
-    using global::System.Linq;
-    using global::Xamarin.Forms;
-    using NUnit.Framework;
-
-    /// <summary>
-    /// Contains <see cref="TestUI"/> class
-    /// <para>It is used to create UI for each test case separately</para>
-    /// </summary>
-    public class TestUI
-    {
-
-        /// <summary>
-        /// Provides locking mechanism for changing button state
-        /// </summary>
-        private readonly object _syncLock = new object();
-
-        /// <summary>
-        /// Holds TestPage instance
-        /// </summary>
-        protected TestPage _testPage = TestPage.GetInstance();
-
-        /// <summary>
-        /// Holds Buton
-        /// </summary>
-        public Button _button;
-
-        /// <summary>
-        /// Holds ListView
-        /// </summary>
-        protected ListView _listView;
-
-        /// <summary>
-        /// Holds list of Labels with logs
-        /// </summary>
-        protected ObservableCollection<Label> _UIlist;
-
-        /// <summary>
-        /// Holds execute number, enumerates every time user clicks button
-        /// </summary>
-        public int executeCount = 1;
-
-        /// <summary>
-        /// Adds lablel with application logs
-        /// </summary>
-        /// <param name="labelText">text that will be logged inside <see cref="Label"/></param>
-        /// <param name="backgroundColor"><see cref="Label"/> background color</param>
-        public void AddNewLabel(string labelText, Color backgroundColor)
-        {
-            //Can not declare default parameters value because they have to be compile-time constant
-            if (backgroundColor != Color.White)
-            {
-                AddNewLabel(labelText, backgroundColor, Color.White);
-            }
-            else
-            {
-                AddNewLabel(labelText, backgroundColor, Color.Black);
-            }
-        }
-
-        /// <summary>
-        /// Adds lablel with application logs
-        /// </summary>
-        /// <param name="labelText">text that will be logged inside <see cref="Label"/></param>
-        public void AddNewLabel(string labelText)
-        {
-            //Can not declare default parameters value because they have to be compile-time constant
-            AddNewLabel(labelText, Color.White, Color.Black);
-        }
-
-        /// <summary>
-        /// Adds lablel with application logs
-        /// </summary>
-        /// <param name="labelText">text that will be logged inside <see cref="Label"/></param>
-        /// <param name="backgroundColor"><see cref="Label"/> background color</param>
-        /// <param name="textColor">text background color</param>
-        public void AddNewLabel(string labelText, Color backgroundColor, Color textColor)
-        {
-            _UIlist.Add(new Label()
-            {
-                Text = labelText,
-                BackgroundColor = backgroundColor,
-                TextColor = textColor,
-            });
-
-            _listView.ScrollTo(_listView.ItemsSource.OfType<Label>().Last(), ScrollToPosition.End, true);
-        }
-
-        /// <summary>
-        /// Changes button state
-        /// </summary>
-        /// <param name="isEnabled">Desired button state</param>
-        public void ChangeButtonState(bool isEnabled)
-        {
-            lock (_syncLock)
-            {
-                _button.IsEnabled = isEnabled;
-            }
-        }
-
-        /// <summary>
-        /// Creates UI for test case.
-        /// </summary>
-        public void CreateLayout()
-        {
-            executeCount = 1;
-
-            ////Main grid will hold all UI inside, works with horizontal and vertical layout
-            Grid layout = new Grid()
-            {
-                IsVisible = true,
-                HorizontalOptions = LayoutOptions.FillAndExpand,
-                VerticalOptions = LayoutOptions.FillAndExpand,
-            };
-
-            // Defining Grid childs size
-            RowDefinition row = new RowDefinition();
-            RowDefinition row2 = new RowDefinition();
-            row.Height = new GridLength(1.0, GridUnitType.Star);
-            layout.RowDefinitions.Add(row);
-            row2.Height = new GridLength(5.0, GridUnitType.Star);
-            layout.RowDefinitions.Add(row2);
-            layout.BackgroundColor = Color.White;
-
-            // Defining listView, it will hold Labels with program logs
-            _listView = new ListView()
-            {
-                HorizontalOptions = LayoutOptions.FillAndExpand,
-                VerticalOptions = LayoutOptions.FillAndExpand,
-                BackgroundColor = Color.White,
-            };
-
-            //// Template for displaying Labels Text (Logs) in ListView
-            DataTemplate template = new DataTemplate(() =>
-            {
-                Label display = new Label();
-                display.SetBinding(Label.TextProperty, new Binding("Text"));
-                display.SetBinding(Label.BackgroundColorProperty, new Binding("BackgroundColor"));
-                display.SetBinding(Label.TextColorProperty, new Binding("TextColor"));
-                display.LineBreakMode = LineBreakMode.CharacterWrap;
-                display.Margin = new Thickness(0, 10);
-                return new ViewCell
-                {
-                    View = new StackLayout
-                    {
-                        Children =
-                        {
-                            display
-                        },
-                    },
-                };
-            });
-
-            // Binding ObservableCollection of Labels  so ListView will automatically update itself when new Label is added
-            _UIlist = new ObservableCollection<Label>();
-            _listView.ItemsSource = _UIlist;
-            _listView.ItemTemplate = template;
-
-            // Defining button, which will execute TestCase method
-            _button = new Button()
-            {
-                Text = "Click to Execute",
-                FontSize = 20,
-                VerticalOptions = LayoutOptions.FillAndExpand,
-                HorizontalOptions = LayoutOptions.FillAndExpand,
-            };
-
-            // Adding childs to Main Grid
-            layout.Children.Add(_listView, 0, 1);
-            layout.Children.Add(_button, 0, 0);
-            ContentPage contentPage = new ContentPage
-            {
-                Content = layout
-            };
-            _testPage.ExecuteTC(contentPage);
-        }
-    }
-}