From: Mateusz Plesinski Date: Thu, 27 Sep 2018 07:31:59 +0000 (+0200) Subject: [TCT-Sound]Automating manual tests X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=009f970d95efadcb016d3d054a59cd8b86eeba48;p=test%2Ftct%2Fweb%2Fapi.git [TCT-Sound]Automating manual tests Changed implementation of manual tests to fully automate them. Tests that has been changed: + SoundManager_setSoundModeChangeListener + SoundManager_unsetSoundModeChangeListener + SoundModeChangeCallback_onsuccess Added method executeCommand to unitcommon.js. Updated documentation on changed tests. Change-Id: I44c0948645dc2dc516aaa0ce373775ec5662cd0e Signed-off-by: Mateusz Plesinski --- diff --git a/common/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener.html b/common/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener.html index d1b9d8b80..4a0653a95 100755 --- a/common/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener.html +++ b/common/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener.html @@ -23,6 +23,7 @@ Authors: SoundManager_setSoundModeChangeListener +
@@ -34,6 +35,9 @@ Authors: //==== PRIORITY P1 //==== TEST_CRITERIA MR +executeCommand(setSoundStateCommand(true)); +executeCommand(setVibrationStateCommand(true)); + setup({timeout: 30000}); var t = async_test(document.title, {timeout: 30000}), successCallback, retValue; @@ -47,8 +51,8 @@ t.step(function () { }); retValue = tizen.sound.setSoundModeChangeListener(successCallback); - alert("1. Goto Settings -> Sound -> Sound mode -> Vibration" + - "2. Then swich back to testing page\n"); + + executeCommand(setSoundStateCommand(false)); }); diff --git a/common/tct-sound-tizen-tests/sound/SoundManager_unsetSoundModeChangeListener.html b/common/tct-sound-tizen-tests/sound/SoundManager_unsetSoundModeChangeListener.html index c6489fc44..33fcee46a 100755 --- a/common/tct-sound-tizen-tests/sound/SoundManager_unsetSoundModeChangeListener.html +++ b/common/tct-sound-tizen-tests/sound/SoundManager_unsetSoundModeChangeListener.html @@ -23,6 +23,7 @@ Authors: SoundManager_unsetSoundModeChangeListener +
@@ -34,6 +35,9 @@ Authors: //==== PRIORITY: P1 //==== TEST_CRITERIA MR MAST +executeCommand(setSoundStateCommand(true)); +executeCommand(setVibrationStateCommand(true)); + setup({timeout: 30000}); var t = async_test(document.title, {timeout: 30000}), successCallback, retValue = null; @@ -46,8 +50,8 @@ t.step(function () { t.done(); }); tizen.sound.setSoundModeChangeListener(successCallback); - alert("1. Goto Settings -> Sound -> Sound mode -> Vibrate" + - "2. Then swich back to testing page\n"); + + executeCommand(setSoundStateCommand(false)); }); diff --git a/common/tct-sound-tizen-tests/sound/SoundModeChangeCallback_onsuccess.html b/common/tct-sound-tizen-tests/sound/SoundModeChangeCallback_onsuccess.html index f76eba931..3937837e2 100755 --- a/common/tct-sound-tizen-tests/sound/SoundModeChangeCallback_onsuccess.html +++ b/common/tct-sound-tizen-tests/sound/SoundModeChangeCallback_onsuccess.html @@ -22,6 +22,7 @@ Authors: SoundModeChangeCallback_onsuccess + @@ -34,6 +35,9 @@ Authors: //==== PRIORITY P1 //==== TEST_CRITERIA CBOA CBT +executeCommand(setSoundStateCommand(true)); +executeCommand(setVibrationStateCommand(true)); + setup({timeout: 30000}); var t = async_test(document.title, {timeout: 30000}), getSuccess, successCallback; @@ -46,8 +50,8 @@ t.step(function () { }); tizen.sound.setSoundModeChangeListener(successCallback); - alert("1. Goto Settings -> Sound -> Sound mode -> Vibration" + - "2. Then swich back to testing page\n"); + + executeCommand(setSoundStateCommand(false)); }); diff --git a/common/tct-sound-tizen-tests/sound/support/sound_common.js b/common/tct-sound-tizen-tests/sound/support/sound_common.js index 4b2d2586a..766bff111 100755 --- a/common/tct-sound-tizen-tests/sound/support/sound_common.js +++ b/common/tct-sound-tizen-tests/sound/support/sound_common.js @@ -28,4 +28,26 @@ var SECURITY_ERR = "SecurityError"; var NOT_FOUND_ERR = "NotFoundError"; var NOT_SUPPORT_ERR = "NotSupportedError"; -var APPLICATION_ID = "testalar00.alarmTestApp"; \ No newline at end of file +var APPLICATION_ID = "testalar00.alarmTestApp"; + +function setSoundStateCommand(turnOn){ + var TCT_SET_SOUND_COMMAND = "vconftool set -f -t bool db/setting/sound/sound_on"; + + if (turnOn){ + return TCT_SET_SOUND_COMMAND + " 1"; + } else { + return TCT_SET_SOUND_COMMAND + " 0"; + } +} + +function setVibrationStateCommand(turnOn){ + var TCT_SET_VIBRATION_COMMAND = "vconftool set -f -t bool db/setting/sound/vibration_on"; + + if (turnOn){ + return TCT_SET_VIBRATION_COMMAND + " 1"; + } else { + return TCT_SET_VIBRATION_COMMAND + " 0"; + } +} + +document.write(''); \ No newline at end of file diff --git a/common/tct-sound-tizen-tests/sound/support/unitcommon.js b/common/tct-sound-tizen-tests/sound/support/unitcommon.js index e53a7ecd4..2d323a894 100755 --- a/common/tct-sound-tizen-tests/sound/support/unitcommon.js +++ b/common/tct-sound-tizen-tests/sound/support/unitcommon.js @@ -588,3 +588,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/common/tct-sound-tizen-tests/tests.full.xml b/common/tct-sound-tizen-tests/tests.full.xml index e6cc75f83..217274f31 100755 --- a/common/tct-sound-tizen-tests/tests.full.xml +++ b/common/tct-sound-tizen-tests/tests.full.xml @@ -343,15 +343,8 @@ - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"Vibration" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener.html @@ -410,15 +403,8 @@ - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"mute" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundManager_unsetSoundModeChangeListener.html @@ -465,15 +451,8 @@ - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"Vibration" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundModeChangeCallback_onsuccess.html @@ -1137,15 +1116,8 @@ - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"Vibration" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener.html @@ -1204,15 +1176,8 @@ - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"mute" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundManager_unsetSoundModeChangeListener.html @@ -1259,15 +1224,8 @@ - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"Vibration" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundModeChangeCallback_onsuccess.html diff --git a/common/tct-sound-tizen-tests/tests.xml b/common/tct-sound-tizen-tests/tests.xml index 63dc2ec01..fd5f3c094 100755 --- a/common/tct-sound-tizen-tests/tests.xml +++ b/common/tct-sound-tizen-tests/tests.xml @@ -146,15 +146,8 @@ /opt/tct-sound-tizen-tests/sound/SoundManager_getSoundMode_extra_argument.html - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"Vibration" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener.html @@ -178,15 +171,8 @@ /opt/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener_misarg.html - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"vibrate" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundManager_unsetSoundModeChangeListener.html @@ -205,15 +191,8 @@ /opt/tct-sound-tizen-tests/sound/SoundModeChangeCallback_notexist.html - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"Vibration" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundModeChangeCallback_onsuccess.html @@ -501,15 +480,8 @@ /opt/tct-sound-tizen-tests/sound/SoundManager_getSoundMode_extra_argument.html - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"Vibration" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener.html @@ -533,15 +505,8 @@ /opt/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener_misarg.html - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"vibrate" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundManager_unsetSoundModeChangeListener.html @@ -560,15 +525,8 @@ /opt/tct-sound-tizen-tests/sound/SoundModeChangeCallback_notexist.html - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"Vibration" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundModeChangeCallback_onsuccess.html @@ -856,15 +814,8 @@ /opt/tct-sound-tizen-tests/sound/SoundManager_getSoundMode_extra_argument.html - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"Vibration" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener.html @@ -888,15 +839,8 @@ /opt/tct-sound-tizen-tests/sound/SoundManager_setSoundModeChangeListener_misarg.html - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"vibrate" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundManager_unsetSoundModeChangeListener.html @@ -915,15 +859,8 @@ /opt/tct-sound-tizen-tests/sound/SoundModeChangeCallback_notexist.html - + - before Click run,set "sound" in sound mode(without sound mode changes,the change callback won't be invoked - - - Settings -> Sound -> Sound mode ->"Vibration" - Pass - - /opt/tct-sound-tizen-tests/sound/SoundModeChangeCallback_onsuccess.html