[common][tv-info][change manual tcs to auto tcs] 50/286150/1
authortangkaiyuan <kaiyuan.tang@samsung.com>
Thu, 29 Dec 2022 06:26:35 +0000 (14:26 +0800)
committertangkaiyuan <kaiyuan.tang@samsung.com>
Thu, 29 Dec 2022 06:26:44 +0000 (14:26 +0800)
Change-Id: Ic872571aee6f4febf75c93e580817b91d058cab2
Signed-off-by: tangkaiyuan <kaiyuan.tang@samsung.com>
common/tct-tv-info-tizen-tests/tests.full.xml
common/tct-tv-info-tizen-tests/tests.xml
common/tct-tv-info-tizen-tests/tv-info/CaptionMenuChangeCallback_onchange.html
common/tct-tv-info-tizen-tests/tv-info/TVInfoManager_addCaptionValueChangeListener.html
common/tct-tv-info-tizen-tests/tv-info/TVInfoManager_removeCaptionValueChangeListener.html
common/tct-tv-info-tizen-tests/tv-info/support/tv-info_common.js

index f016d9992e67aef0f04e75f97047fb7e4444200e..8a33cfd7680e8cddd56d46f853593fa20fe3dc0a 100755 (executable)
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="Check CaptionMenuChangeCallback onchange method" type="compliance" onload_delay="90" status="approved" component="TizenAPI/TBD/TVInfo" execution_type="manual" priority="P1" id="CaptionMenuChangeCallback_onchange">
+      <testcase purpose="Check CaptionMenuChangeCallback onchange method" type="compliance" onload_delay="90" status="approved" component="TizenAPI/TBD/TVInfo" execution_type="auto" priority="P1" id="CaptionMenuChangeCallback_onchange">
         <description>
-          <pre_condition>TV is running normally</pre_condition>
-          <steps>
-            <step order="1">
-              <step_desc>After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to 
-enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions.</step_desc>
-              <expected>PASS</expected>
-            </step>
-          </steps>
           <test_script_entry>/opt/tct-tv-info-tizen-tests/tv-info/CaptionMenuChangeCallback_onchange.html</test_script_entry>
         </description>
         <specs>
@@ -51,16 +43,8 @@ enable captions or the command 'vconftool set -t int db/menu/caption/caption "0"
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="Check if addCaptionValueChangeListener works properly" type="compliance" onload_delay="90" status="approved" component="TizenAPI/TBD/TVInfo" execution_type="manual" priority="P1" id="TVInfoManager_addCaptionValueChangeListener">
+      <testcase purpose="Check if addCaptionValueChangeListener works properly" type="compliance" onload_delay="90" status="approved" component="TizenAPI/TBD/TVInfo" execution_type="auto" priority="P1" id="TVInfoManager_addCaptionValueChangeListener">
         <description>
-          <pre_condition>TV is running normally</pre_condition>
-          <steps>
-            <step order="1">
-              <step_desc>After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to 
-enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions.</step_desc>
-              <expected>PASS</expected>
-            </step>
-          </steps>
           <test_script_entry>/opt/tct-tv-info-tizen-tests/tv-info/TVInfoManager_addCaptionValueChangeListener.html</test_script_entry>
         </description>
         <specs>
@@ -323,16 +307,8 @@ enable captions or the command 'vconftool set -t int db/menu/caption/caption "0"
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="Check if removeCaptionValueChangeListener works properly" type="compliance" onload_delay="90" status="approved" component="TizenAPI/TBD/TVInfo" execution_type="manual" priority="P1" id="TVInfoManager_removeCaptionValueChangeListener">
+      <testcase purpose="Check if removeCaptionValueChangeListener works properly" type="compliance" onload_delay="90" status="approved" component="TizenAPI/TBD/TVInfo" execution_type="auto" priority="P1" id="TVInfoManager_removeCaptionValueChangeListener">
         <description>
-          <pre_condition>TV is running normally</pre_condition>
-          <steps>
-            <step order="1">
-              <step_desc>After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to 
-enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions.</step_desc>
-              <expected>PASS</expected>
-            </step>
-          </steps>
           <test_script_entry>/opt/tct-tv-info-tizen-tests/tv-info/TVInfoManager_removeCaptionValueChangeListener.html</test_script_entry>
         </description>
         <specs>
index 3278bf15371fe99a37254502adec00e772836e3b..03cccccfecaad31f60f0c0a36ffd46560a5251b5 100755 (executable)
           <test_script_entry>/opt/tct-tv-info-tizen-tests/tv-info/CaptionMenuChangeCallback_notexist.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="Check CaptionMenuChangeCallback onchange method" onload_delay="90" component="TizenAPI/TBD/TVInfo" execution_type="manual" priority="P1" id="CaptionMenuChangeCallback_onchange">
