[Application] Change application tests into automated 74/183174/4
authorPawel Kaczmarczyk <p.kaczmarczy@samsung.com>
Tue, 3 Jul 2018 05:50:31 +0000 (07:50 +0200)
committerPawel Kaczmarczyk <p.kaczmarczy@samsung.com>
Tue, 11 Sep 2018 13:58:17 +0000 (15:58 +0200)
[Verification]
  tct-application-tizen-tests 100% (242 tcs)
  testkit-stub built with:
  https://review.tizen.org/gerrit/183170/

Change-Id: Id0ac2350f05088fcd5e022f7b820e0b001c8c3fe
Signed-off-by: Pawel Kaczmarczyk <p.kaczmarczy@samsung.com>
12 files changed:
common/tct-application-tizen-tests/application/ApplicationInformationEventCallback_oninstalled.html
common/tct-application-tizen-tests/application/ApplicationInformationEventCallback_onuninstalled.html
common/tct-application-tizen-tests/application/ApplicationInformationEventCallback_onupdated.html
common/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_oninstalled.html
common/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_onuninstalled.html
common/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_onupdated.html
common/tct-application-tizen-tests/application/ApplicationManager_addAppStatusChangeListener.html
common/tct-application-tizen-tests/application/ApplicationManager_addAppStatusChangeListener_with_appId.html
common/tct-application-tizen-tests/application/StatusEventCallback_onchange.html
common/tct-application-tizen-tests/application/support/app_common.js
common/tct-application-tizen-tests/application/support/unitcommon.js
common/tct-application-tizen-tests/tests.xml

index a2f9c5a173c50d5ef6586981a12a049b5ead64d6..0a8357881cac8622a05ccce356dfb519ed5304d8 100755 (executable)
@@ -48,6 +48,8 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA CBT CBOA
 
+executeCommand(TCT_APPINFO_UNINSTALL_COMMAND);
+
 setup({timeout: 300000});
 
 var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId;
@@ -80,6 +82,7 @@ t.step(function () {
     watchId = tizen.application.addAppInfoEventListener(appEventCallback);
     assert_type(watchId, "long", "wrong listener ID");
 
+    executeCommand(TCT_APPINFOv1_INSTALL_COMMAND);
 });
 
 </script>
index f5819910fefb20011f00b4442a1d78a260003999..e54b632d8fdb3fdea8942e2f4d329ec75dd4a37c 100755 (executable)
@@ -48,6 +48,8 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA CBT CBOA
 
+executeCommand(TCT_APPINFOv1_INSTALL_COMMAND);
+
 setup({timeout: 300000});
 
 var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId;
@@ -71,6 +73,8 @@ t.step(function () {
     watchId = tizen.application.addAppInfoEventListener(appEventCallback);
     assert_type(watchId, "long", "wrong listener ID");
 
+    executeCommand(TCT_APPINFO_UNINSTALL_COMMAND);
+
 });
 
 </script>
index aa5bb7e675aa80724891431bf0c3998f5d676521..e34787c6138a9d0c8c0a12342f1cd0009a819d81 100755 (executable)
@@ -48,6 +48,9 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA CBT CBOA
 
+executeCommand(TCT_APPINFO_UNINSTALL_COMMAND);
+executeCommand(TCT_APPINFOv1_INSTALL_COMMAND);
+
 setup({timeout: 300000});
 
 var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId;
@@ -80,6 +83,8 @@ t.step(function () {
     watchId = tizen.application.addAppInfoEventListener(appEventCallback);
     assert_type(watchId, "long", "wrong listener ID");
 
+    executeCommand(TCT_APPINFOv2_INSTALL_COMMAND);
+
 });
 
 </script>
index 49e3059dd606393b0933268b3603edfe4bf66d89..29a8993e4b4a7c2a6b633350ba0adf63e9900f92 100755 (executable)
@@ -48,6 +48,8 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MMINA MAST MR
 
+executeCommand(TCT_APPINFO_UNINSTALL_COMMAND);
+
 setup({timeout: 300000});
 
 var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId;
