[common][events-cordova][change manual tcs to auto tcs] 16/296016/1
authortangkaiyuan <kaiyuan.tang@samsung.com>
Sat, 4 Mar 2023 16:47:17 +0000 (00:47 +0800)
committertangkaiyuan <kaiyuan.tang@samsung.com>
Sat, 4 Mar 2023 16:47:25 +0000 (00:47 +0800)
Change-Id: Id75c7010453b6a8f44b2eda2007cc4eaf26bb394
Signed-off-by: tangkaiyuan <kaiyuan.tang@samsung.com>
common/tct-events-cordova-tests/events/cordova_events_addEventListener_pause.html
common/tct-events-cordova-tests/events/cordova_events_addEventListener_resume.html
common/tct-events-cordova-tests/events/support/event_common.js [new file with mode: 0755]
common/tct-events-cordova-tests/tests.full.xml
common/tct-events-cordova-tests/tests.xml

index 094b720dba0547713e15dbbe04ffe5fff775f23c..edceba797c8a8be99baff06439762df3e028f237 100755 (executable)
@@ -23,6 +23,7 @@ Authors:
 <title>cordova_events_addEventListener_pause</title>
 <meta charset="utf-8">
 <script src="support/unitcommon.js"></script>
+<script src="support/event_common.js"></script>
 <script src="../cordova/cordova.js"></script>
 </head>
 <body>
@@ -56,6 +57,7 @@ t.step(function () {
 
     deviceReady = t.step_func(function() {
         document.addEventListener("pause", onPause, true);
+        executeCommand(PAUSE_TEST_APP);
     });
 
     document.addEventListener("deviceready", deviceReady, true);
index 0d9279b663aace21614ed46aebb87157ef0c1855..70d3111bf43726b0aab6920ae4234f95219c34a4 100755 (executable)
@@ -23,6 +23,7 @@ Authors:
 <title>cordova_events_addEventListener_resume</title>
 <meta charset="utf-8">
 <script src="support/unitcommon.js"></script>
+<script src="support/event_common.js"></script>
 <script src="../cordova/cordova.js"></script>
 </head>
 <body>
@@ -56,6 +57,7 @@ t.step(function () {
 
     deviceReady = t.step_func(function() {
         document.addEventListener("resume", onResume, true);
+        executeCommand(RESUME_TEST_APP);
     });
 
     document.addEventListener("deviceready", deviceReady, true);
diff --git a/common/tct-events-cordova-tests/events/support/event_common.js b/common/tct-events-cordova-tests/events/support/event_common.js
new file mode 100755 (executable)
index 0000000..efabd98
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+
+Copyright (c) 2014 Samsung Electronics Co., Ltd.
+
+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.
+
+Authors:
+
+ */
+
+var PAUSE_TEST_APP = "aul_test pause events0001.CordovaAPIEvents";
+var RESUME_TEST_APP = "aul_test resume events0001.CordovaAPIEvents";
+
+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>');
index e5be0b28ccbe61b37af83307a99c266686da0126..270500c571ececa137c05f32f270bf310f83b84b 100755 (executable)
 
       </specs>
       </testcase>
-      <testcase purpose="Check if cordova can addEventListener with event pause." type="compliance" status="approved" component="TizenAPI/CordovaPluginAPI/CordovaEvents" execution_type="manual" priority="P1" id="cordova_events_addEventListener_pause">
+      <testcase purpose="Check if cordova can addEventListener with event pause." type="compliance" status="approved" component="TizenAPI/CordovaPluginAPI/CordovaEvents" execution_type="auto" priority="P1" id="cordova_events_addEventListener_pause">
         <description>
-          <steps>
-            <step order="1">
-              <step_desc>Run the test and switch to a different application and then return to the test application.</step_desc>
-              <expected>Pass.</expected>
-            </step>
-          </steps>
           <test_script_entry>/opt/tct-events-cordova-tests/events/cordova_events_addEventListener_pause.html</test_script_entry>
         </description>
         <specs>
 
       </specs>
       </testcase>
-      <testcase purpose="Check if cordova can addEventListener with event resume." type="compliance" status="approved" component="TizenAPI/CordovaPluginAPI/CordovaEvents" onload_delay="60" execution_type="manual" priority="P1" id="cordova_events_addEventListener_resume">
+      <testcase purpose="Check if cordova can addEventListener with event resume." type="compliance" status="approved" component="TizenAPI/CordovaPluginAPI/CordovaEvents" onload_delay="60" execution_type="auto" priority="P1" id="cordova_events_addEventListener_resume">
         <description>
-          <steps>
-            <step order="1">
-              <step_desc>Run the test and switch to a different application and then return to the test application.</step_desc>
-              <expected>Pass.</expected>
-            </step>
-          </steps>
           <test_script_entry>/opt/tct-events-cordova-tests/events/cordova_events_addEventListener_resume.html</test_script_entry>
         </description>
         <specs>
index 155fecf5b65b28ae1f648d4509080cae79847995..b762bb35843d979313df42160ce4d9c6824acd2d 100755 (executable)
           <test_script_entry>/opt/tct-events-cordova-tests/events/cordova_events_addEventListener_deviceready.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="Check if cordova can addEventListener with event pause." component="TizenAPI/CordovaPluginAPI/CordovaEvents" execution_type="manual" priority="P1" id="cordova_events_addEventListener_pause">
+      <testcase purpose="Check if cordova can addEventListener with event pause." component="TizenAPI/CordovaPluginAPI/CordovaEvents" execution_type="auto" priority="P1" id="cordova_events_addEventListener_pause">
         <description>
-          <steps>
-            <step order="1">
-              <step_desc>Run the test</step_desc>
-              <expected>TC is running</expected>
-            </step>
-            <step order="2">
-              <step_desc>Click the "power" button or switch to a different application and then return to the test application.</step_desc>
-              <expected>TC is pass</expected>
-            </step>
-          </steps>
           <test_script_entry>/opt/tct-events-cordova-tests/events/cordova_events_addEventListener_pause.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="Check if cordova can addEventListener with event resume." component="TizenAPI/CordovaPluginAPI/CordovaEvents" onload_delay="60" execution_type="manual" priority="P1" id="cordova_events_addEventListener_resume">
+      <testcase purpose="Check if cordova can addEventListener with event resume." component="TizenAPI/CordovaPluginAPI/CordovaEvents" onload_delay="60" execution_type="auto" priority="P1" id="cordova_events_addEventListener_resume">
         <description>
-          <steps>
-            <step order="1">
-              <step_desc>Run the test</step_desc>
-              <expected>TC is running</expected>
-            </step>
-            <step order="2">
-              <step_desc>Click the "power" button or switch to a different application and then return to the test application.</step_desc>
-              <expected>TC is pass</expected>
-            </step>
-          </steps>
           <test_script_entry>/opt/tct-events-cordova-tests/events/cordova_events_addEventListener_resume.html</test_script_entry>
         </description>
       </testcase>