-        <description>
-          <pre_condition>TV is running normally</pre_condition>
-          <steps>
-            <step order="1">
-              <step_desc>After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to 
-enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions.</step_desc>
-              <expected>PASS</expected>
-            </step>
-          </steps>
+      <testcase purpose="Check CaptionMenuChangeCallback onchange method" onload_delay="90" component="TizenAPI/TBD/TVInfo" execution_type="auto" priority="P1" id="CaptionMenuChangeCallback_onchange">
+        <description>
           <test_script_entry>/opt/tct-tv-info-tizen-tests/tv-info/CaptionMenuChangeCallback_onchange.html</test_script_entry>
         </description>
       </testcase>
@@ -30,16 +22,8 @@ enable captions or the command 'vconftool set -t int db/menu/caption/caption "0"
           <test_script_entry>/opt/tct-tv-info-tizen-tests/tv-info/TVInfoManagerObject_notexist.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="Check if addCaptionValueChangeListener works properly" onload_delay="90" component="TizenAPI/TBD/TVInfo" execution_type="manual" priority="P1" id="TVInfoManager_addCaptionValueChangeListener">
+      <testcase purpose="Check if addCaptionValueChangeListener works properly" onload_delay="90" component="TizenAPI/TBD/TVInfo" execution_type="auto" priority="P1" id="TVInfoManager_addCaptionValueChangeListener">
         <description>
-          <pre_condition>TV is running normally</pre_condition>
-          <steps>
-            <step order="1">
-              <step_desc>After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to 
-enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions.</step_desc>
-              <expected>PASS</expected>
-            </step>
-          </steps>
           <test_script_entry>/opt/tct-tv-info-tizen-tests/tv-info/TVInfoManager_addCaptionValueChangeListener.html</test_script_entry>
         </description>
       </testcase>
@@ -148,16 +132,8 @@ enable captions or the command 'vconftool set -t int db/menu/caption/caption "0"
           <test_script_entry>/opt/tct-tv-info-tizen-tests/tv-info/TVInfoManager_notexist.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="Check if removeCaptionValueChangeListener works properly" onload_delay="90" component="TizenAPI/TBD/TVInfo" execution_type="manual" priority="P1" id="TVInfoManager_removeCaptionValueChangeListener">
+      <testcase purpose="Check if removeCaptionValueChangeListener works properly" onload_delay="90" component="TizenAPI/TBD/TVInfo" execution_type="auto" priority="P1" id="TVInfoManager_removeCaptionValueChangeListener">
         <description>
-          <pre_condition>TV is running normally</pre_condition>
-          <steps>
-            <step order="1">
-              <step_desc>After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to 
-enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions.</step_desc>
-              <expected>PASS</expected>
-            </step>
-          </steps>
           <test_script_entry>/opt/tct-tv-info-tizen-tests/tv-info/TVInfoManager_removeCaptionValueChangeListener.html</test_script_entry>
         </description>
       </testcase>
index 2305ba314091edd8765409ced04d715c0b02e140..b466ddcfb6fdac4f57d52a6daf9778c73151b47d 100755 (executable)
@@ -23,6 +23,7 @@ Authors:
 <title>CaptionMenuChangeCallback_onchange</title>
 <meta charset="utf-8"/>
 <script src="support/unitcommon.js"></script>
+<script src="support/tv-info_common.js"></script>
 </head>
 <body>
 <div id="log"></div>