@@ -67,6 +69,8 @@ t.step(function () {
 
     watchId = tizen.application.addAppInfoEventListener(appEventCallback);
     assert_type(watchId, "long", "wrong listener ID");
+
+    executeCommand(TCT_APPINFOv1_INSTALL_COMMAND);
 });
 
 </script>
index 9b80cb213baa018088756bfa1280d10e03b1cb6e..8d1c7b535089cd5001012a3ced88b8dcf68a1eaf 100755 (executable)
@@ -48,6 +48,8 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MMINA MAST MR
 
+executeCommand(TCT_APPINFOv1_INSTALL_COMMAND);
+
 setup({timeout: 300000});
 
 var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId;
@@ -67,6 +69,8 @@ t.step(function () {
 
     watchId = tizen.application.addAppInfoEventListener(appEventCallback);
     assert_type(watchId, "long", "wrong listener ID");
+
+    executeCommand(TCT_APPINFO_UNINSTALL_COMMAND);
 });
 
 </script>
index f63f552d2f2239b442bde00c6f92d982ca20ad2e..c349464e6f52c5d40b382a5bbd82e8929e195c57 100755 (executable)
@@ -48,6 +48,9 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MMINA MAST MR
 
+executeCommand(TCT_APPINFO_UNINSTALL_COMMAND);
+executeCommand(TCT_APPINFOv1_INSTALL_COMMAND);
+
 setup({timeout: 300000});
 
 var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId;
@@ -68,6 +71,7 @@ t.step(function () {
     watchId = tizen.application.addAppInfoEventListener(appEventCallback);
     assert_type(watchId, "long", "wrong listener ID");
 
+    executeCommand(TCT_APPINFOv2_INSTALL_COMMAND);
 });
 
 </script>
index 01e06c56a4900a0b8728961af0116ee2761636f5..3b159528e59d81335f4ab2a828e37bf92e9b2042 100644 (file)
@@ -47,6 +47,8 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MMINA MR
 
+executeCommand(TCT_DEACTIVATE_APP_COMMAND);
+
 setup({timeout: 300000});
 
 var t = async_test(document.title, {timeout: 300000}), statusEventCallback, watchId;
@@ -59,6 +61,9 @@ t.step(function () {
 
     watchId = tizen.application.addAppStatusChangeListener(statusEventCallback);
     assert_type(watchId, "long", "wrong listener ID");
+
+    executeCommand(TCT_ACTIVATE_APP_COMMAND);
+
 });
 
 </script>
index 951e3eb64b5436a3bd88b4ee0eb220a968824309..bba8ab85a24d5c30c59f965ed1d3d21839ccf053 100644 (file)
@@ -47,6 +47,8 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MOA MR
 
+executeCommand(TCT_DEACTIVATE_APP_COMMAND);
+
 setup({timeout: 300000});
 
 var t = async_test(document.title, {timeout: 300000}), statusEventCallback, watchId;
@@ -59,6 +61,8 @@ t.step(function () {
 
     watchId = tizen.application.addAppStatusChangeListener(statusEventCallback, "api1appli1.TCTAppControl");
     assert_type(watchId, "long", "wrong listener ID");
+
+    executeCommand(TCT_ACTIVATE_APP_COMMAND);
 });
 
 </script>
index 32a6651798eed6406e2cda7d2b74f99d99fb01dc..ebbc6d220144d9d59ff8b238d9126c4f829b8c02 100644 (file)
@@ -47,6 +47,8 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA CBT CBOA
 
+executeCommand(TCT_DEACTIVATE_APP_COMMAND);
+
 setup({timeout: 300000});
 
 var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId;
@@ -60,6 +62,7 @@ t.step(function () {
 
     watchId = tizen.application.addAppStatusChangeListener(appEventCallback);
 
+    executeCommand(TCT_ACTIVATE_APP_COMMAND);
 });
 
 </script>
index 41bb9c1e4a93e9b4d48cdd13a6216faaf39a9b22..8ebd0aa412880b6c35f58786a47855f7cacdb991 100755 (executable)
@@ -60,6 +60,18 @@ var TCT_APPCONTROL_EXIT_OPERATION = "http://tizen.org/appcontrol/operation/tct/e
 
 var TYPE_MISMATCH_ERR = {name: 'TypeMismatchError'};
 
