From: Pawel Kaczmarczyk
Date: Tue, 3 Jul 2018 05:49:30 +0000 (+0200)
Subject: [Package] Change package tests into automated
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2acf295e11914b3ec0cae6133b42ac195a115db;p=test%2Ftct%2Fweb%2Fapi.git
[Package] Change package tests into automated
[Verification]
tct-package-tizen-tests 100% passrate (66 tcs)
testkit-stub built with:
https://review.tizen.org/gerrit/183170/
Change-Id: I791a4d9e87c8055305ec86bb4018ee00695876ef
Signed-off-by: Pawel Kaczmarczyk
---
diff --git a/common/tct-package-tizen-tests/package/PackageInformationEventCallback_oninstalled.html b/common/tct-package-tizen-tests/package/PackageInformationEventCallback_oninstalled.html
index a1091e31d..65c1dd1e5 100755
--- a/common/tct-package-tizen-tests/package/PackageInformationEventCallback_oninstalled.html
+++ b/common/tct-package-tizen-tests/package/PackageInformationEventCallback_oninstalled.html
@@ -40,6 +40,9 @@ Authors:
//==== STEP Run the test and install TCTPackageManagerTest1.1.1.wgt application from My files app (Phone/Others directory).
//==== EXPECT Pass.
//==== TEST_CRITERIA CBT CBOA
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_UNINSTALL_COMMAND);
+
setup({timeout: 90000});
var packageInformationEventCallback,
@@ -90,6 +93,7 @@ t.step(function () {
};
tizen.package.unsetPackageInfoEventListener();
tizen.package.setPackageInfoEventListener(packageInformationEventCallback);
+ executeCommand(TCT_PACKAGE_MANAGER_TESTv1_INSTALL_COMMAND);
});
diff --git a/common/tct-package-tizen-tests/package/PackageInformationEventCallback_onuninstalled.html b/common/tct-package-tizen-tests/package/PackageInformationEventCallback_onuninstalled.html
index 220c051f2..6bd4085d5 100755
--- a/common/tct-package-tizen-tests/package/PackageInformationEventCallback_onuninstalled.html
+++ b/common/tct-package-tizen-tests/package/PackageInformationEventCallback_onuninstalled.html
@@ -40,6 +40,9 @@ Authors:
//==== STEP Run the test and uninstall TCTPackageManagerTest1.1.1.wgt application.
//==== EXPECT Pass.
//==== TEST_CRITERIA CBT CBOA
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_INSTALL_COMMAND);
+
setup({timeout: 90000});
var packageInformationEventCallback,
@@ -66,6 +69,7 @@ t.step(function () {
};
tizen.package.unsetPackageInfoEventListener();
tizen.package.setPackageInfoEventListener(packageInformationEventCallback);
+ executeCommand(TCT_PACKAGE_MANAGER_TESTv1_UNINSTALL_COMMAND);
});
diff --git a/common/tct-package-tizen-tests/package/PackageInformationEventCallback_onupdated.html b/common/tct-package-tizen-tests/package/PackageInformationEventCallback_onupdated.html
index b77209cfb..228aa15f3 100755
--- a/common/tct-package-tizen-tests/package/PackageInformationEventCallback_onupdated.html
+++ b/common/tct-package-tizen-tests/package/PackageInformationEventCallback_onupdated.html
@@ -40,6 +40,10 @@ Authors:
//==== STEP Run the test and install TCTPackageManagerTest2.2.2.wgt application from My files app (Phone/Others directory).
//==== EXPECT Pass.
//==== TEST_CRITERIA CBT CBOA
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_UNINSTALL_COMMAND);
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_INSTALL_COMMAND);
+
setup({timeout: 90000});
var packageInformationEventCallback,
@@ -90,6 +94,7 @@ t.step(function () {
};
tizen.package.unsetPackageInfoEventListener();
tizen.package.setPackageInfoEventListener(packageInformationEventCallback);
+ executeCommand(TCT_PACKAGE_MANAGER_TESTv2_INSTALL_COMMAND);
});
diff --git a/common/tct-package-tizen-tests/package/PackageManager_install.html b/common/tct-package-tizen-tests/package/PackageManager_install.html
index 20663a171..1e97ce498 100755
--- a/common/tct-package-tizen-tests/package/PackageManager_install.html
+++ b/common/tct-package-tizen-tests/package/PackageManager_install.html
@@ -40,6 +40,9 @@ Authors:
//==== STEP Run the test.
//==== EXPECT Pass.
//==== TEST_CRITERIA MOA MR MAST
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_UNINSTALL_COMMAND);
+
setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}), wasInProgress = false, installProgressCallback, installError,
diff --git a/common/tct-package-tizen-tests/package/PackageManager_install_without_errorCallback.html b/common/tct-package-tizen-tests/package/PackageManager_install_without_errorCallback.html
index 8e816401a..ee04ac0e6 100755
--- a/common/tct-package-tizen-tests/package/PackageManager_install_without_errorCallback.html
+++ b/common/tct-package-tizen-tests/package/PackageManager_install_without_errorCallback.html
@@ -40,6 +40,9 @@ Authors:
//==== STEP Run the test.
//==== EXPECT Pass.
//==== TEST_CRITERIA MMINA MR MAST
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_UNINSTALL_COMMAND);
+
setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}), wasInProgress = false, installProgressCallback,
diff --git a/common/tct-package-tizen-tests/package/PackageManager_uninstall.html b/common/tct-package-tizen-tests/package/PackageManager_uninstall.html
index e9b53fb2d..a9057add8 100755
--- a/common/tct-package-tizen-tests/package/PackageManager_uninstall.html
+++ b/common/tct-package-tizen-tests/package/PackageManager_uninstall.html
@@ -40,6 +40,9 @@ Authors:
//==== STEP Run the test.
//==== EXPECT Pass.
//==== TEST_CRITERIA MOA MR MAST
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_INSTALL_COMMAND);
+
setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}), wasInProgress = false,
diff --git a/common/tct-package-tizen-tests/package/PackageManager_uninstall_without_errorCallback.html b/common/tct-package-tizen-tests/package/PackageManager_uninstall_without_errorCallback.html
index 1050924bd..50b465dd9 100755
--- a/common/tct-package-tizen-tests/package/PackageManager_uninstall_without_errorCallback.html
+++ b/common/tct-package-tizen-tests/package/PackageManager_uninstall_without_errorCallback.html
@@ -40,6 +40,9 @@ Authors:
//==== STEP Run the test.
//==== EXPECT Pass.
//==== TEST_CRITERIA MMINA MR MAST
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_INSTALL_COMMAND);
+
setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}), wasInProgress = false,
diff --git a/common/tct-package-tizen-tests/package/PackageManager_unsetPackageInfoEventListener.html b/common/tct-package-tizen-tests/package/PackageManager_unsetPackageInfoEventListener.html
index cc6604f36..3f088a822 100755
--- a/common/tct-package-tizen-tests/package/PackageManager_unsetPackageInfoEventListener.html
+++ b/common/tct-package-tizen-tests/package/PackageManager_unsetPackageInfoEventListener.html
@@ -40,6 +40,9 @@ Authors:
//==== STEP Run the test and when you see communicate install TCTPackageManagerTest1.1.1.wgt application from My files app (Phone/Others directory).
//==== EXPECT Pass.
//==== TEST_CRITERIA MNA MNAST MR
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_UNINSTALL_COMMAND);
+
setup({timeout: 90000});
var packageInformationEventCallback, returnedValue = null,
@@ -60,7 +63,7 @@ t.step(function () {
tizen.package.setPackageInfoEventListener(packageInformationEventCallback);
returnedValue = tizen.package.unsetPackageInfoEventListener();
assert_equals(returnedValue, undefined, "Incorrect returned value from unsetPackageInfoEventListener method");
- confirm("Please install TCTPackageManagerTest1.1.1.wgt application from: Others directory.");
+ executeCommand(TCT_PACKAGE_MANAGER_TESTv1_INSTALL_COMMAND);
setTimeout(t.step_func(function () {
t.done();
}), 1000);
diff --git a/common/tct-package-tizen-tests/package/PackageProgressCallback_oncomplete_install.html b/common/tct-package-tizen-tests/package/PackageProgressCallback_oncomplete_install.html
index 67333df9b..e7632df92 100755
--- a/common/tct-package-tizen-tests/package/PackageProgressCallback_oncomplete_install.html
+++ b/common/tct-package-tizen-tests/package/PackageProgressCallback_oncomplete_install.html
@@ -40,6 +40,9 @@ Authors:
//==== STEP Run the test.
//==== EXPECT Pass.
//==== TEST_CRITERIA CBT CBOA
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_UNINSTALL_COMMAND);
+
setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}), installProgressCallback, installError;
diff --git a/common/tct-package-tizen-tests/package/PackageProgressCallback_oncomplete_uninstall.html b/common/tct-package-tizen-tests/package/PackageProgressCallback_oncomplete_uninstall.html
index abfd87cd9..4b699c551 100755
--- a/common/tct-package-tizen-tests/package/PackageProgressCallback_oncomplete_uninstall.html
+++ b/common/tct-package-tizen-tests/package/PackageProgressCallback_oncomplete_uninstall.html
@@ -40,6 +40,9 @@ Authors:
//==== STEP Run the test.
//==== EXPECT Pass.
//==== TEST_CRITERIA CBT CBOA
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_INSTALL_COMMAND);
+
setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}),
diff --git a/common/tct-package-tizen-tests/package/PackageProgressCallback_onprogress_install.html b/common/tct-package-tizen-tests/package/PackageProgressCallback_onprogress_install.html
index f752d9019..eae026a5d 100755
--- a/common/tct-package-tizen-tests/package/PackageProgressCallback_onprogress_install.html
+++ b/common/tct-package-tizen-tests/package/PackageProgressCallback_onprogress_install.html
@@ -40,6 +40,9 @@ Authors:
//==== STEP Run the test.
//==== EXPECT Pass.
//==== TEST_CRITERIA CBT CBOA
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_UNINSTALL_COMMAND);
+
setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}), wasInProgress = false,
diff --git a/common/tct-package-tizen-tests/package/PackageProgressCallback_onprogress_uninstall.html b/common/tct-package-tizen-tests/package/PackageProgressCallback_onprogress_uninstall.html
index c8f847458..88ac23914 100755
--- a/common/tct-package-tizen-tests/package/PackageProgressCallback_onprogress_uninstall.html
+++ b/common/tct-package-tizen-tests/package/PackageProgressCallback_onprogress_uninstall.html
@@ -40,6 +40,9 @@ Authors:
//==== STEP Run the test.
//==== EXPECT Pass.
//==== TEST_CRITERIA CBT CBOA
+
+executeCommand(TCT_PACKAGE_MANAGER_TESTv1_INSTALL_COMMAND);
+
setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}), wasInProgress = false,
diff --git a/common/tct-package-tizen-tests/package/support/package_common.js b/common/tct-package-tizen-tests/package/support/package_common.js
index 9cda11a9d..e4fb37f38 100755
--- a/common/tct-package-tizen-tests/package/support/package_common.js
+++ b/common/tct-package-tizen-tests/package/support/package_common.js
@@ -43,6 +43,13 @@ var TCT_PACKAGE_INFO_TEST_PACKAGE_AUTHOR = "The author of TCTPackageInfoTest";
var TCT_PACKAGE_INFO_TEST_PACKAGE_DESCRIPTION = "The description of TCTPackageInfoTest";
var TCT_PACKAGE_INFO_TEST_PACKAGE_APP_ID = "api1pack20.TCTPackageInfoTest";
+var TCT_WGT_LOCATION = "/opt/usr/home/owner/share/Others/";
+var TCT_PACKAGE_MANAGER_TESTv1_UNINSTALL_COMMAND = "pkgcmd -u -n api1pack10";
+var TCT_PACKAGE_MANAGER_TESTv1_INSTALL_COMMAND = "pkgcmd -i -t wgt -p " + TCT_WGT_LOCATION + "TCTPackageManagerTest1.1.1.wgt";
+
+var TCT_PACKAGE_MANAGER_TESTv2_UNINSTALL_COMMAND = "pkgcmd -u -n api1pack20";
+var TCT_PACKAGE_MANAGER_TESTv2_INSTALL_COMMAND = "pkgcmd -i -t wgt -p " + TCT_WGT_LOCATION + "TCTPackageManagerTest2.2.2.wgt";
+
var NOT_EXISTING_PACKAGE_ID = "api1dummy0";
document.write('');
document.write('');
\ No newline at end of file
diff --git a/common/tct-package-tizen-tests/package/support/unitcommon.js b/common/tct-package-tizen-tests/package/support/unitcommon.js
index 8bccfee32..722de8f2b 100755
--- a/common/tct-package-tizen-tests/package/support/unitcommon.js
+++ b/common/tct-package-tizen-tests/package/support/unitcommon.js
@@ -586,4 +586,17 @@ function getDOMStringConversionArray(isOptional){
typeArr.push(null);
}
return typeArr;
+}
+
+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
diff --git a/common/tct-package-tizen-tests/tests.full.xml b/common/tct-package-tizen-tests/tests.full.xml
index c53226295..bb4c72293 100755
--- a/common/tct-package-tizen-tests/tests.full.xml
+++ b/common/tct-package-tizen-tests/tests.full.xml
@@ -471,7 +471,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is not installed.
@@ -490,7 +490,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (You can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").
@@ -521,7 +521,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is not installed.
@@ -540,7 +540,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is NOT installed.
@@ -571,7 +571,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is NOT installed.
@@ -590,7 +590,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (You can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").
@@ -609,7 +609,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (You can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").
@@ -640,7 +640,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is NOT installed.
@@ -659,7 +659,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is NOT installed.
@@ -678,7 +678,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (You can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").
@@ -697,7 +697,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (You can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").
@@ -812,7 +812,7 @@
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (you can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").
diff --git a/common/tct-package-tizen-tests/tests.xml b/common/tct-package-tizen-tests/tests.xml
index 261ced3a8..9a2cfdc1d 100755
--- a/common/tct-package-tizen-tests/tests.xml
+++ b/common/tct-package-tizen-tests/tests.xml
@@ -198,7 +198,7 @@
/opt/tct-package-tizen-tests/package/PackageProgressCallback_notexist.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is not installed.
@@ -210,7 +210,7 @@
/opt/tct-package-tizen-tests/package/PackageInformationEventCallback_oninstalled.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (You can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").
@@ -227,7 +227,7 @@
/opt/tct-package-tizen-tests/package/PackageManager_setPackageInfoEventListener.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is not installed.
@@ -239,7 +239,7 @@
/opt/tct-package-tizen-tests/package/PackageManager_unsetPackageInfoEventListener.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is NOT installed.
@@ -256,7 +256,7 @@
/opt/tct-package-tizen-tests/package/PackageManager_install_missarg.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is NOT installed.
@@ -268,7 +268,7 @@
/opt/tct-package-tizen-tests/package/PackageManager_install_without_errorCallback.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (You can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").
@@ -280,7 +280,7 @@
/opt/tct-package-tizen-tests/package/PackageManager_uninstall.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (You can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").
@@ -297,7 +297,7 @@
/opt/tct-package-tizen-tests/package/PackageManager_uninstall_missarg.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is NOT installed.
@@ -309,7 +309,7 @@
/opt/tct-package-tizen-tests/package/PackageProgressCallback_oncomplete_install.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is NOT installed.
@@ -321,7 +321,7 @@
/opt/tct-package-tizen-tests/package/PackageProgressCallback_onprogress_install.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (You can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").
@@ -333,7 +333,7 @@
/opt/tct-package-tizen-tests/package/PackageProgressCallback_oncomplete_uninstall.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (You can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").
@@ -385,7 +385,7 @@
/opt/tct-package-tizen-tests/package/PackageManager_uninstall_progressCallback_invalid_cb.html
-
+
Make sure that TCTPackageManagerTest1.1.1.wgt application is installed (you can install it use command "pkgcmd -i -t wgt -q -p {DEVICE_SUITE_TARGET_30}/Others/TCTPackageManagerTest1.1.1.wgt").