@@ -44,9 +45,9 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), watcherId, callback, oldValue;
 
 t.step(function () {
-    callback = t.step_func(function (key, value){
+    callback = t.step_func(function (key, value) {
         assert_equals(key, "CAPTION_ONOFF_KEY", "Incorrect watched key");
-        if (oldValue == "CAPTION_ON"){
+        if (oldValue == "CAPTION_ON") {
             assert_equals(value, "CAPTION_OFF", "Incorrect value of watched key");
         } else {
             assert_equals(value, "CAPTION_ON", "Incorrect value of watched key");
@@ -57,6 +58,11 @@ t.step(function () {
 
     oldValue = tizen.tvinfo.getCaptionValue("CAPTION_ONOFF_KEY");
     watcherId = tizen.tvinfo.addCaptionValueChangeListener("CAPTION_ONOFF_KEY", callback);
+    if (oldValue == "CAPTION_ON") {
+        executeCommand(DISABLE_CAPTION);
+    } else {
+        executeCommand(ENABLE_CAPTION);
+    }
 });
 
 </script>
index d18d0ce372c97881c862b69508dfdf1de64527f6..41cc6f3163023f242e15cae21aa6811394b67ecd 100755 (executable)
@@ -23,6 +23,7 @@ Authors:
 <title>TVInfoManager_addCaptionValueChangeListener</title>
 <meta charset="utf-8"/>
 <script src="support/unitcommon.js"></script>
+<script src="support/tv-info_common.js"></script>
 </head>
 <body>
 <div id="log"></div>
@@ -44,11 +45,11 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), oldValue, watcherId, callback;
 
 t.step(function () {
-    callback = t.step_func(function (key, value){
+    callback = t.step_func(function (key, value) {
         assert_not_equals(watcherId, null, "id should be not null");
         assert_type(watcherId, "long", "watcherId should be type of number");
         assert_equals(key, "CAPTION_ONOFF_KEY", "Incorrect watched key");
-        if (oldValue == "CAPTION_ON"){
+        if (oldValue == "CAPTION_ON") {
             assert_equals(value, "CAPTION_OFF", "Incorrect value of watched key");
         } else {
             assert_equals(value, "CAPTION_ON", "Incorrect value of watched key");
@@ -59,6 +60,11 @@ t.step(function () {
 
     oldValue = tizen.tvinfo.getCaptionValue("CAPTION_ONOFF_KEY");
     watcherId = tizen.tvinfo.addCaptionValueChangeListener("CAPTION_ONOFF_KEY", callback);
+    if (oldValue == "CAPTION_ON") {
+        executeCommand(DISABLE_CAPTION);
+    } else {
+        executeCommand(ENABLE_CAPTION);
+    }
 });
 
 </script>
index f71160b6ca3c25c7c48959310ccd51c46143f8f8..630ce6eb06716e8d62f7935c179b0785e083958c 100755 (executable)
@@ -23,6 +23,7 @@ Authors:
 <title>TVInfoManager_removeCaptionValueChangeListener</title>
 <meta charset="utf-8"/>
 <script src="support/unitcommon.js"></script>
+<script src="support/tv-info_common.js"></script>
 </head>
 <body>
 <div id="log"></div>
@@ -41,16 +42,22 @@ Authors:
 
 setup({timeout: 90000});
 
-var t = async_test(document.title, {timeout: 90000}), watcherId, callback, retValue = null;
+var t = async_test(document.title, {timeout: 90000}), oldValue, watcherId, callback, retValue = null;
 
 t.step(function () {
-    callback = t.step_func(function (key, value){
+    callback = t.step_func(function (key, value) {
         retValue = tizen.tvinfo.removeCaptionValueChangeListener(watcherId);
         assert_equals(retValue, undefined, "removeCaptionValueChangeListener returns wrong value");
         t.done();
     });
 
     watcherId = tizen.tvinfo.addCaptionValueChangeListener("CAPTION_ONOFF_KEY", callback);
+    oldValue = tizen.tvinfo.getCaptionValue("CAPTION_ONOFF_KEY");
+    if (oldValue == "CAPTION_ON") {
+        executeCommand(DISABLE_CAPTION);
+    } else {
+        executeCommand(ENABLE_CAPTION);
+    }
 });
 
 </script>
index 6a2b47de843ab4e113df1aba44016a435297cbba..013d4ba9c24d498d6f0bca115abef201f18d9862 100755 (executable)
@@ -42,3 +42,21 @@ var WINDOW_OPACITY_VALUE = ["CAPTION_OPACITY_SOLID", "CAPTION_OPACITY_FLASHING",
 var EDGE_TYPE_VALUE = ["CAPTION_EDGE_NONE", "CAPTION_EDGE_RAISED", "CAPTION_EDGE_DEPRESSED", "CAPTION_EDGE_UNIFORM",
         "CAPTION_EDGE_DROP_SHADOWED"];
 var CAPTION_STYLE_VALUE = ["CAPTION_STYLE_DEFAULT", "CAPTION_STYLE_BOLD", "CAPTION_STYLE_ITALIC"];
+
+DISABLE_CAPTION = 'vconftool set -t int db/menu/caption/caption "0" -f';
+ENABLE_CAPTION = 'vconftool set -t int db/menu/caption/caption "1" -f';
+
+function executeCommand(command) {
+    var toSend = {'cmd' : command};
+    var response =  $.ajax({
+        type: "POST",
+        url: 'http://127.0.0.1:8000/execute_command',
+        async: false,
+        dataType: 'json',
+        data: toSend
+    });
+    //This log provides console output after executing shell command.
+    console.log(JSON.stringify(response));
+}
+
+document.write('<script src="../webrunner/jquery-1.10.2.min.js"></script>');