+var TCT_APPINFO_WGT_LOCATION = "/home/owner/share/Others/";
+var TCT_APPINFOv1_WGT_PATH = TCT_APPINFO_WGT_LOCATION + "TCTAppInfoEventTest1.wgt";
+var TCT_APPINFOv2_WGT_PATH = TCT_APPINFO_WGT_LOCATION + "TCTAppInfoEventTest2.wgt";
+var TCT_APPINFOv1_INSTALL_COMMAND = "pkgcmd -i -t wgt -p " + TCT_APPINFOv1_WGT_PATH;
+var TCT_APPINFOv2_INSTALL_COMMAND = "pkgcmd -i -t wgt -p " + TCT_APPINFOv2_WGT_PATH;
+
+var TCT_APPINFO_PACKAGE_ID = "api1appli3";
+var TCT_APPINFO_UNINSTALL_COMMAND = "pkgcmd -u -n " + TCT_APPINFO_PACKAGE_ID;
+
+var TCT_ACTIVATE_APP_COMMAND = "pkgcmd -A -t app -n api1appli1.TCTAppControl --global";
+var TCT_DEACTIVATE_APP_COMMAND = "pkgcmd -D -t app -n api1appli1.TCTAppControl --global";
+
 var TIMEOUT_AUTO_TEST = 30000;
 setup({timeout: TIMEOUT_AUTO_TEST});
 
@@ -205,3 +217,5 @@ function assert_not_kill(t, appId, onsuccess) {
 function assert_exit(t, appId, onsuccess) {
     assert_kill(t, appId, onsuccess);
 }
+
+document.write("<script src=\"../webrunner/jquery-1.10.2.min.js\"></script>");
\ No newline at end of file
index 59e2b11ff446eb698c9bb8dd142045020c645e43..615edb6226d99ce7d1fcc9ed4de826d3aeeb004e 100755 (executable)
@@ -562,3 +562,16 @@ function getListenerConversionExceptions(callbackNames) {
 
     return result;
 }
+
+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));
+}
\ No newline at end of file
index 4382f0407de364c2c0e92d168a7fa5e067230f96..d70a96451fe8c2286ec54052349c53c710f6cb63 100755 (executable)
           <test_script_entry>/opt/tct-application-tizen-tests/application/ApplicationInformationArraySuccessCallback_onsuccess.html</test_script_entry>
         </description>
       </testcase>
-      <testcase component="TizenAPI/Application/Application" execution_type="manual" id="ApplicationInformationEventCallback_oninstalled" priority="P1" purpose="Check argument passed into method which is oninstalled listener in ApplicationInformationEventCallback">
+      <testcase component="TizenAPI/Application/Application" execution_type="auto" id="ApplicationInformationEventCallback_oninstalled" priority="P1" purpose="Check argument passed into method which is oninstalled listener in ApplicationInformationEventCallback">
         <description>
           <pre_condition>Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it)</pre_condition>
           <steps>
           <test_script_entry>/opt/tct-application-tizen-tests/application/ApplicationInformationEventCallback_oninstalled.html</test_script_entry>
         </description>
       </testcase>
-      <testcase component="TizenAPI/Application/Application" execution_type="manual" id="ApplicationInformationEventCallback_onuninstalled" priority="P1" purpose="Check argument passed into method which is onuninstalled listener in ApplicationInformationEventCallback">
+      <testcase component="TizenAPI/Application/Application" execution_type="auto" id="ApplicationInformationEventCallback_onuninstalled" priority="P1" purpose="Check argument passed into method which is onuninstalled listener in ApplicationInformationEventCallback">
         <description>
           <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
           <test_script_entry>/opt/tct-application-tizen-tests/application/ApplicationInformationEventCallback_onuninstalled.html</test_script_entry>
         </description>
       </testcase>
