From daeb12009a22f8104c43eb21c97c99def672e2f7 Mon Sep 17 00:00:00 2001 From: Mateusz Plesinski Date: Thu, 27 Sep 2018 09:36:51 +0200 Subject: [PATCH] [TCT-Deprecatedapi] Automating manual tests Changed implementation of manual tests to fully automate them. Tests that has been changed: + ApplicationManager_addAppInfoEventListener_oninstalled + ApplicationManager_addAppInfoEventListener_onuninstalled + ApplicationManager_addAppInfoEventListener_onupdated Added method executeCommand to unitcommon.js. Updated documentation on changed tests. Change-Id: I561f084c2a584f1c20807f0345b4d92f770a75db Signed-off-by: Mateusz Plesinski --- ...r_addAppInfoEventListener_oninstalled.html | 3 ++ ...addAppInfoEventListener_onuninstalled.html | 3 ++ ...ger_addAppInfoEventListener_onupdated.html | 4 +- .../deprecatedapi/support/app_common.js | 18 +++++++ .../deprecatedapi/support/unitcommon.js | 14 +++++ .../tests.full.xml | 53 +++---------------- .../tct-deprecatedapi-tizen-tests/tests.xml | 53 +++---------------- ...r_addAppInfoEventListener_oninstalled.html | 3 ++ ...addAppInfoEventListener_onuninstalled.html | 3 ++ ...ger_addAppInfoEventListener_onupdated.html | 4 +- .../deprecatedapi/support/app_common.js | 17 ++++++ .../deprecatedapi/support/unitcommon.js | 13 +++++ .../tests.full.xml | 29 ++-------- tv/tct-deprecatedapi-tizen-tests/tests.xml | 29 ++-------- ...r_addAppInfoEventListener_oninstalled.html | 4 ++ ...addAppInfoEventListener_onuninstalled.html | 3 ++ ...ger_addAppInfoEventListener_onupdated.html | 4 +- .../deprecatedapi/support/app_common.js | 17 ++++++ .../deprecatedapi/support/unitcommon.js | 13 +++++ .../tests.full.xml | 53 +++---------------- .../tct-deprecatedapi-tizen-tests/tests.xml | 53 +++---------------- 21 files changed, 152 insertions(+), 241 deletions(-) diff --git a/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html b/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html index 49e3059dd..ef99e9631 100755 --- a/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html +++ b/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html @@ -48,6 +48,8 @@ Authors: //==== PRIORITY P1 //==== TEST_CRITERIA MMINA MAST MR +executeCommand(uninstallApplicationCommand(TCT_APPINFOEVENT1_PKG_NAME)); + setup({timeout: 300000}); var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId; @@ -67,6 +69,7 @@ t.step(function () { watchId = tizen.application.addAppInfoEventListener(appEventCallback); assert_type(watchId, "long", "wrong listener ID"); + executeCommand(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST1_NAME, TCT_WGT_LOCATION)); }); diff --git a/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html b/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html index 9b80cb213..cfdc62fa5 100755 --- a/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html +++ b/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html @@ -48,6 +48,8 @@ Authors: //==== PRIORITY P1 //==== TEST_CRITERIA MMINA MAST MR +executeCommand(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST1_NAME, TCT_WGT_LOCATION)); + setup({timeout: 300000}); var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId; @@ -67,6 +69,7 @@ t.step(function () { watchId = tizen.application.addAppInfoEventListener(appEventCallback); assert_type(watchId, "long", "wrong listener ID"); + executeCommand(uninstallApplicationCommand(TCT_APPINFOEVENT1_PKG_NAME)); }); diff --git a/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html b/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html index f63f552d2..eb0149121 100755 --- a/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html +++ b/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html @@ -48,6 +48,8 @@ Authors: //==== PRIORITY P1 //==== TEST_CRITERIA MMINA MAST MR +executeCommand(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST1_NAME, TCT_WGT_LOCATION)); + setup({timeout: 300000}); var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId; @@ -67,7 +69,7 @@ t.step(function () { watchId = tizen.application.addAppInfoEventListener(appEventCallback); assert_type(watchId, "long", "wrong listener ID"); - + executeCommand(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST2_NAME, TCT_WGT_LOCATION)); }); diff --git a/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js b/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js index 41bb9c1e4..0329f7e41 100755 --- a/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js +++ b/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js @@ -61,8 +61,15 @@ var TCT_APPCONTROL_EXIT_OPERATION = "http://tizen.org/appcontrol/operation/tct/e var TYPE_MISMATCH_ERR = {name: 'TypeMismatchError'}; var TIMEOUT_AUTO_TEST = 30000; + +var TCT_WGT_LOCATION = "/opt/usr/home/owner/share/tct/opt/tct-deprecatedapi-tizen-tests/mediasrc/"; +var TCT_APPINFOEVENT1_PKG_NAME = "api1appli3"; +var TCT_TCTAPPINFOEVENTTEST1_NAME = "TCTAppInfoEventTest1.wgt"; +var TCT_TCTAPPINFOEVENTTEST2_NAME = "TCTAppInfoEventTest2.wgt"; + setup({timeout: TIMEOUT_AUTO_TEST}); + /** * Function runs test in other application (TCTAppControl) and receives * the results. @@ -205,3 +212,14 @@ function assert_not_kill(t, appId, onsuccess) { function assert_exit(t, appId, onsuccess) { assert_kill(t, appId, onsuccess); } + +function installApplicationCommand(appName, path) { + path = path.slice(-1) == "/" ? path : path + "/"; + return "pkgcmd -i -t wgt -q -p" + path + appName; +} + +function uninstallApplicationCommand(appName) { + return "pkgcmd -u -n" + appName; +} + +document.write(''); \ No newline at end of file diff --git a/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js b/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js index 67eb5128b..3e63b6073 100755 --- a/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js +++ b/mobile/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js @@ -562,3 +562,17 @@ 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)); + return response +} \ No newline at end of file diff --git a/mobile/tct-deprecatedapi-tizen-tests/tests.full.xml b/mobile/tct-deprecatedapi-tizen-tests/tests.full.xml index f6d3b5830..8bff10b26 100755 --- a/mobile/tct-deprecatedapi-tizen-tests/tests.full.xml +++ b/mobile/tct-deprecatedapi-tizen-tests/tests.full.xml @@ -101,15 +101,8 @@ - - - Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it) - - - Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt". - Pass - - + + /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html @@ -120,15 +113,8 @@ - + - Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt"). - - - Click run and uninstall TCTAppInfoEventTest1 application. - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html @@ -139,15 +125,8 @@ - + - Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt"). - - - Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest2.wgt". - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html @@ -220,18 +199,8 @@ - + - - - Click 'Run' - The screen should be turned off - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOff_successful.html @@ -290,18 +259,8 @@ - + - - - Click 'Run' - The screen should be turned locked - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOn_successful.html diff --git a/mobile/tct-deprecatedapi-tizen-tests/tests.xml b/mobile/tct-deprecatedapi-tizen-tests/tests.xml index fd083a909..7e7285110 100755 --- a/mobile/tct-deprecatedapi-tizen-tests/tests.xml +++ b/mobile/tct-deprecatedapi-tizen-tests/tests.xml @@ -45,39 +45,18 @@ /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_missarg.html - - - Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it) - - - Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt". - Pass - - + + /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html - + - 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"). - - - Click run and uninstall TCTAppInfoEventTest1 application. - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html - + - 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"). - - - Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest2.wgt". - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html @@ -116,18 +95,8 @@ /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOn_method_exists.html - + - - - Click 'Run' - The screen should be turned locked - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOn_successful.html @@ -146,18 +115,8 @@ /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOff_extra_argument.html - + - - - Click 'Run' - The screen should be turned off - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOff_successful.html diff --git a/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html b/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html index 49e3059dd..ef99e9631 100755 --- a/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html +++ b/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html @@ -48,6 +48,8 @@ Authors: //==== PRIORITY P1 //==== TEST_CRITERIA MMINA MAST MR +executeCommand(uninstallApplicationCommand(TCT_APPINFOEVENT1_PKG_NAME)); + setup({timeout: 300000}); var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId; @@ -67,6 +69,7 @@ t.step(function () { watchId = tizen.application.addAppInfoEventListener(appEventCallback); assert_type(watchId, "long", "wrong listener ID"); + executeCommand(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST1_NAME, TCT_WGT_LOCATION)); }); diff --git a/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html b/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html index 9b80cb213..cfdc62fa5 100755 --- a/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html +++ b/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html @@ -48,6 +48,8 @@ Authors: //==== PRIORITY P1 //==== TEST_CRITERIA MMINA MAST MR +executeCommand(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST1_NAME, TCT_WGT_LOCATION)); + setup({timeout: 300000}); var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId; @@ -67,6 +69,7 @@ t.step(function () { watchId = tizen.application.addAppInfoEventListener(appEventCallback); assert_type(watchId, "long", "wrong listener ID"); + executeCommand(uninstallApplicationCommand(TCT_APPINFOEVENT1_PKG_NAME)); }); diff --git a/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html b/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html index f63f552d2..eb0149121 100755 --- a/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html +++ b/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html @@ -48,6 +48,8 @@ Authors: //==== PRIORITY P1 //==== TEST_CRITERIA MMINA MAST MR +executeCommand(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST1_NAME, TCT_WGT_LOCATION)); + setup({timeout: 300000}); var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId; @@ -67,7 +69,7 @@ t.step(function () { watchId = tizen.application.addAppInfoEventListener(appEventCallback); assert_type(watchId, "long", "wrong listener ID"); - + executeCommand(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST2_NAME, TCT_WGT_LOCATION)); }); diff --git a/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js b/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js index 41bb9c1e4..657f54609 100755 --- a/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js +++ b/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js @@ -61,6 +61,12 @@ var TCT_APPCONTROL_EXIT_OPERATION = "http://tizen.org/appcontrol/operation/tct/e var TYPE_MISMATCH_ERR = {name: 'TypeMismatchError'}; var TIMEOUT_AUTO_TEST = 30000; + +var TCT_WGT_LOCATION = "/opt/usr/home/owner/share/tct/opt/tct-deprecatedapi-tizen-tests/mediasrc/"; +var TCT_APPINFOEVENT1_PKG_NAME = "api1appli3"; +var TCT_TCTAPPINFOEVENTTEST1_NAME = "TCTAppInfoEventTest1.wgt"; +var TCT_TCTAPPINFOEVENTTEST2_NAME = "TCTAppInfoEventTest2.wgt"; + setup({timeout: TIMEOUT_AUTO_TEST}); /** @@ -205,3 +211,14 @@ function assert_not_kill(t, appId, onsuccess) { function assert_exit(t, appId, onsuccess) { assert_kill(t, appId, onsuccess); } + +function installApplicationCommand(appName, path) { + path = path.slice(-1) == "/" ? path : path + "/"; + return "pkgcmd -i -t wgt -q -p" + path + appName; +} + +function uninstallApplicationCommand(appName) { + return "pkgcmd -u -n" + appName; +} + +document.write(''); \ No newline at end of file diff --git a/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js b/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js index 67eb5128b..ebc701ceb 100755 --- a/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js +++ b/tv/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js @@ -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 diff --git a/tv/tct-deprecatedapi-tizen-tests/tests.full.xml b/tv/tct-deprecatedapi-tizen-tests/tests.full.xml index fe410f478..3dbd1a989 100755 --- a/tv/tct-deprecatedapi-tizen-tests/tests.full.xml +++ b/tv/tct-deprecatedapi-tizen-tests/tests.full.xml @@ -65,15 +65,8 @@ - - - Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it) - - - Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt". - Pass - - + + /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html @@ -84,15 +77,8 @@ - + - Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt"). - - - Click run and uninstall TCTAppInfoEventTest1 application. - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html @@ -103,15 +89,8 @@ - + - Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt"). - - - Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest2.wgt". - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html diff --git a/tv/tct-deprecatedapi-tizen-tests/tests.xml b/tv/tct-deprecatedapi-tizen-tests/tests.xml index 42c43a837..2a7572184 100755 --- a/tv/tct-deprecatedapi-tizen-tests/tests.xml +++ b/tv/tct-deprecatedapi-tizen-tests/tests.xml @@ -30,39 +30,18 @@ /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_missarg.html - - - Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it) - - - Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-deprecatedapi-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt". - Pass - - + + /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html - + - Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-deprecatedapi-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt"). - - - Click run and uninstall TCTAppInfoEventTest1 application. - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html - + - Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-deprecatedapi-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt"). - - - Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-deprecatedapi-tizen-tests/mediasrc/TCTAppInfoEventTest2.wgt". - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html diff --git a/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html b/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html index 49e3059dd..c6f9dc0db 100755 --- a/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html +++ b/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html @@ -48,6 +48,8 @@ Authors: //==== PRIORITY P1 //==== TEST_CRITERIA MMINA MAST MR +executeCommand(uninstallApplicationCommand(TCT_APPINFOEVENT1_PKG_NAME)); + 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(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST1_NAME, TCT_WGT_LOCATION)); + }); diff --git a/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html b/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html index 9b80cb213..cfdc62fa5 100755 --- a/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html +++ b/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html @@ -48,6 +48,8 @@ Authors: //==== PRIORITY P1 //==== TEST_CRITERIA MMINA MAST MR +executeCommand(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST1_NAME, TCT_WGT_LOCATION)); + setup({timeout: 300000}); var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId; @@ -67,6 +69,7 @@ t.step(function () { watchId = tizen.application.addAppInfoEventListener(appEventCallback); assert_type(watchId, "long", "wrong listener ID"); + executeCommand(uninstallApplicationCommand(TCT_APPINFOEVENT1_PKG_NAME)); }); diff --git a/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html b/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html index f63f552d2..eb0149121 100755 --- a/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html +++ b/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html @@ -48,6 +48,8 @@ Authors: //==== PRIORITY P1 //==== TEST_CRITERIA MMINA MAST MR +executeCommand(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST1_NAME, TCT_WGT_LOCATION)); + setup({timeout: 300000}); var t = async_test(document.title, {timeout: 300000}), appEventCallback, watchId; @@ -67,7 +69,7 @@ t.step(function () { watchId = tizen.application.addAppInfoEventListener(appEventCallback); assert_type(watchId, "long", "wrong listener ID"); - + executeCommand(installApplicationCommand(TCT_TCTAPPINFOEVENTTEST2_NAME, TCT_WGT_LOCATION)); }); diff --git a/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js b/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js index 41bb9c1e4..657f54609 100755 --- a/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js +++ b/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/support/app_common.js @@ -61,6 +61,12 @@ var TCT_APPCONTROL_EXIT_OPERATION = "http://tizen.org/appcontrol/operation/tct/e var TYPE_MISMATCH_ERR = {name: 'TypeMismatchError'}; var TIMEOUT_AUTO_TEST = 30000; + +var TCT_WGT_LOCATION = "/opt/usr/home/owner/share/tct/opt/tct-deprecatedapi-tizen-tests/mediasrc/"; +var TCT_APPINFOEVENT1_PKG_NAME = "api1appli3"; +var TCT_TCTAPPINFOEVENTTEST1_NAME = "TCTAppInfoEventTest1.wgt"; +var TCT_TCTAPPINFOEVENTTEST2_NAME = "TCTAppInfoEventTest2.wgt"; + setup({timeout: TIMEOUT_AUTO_TEST}); /** @@ -205,3 +211,14 @@ function assert_not_kill(t, appId, onsuccess) { function assert_exit(t, appId, onsuccess) { assert_kill(t, appId, onsuccess); } + +function installApplicationCommand(appName, path) { + path = path.slice(-1) == "/" ? path : path + "/"; + return "pkgcmd -i -t wgt -q -p" + path + appName; +} + +function uninstallApplicationCommand(appName) { + return "pkgcmd -u -n" + appName; +} + +document.write(''); \ No newline at end of file diff --git a/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js b/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js index 67eb5128b..ebc701ceb 100755 --- a/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js +++ b/wearable/tct-deprecatedapi-tizen-tests/deprecatedapi/support/unitcommon.js @@ -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 diff --git a/wearable/tct-deprecatedapi-tizen-tests/tests.full.xml b/wearable/tct-deprecatedapi-tizen-tests/tests.full.xml index 86f8cd1a0..92d016389 100755 --- a/wearable/tct-deprecatedapi-tizen-tests/tests.full.xml +++ b/wearable/tct-deprecatedapi-tizen-tests/tests.full.xml @@ -65,15 +65,8 @@ - - - Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it) - - - Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt". - Pass - - + + /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html @@ -84,15 +77,8 @@ - + - Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt"). - - - Click run and uninstall TCTAppInfoEventTest1 application. - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html @@ -103,15 +89,8 @@ - + - Make sure that TCTAppInfoEventTest1 application is installed (you can install it using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest1.wgt"). - - - Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/tct/opt/tct-application-tizen-tests/mediasrc/TCTAppInfoEventTest2.wgt". - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html @@ -184,18 +163,8 @@ - + - - - Click 'Run' - The screen should be turned off - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOff_successful.html @@ -254,18 +223,8 @@ - + - - - Click 'Run' - The screen should be turned locked - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOn_successful.html diff --git a/wearable/tct-deprecatedapi-tizen-tests/tests.xml b/wearable/tct-deprecatedapi-tizen-tests/tests.xml index f7d516901..8ee5aba39 100755 --- a/wearable/tct-deprecatedapi-tizen-tests/tests.xml +++ b/wearable/tct-deprecatedapi-tizen-tests/tests.xml @@ -30,39 +30,18 @@ /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_missarg.html - - - Make sure that TCTAppInfoEventTest1 application is not installed (uninstall it) - - - Click run and install TCTAppInfoEventTest1.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest1.wgt". - Pass - - + + /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_oninstalled.html - + - 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"). - - - Click run and uninstall TCTAppInfoEventTest1 application. - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onuninstalled.html - + - 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"). - - - Click run and install TCTAppInfoEventTest2.wgt application using command "pkgcmd –i –t wgt -q –p {DEVICE_SUITE_TARGET_30}/Others/TCTAppInfoEventTest2.wgt". - Pass - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/ApplicationManager_addAppInfoEventListener_onupdated.html @@ -101,18 +80,8 @@ /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOn_method_exists.html - + - - - Click 'Run' - The screen should be turned locked - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOn_successful.html @@ -131,18 +100,8 @@ /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOff_extra_argument.html - + - - - Click 'Run' - The screen should be turned off - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-deprecatedapi-tizen-tests/deprecatedapi/PowerManager_turnScreenOff_successful.html -- 2.34.1