[wearable][tct-notification-tizen-tests][sync testcase from suprem] 75/111375/1
authorxy.qian <xy.qian@samsung.com>
Fri, 20 Jan 2017 07:22:48 +0000 (15:22 +0800)
committerxy.qian <xy.qian@samsung.com>
Fri, 20 Jan 2017 07:22:48 +0000 (15:22 +0800)
Change-Id: I314360568ced51bb77b203f96b8ebc8e62a2089a
Signed-off-by: xy.qian <xy.qian@samsung.com>
wearable/tct-notification-tizen-tests/inst.wgt.py
wearable/tct-notification-tizen-tests/notification/NotificationManager_stopLEDCustomEffect_extra_argument.html

index 3aaf8d20939de6522e065ff4ba2b52355bdf163a..802b9e785ce29781f143c66db79cf045dfb6dfe5 100644 (file)
@@ -20,7 +20,16 @@ tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
+EXECUTION_MODE_30 = tct_parser.get('DEVICE', 'DEVICE_EXECUTION_MODE_30')
+ADMIN_USER_30 = tct_parser.get('DEVICE', 'DEVICE_ADMIN_USER_30')
 
+def userCheck():
+    global GLOVAL_OPT
+    if ADMIN_USER_30 == EXECUTION_MODE_30:
+        GLOVAL_OPT="--global"
+    else:
+        GLOVAL_OPT=""
+        
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
@@ -114,7 +123,7 @@ def uninstPKGs():
                     action_status = False
                     continue
                 (return_code, output) = doRemoteCMD(
-                    "pkgcmd -u -t wgt -q -n %s" % pkg_id)
+                    "pkgcmd %s -u -t wgt -q -n %s" % (GLOVAL_OPT, pkg_id))
                 for line in output:
                     if "Failure" in line:
                         action_status = False
@@ -148,7 +157,7 @@ def instPKGs():
                 if not doRemoteCopy(os.path.join(root, file), "%s/%s" % (SRC_DIR, file)):
                     action_status = False
                 (return_code, output) = doRemoteCMD(
-                    "pkgcmd -i -t wgt -q -p %s/%s" % (SRC_DIR, file))
+                    "pkgcmd %s -i -t wgt -q -p %s/%s" % (GLOVAL_OPT, SRC_DIR, file))
                 doRemoteCMD("rm -rf %s/%s" % (SRC_DIR, file))
                 for line in output:
                     if "Failure" in line:
@@ -193,7 +202,7 @@ def main():
         sys.exit(1)
 
     if not PARAMETERS.user:
-        PARAMETERS.user = "owner"
+        PARAMETERS.user = EXECUTION_MODE_30
     if not PARAMETERS.mode:
         PARAMETERS.mode = "SDB"
 
@@ -211,6 +220,8 @@ def main():
         print "No device provided"
         sys.exit(1)
 
+    userCheck()
+
     user_info = getUSERID()
     re_code = user_info[0]
     if re_code == 0 :
index d963a663b5845f8ea86291a5260b297c0670d8a1..3a546f143f2f0c1e69625f067c471363fccccfe7 100644 (file)
@@ -16,6 +16,7 @@ limitations under the License.
 
 Authors:
         Danni Zhao <danni.zhao@samsung.com>
+        Xiaoyan Qian <xy.qian@samsung.com>
 
 -->
 <html>
@@ -35,7 +36,20 @@ Authors:
 //==== TEST_CRITERIA MNAEX
 
 test(function () {
-    checkExtraArgument(tizen.notification, "stopLEDCustomEffect");
+    var extraArgument = [
+        null,
+        undefined,
+        "Tizen",
+        1,
+        false,
+        ["one", "two"],
+        {argument: 1},
+        function () {}
+    ], i;
+    for (i = 0; i < extraArgument.length; i++) {
+        tizen.notification.playLEDCustomEffect(1000, 1000, "#FFFF0080", ["LED_CUSTOM_DUTY_ON", "LED_CUSTOM_DEFAULT"]);
+        setTimeout(function () {tizen.notification.stopLEDCustomEffect(extraArgument[i]);},1000);
+    }
 }, document.title);
 
 </script>