-      <testcase component="TizenAPI/Application/Application" execution_type="manual" id="ApplicationInformationEventCallback_onupdated" priority="P1" purpose="Check argument passed into method which is onupdated listener in ApplicationInformationEventCallback">
+      <testcase component="TizenAPI/Application/Application" execution_type="auto" id="ApplicationInformationEventCallback_onupdated" priority="P1" purpose="Check argument passed into method which is onupdated listener in ApplicationInformationEventCallback">
         <description>
           <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
           <test_script_entry>/opt/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_missarg.html</test_script_entry>
         </description>
       </testcase>
-      <testcase component="TizenAPI/Application/Application" execution_type="manual" id="ApplicationManager_addAppInfoEventListener_oninstalled" priority="P1" purpose="Check using addAppInfoEventListener method (installation process) in ApplicationManager interface">
+      <testcase component="TizenAPI/Application/Application" execution_type="auto" id="ApplicationManager_addAppInfoEventListener_oninstalled" priority="P1" purpose="Check using addAppInfoEventListener method (installation process) in ApplicationManager interface">
         <description>
           <pre_condition>Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it)</pre_condition>
           <steps>
           <test_script_entry>/opt/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_oninstalled.html</test_script_entry>
         </description>
       </testcase>
-      <testcase component="TizenAPI/Application/Application" execution_type="manual" id="ApplicationManager_addAppInfoEventListener_onuninstalled" priority="P1" purpose="Check using addAppInfoEventListener method (deinstallation process) in ApplicationManager interface">
+      <testcase component="TizenAPI/Application/Application" execution_type="auto" id="ApplicationManager_addAppInfoEventListener_onuninstalled" priority="P1" purpose="Check using addAppInfoEventListener method (deinstallation process) in ApplicationManager interface">
         <description>
           <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
           <test_script_entry>/opt/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_onuninstalled.html</test_script_entry>
         </description>
       </testcase>
-      <testcase component="TizenAPI/Application/Application" execution_type="manual" id="ApplicationManager_addAppInfoEventListener_onupdated" priority="P1" purpose="Check using addAppInfoEventListener method (updating process) in ApplicationManager interface">
+      <testcase component="TizenAPI/Application/Application" execution_type="auto" id="ApplicationManager_addAppInfoEventListener_onupdated" priority="P1" purpose="Check using addAppInfoEventListener method (updating process) in ApplicationManager interface">
         <description>
           <pre_condition>Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt").</pre_condition>
           <steps>
           <test_script_entry>/opt/tct-application-tizen-tests/application/EventCallback_notexist.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="Check using addAppStatusChangeListener method (installation process) in ApplicationManager interface" component="Tizen Device APIs/Application/Application" execution_type="manual" priority="P1" id="ApplicationManager_addAppStatusChangeListener">
+      <testcase purpose="Check using addAppStatusChangeListener method (installation process) in ApplicationManager interface" component="Tizen Device APIs/Application/Application" execution_type="auto" priority="P1" id="ApplicationManager_addAppStatusChangeListener">
         <description>
           <steps>
             <step order="1">
           <test_script_entry>/opt/tct-application-tizen-tests/application/ApplicationManager_addAppStatusChangeListener_misarg.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="Check using addAppStatusChangeListener method (installation process) in ApplicationManager interface" component="Tizen Device APIs/Application/Application" execution_type="manual" priority="P1" id="ApplicationManager_addAppStatusChangeListener_with_appId">
+      <testcase purpose="Check using addAppStatusChangeListener method (installation process) in ApplicationManager interface" component="Tizen Device APIs/Application/Application" execution_type="auto" priority="P1" id="ApplicationManager_addAppStatusChangeListener_with_appId">
         <description>
           <steps>
             <step order="1">
           <test_script_entry>/opt/tct-application-tizen-tests/application/StatusEventCallback_notexist.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="Check argument passed into method which is oninstalled listener in StatusEventCallback" component="Tizen Device APIs/Application/Application" execution_type="manual" priority="P1" id="StatusEventCallback_onchange">
+      <testcase purpose="Check argument passed into method which is oninstalled listener in StatusEventCallback" component="Tizen Device APIs/Application/Application" execution_type="auto" priority="P1" id="StatusEventCallback_onchange">
         <description>
           <steps>
             <step order="1">