From: Mateusz Plesinski Date: Thu, 27 Sep 2018 07:30:17 +0000 (+0200) Subject: [TCT-Power]Automating manual tests X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=087961ddc8ea60df0b9b210f01aed4a2eee48e28;p=test%2Ftct%2Fweb%2Fapi.git [TCT-Power]Automating manual tests Changed implementation of manual tests to fully automate them. Tests that has been changed: + PowerManager_isScreenOn_check_change + PowerManager_release_correct_check + PowerManager_request + PowerManager_turnScreenOff + PowerManager_unsetScreenStateStateChangeListener Tests that were already automatic just changed their execution type: + PowerManager_restoreScreenBrightness + PowerManager_restoreScreenBrightness_check_effect Added method executeCommand, to unitcommon.js. Updated documentation on changed tests. Change-Id: I942d46399f4c248d9ad473d0158e375037221f8c Signed-off-by: Mateusz Plesinski --- diff --git a/common/tct-power-tizen-tests/power/PowerManager_isScreenOn_check_change.html b/common/tct-power-tizen-tests/power/PowerManager_isScreenOn_check_change.html index 191be2e5a..743f6572e 100755 --- a/common/tct-power-tizen-tests/power/PowerManager_isScreenOn_check_change.html +++ b/common/tct-power-tizen-tests/power/PowerManager_isScreenOn_check_change.html @@ -49,6 +49,8 @@ function sleep(numberMillis) { //==== PRIORITY P1 //==== TEST_CRITERIA MNA MR +executeCommand(screenTimeoutCommand(15)); + test(function () { var isScreenOn; diff --git a/common/tct-power-tizen-tests/power/PowerManager_release_correct_check.html b/common/tct-power-tizen-tests/power/PowerManager_release_correct_check.html index b45bd8251..d5641c702 100755 --- a/common/tct-power-tizen-tests/power/PowerManager_release_correct_check.html +++ b/common/tct-power-tizen-tests/power/PowerManager_release_correct_check.html @@ -37,22 +37,21 @@ Authors: +
diff --git a/common/tct-power-tizen-tests/power/PowerManager_request.html b/common/tct-power-tizen-tests/power/PowerManager_request.html index e52752a3e..8e67dcd96 100755 --- a/common/tct-power-tizen-tests/power/PowerManager_request.html +++ b/common/tct-power-tizen-tests/power/PowerManager_request.html @@ -37,22 +37,21 @@ Authors: PowerManager_request +
diff --git a/common/tct-power-tizen-tests/power/PowerManager_restoreScreenBrightness_check_effect.html b/common/tct-power-tizen-tests/power/PowerManager_restoreScreenBrightness_check_effect.html index 3eabe1eb9..eb794db9b 100755 --- a/common/tct-power-tizen-tests/power/PowerManager_restoreScreenBrightness_check_effect.html +++ b/common/tct-power-tizen-tests/power/PowerManager_restoreScreenBrightness_check_effect.html @@ -40,7 +40,7 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/power.html //==== STEP Check if restoreScreenBrightness method called with non-optional arguments does what it should //==== EXPECT method does what it should to do -//==== EXECUTION_TYPE manual +//==== EXECUTION_TYPE auto //==== PRIORITY P1 //==== TEST_CRITERIA MNA MNAST var initialValue, defaultValue, currentValue, restoredValue; diff --git a/common/tct-power-tizen-tests/power/PowerManager_turnScreenOff_successful.html b/common/tct-power-tizen-tests/power/PowerManager_turnScreenOff_successful.html index 4f712bc62..85bba8ab7 100755 --- a/common/tct-power-tizen-tests/power/PowerManager_turnScreenOff_successful.html +++ b/common/tct-power-tizen-tests/power/PowerManager_turnScreenOff_successful.html @@ -38,6 +38,8 @@ Authors: + +
@@ -48,6 +50,7 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/power.html //==== PRIORITY P1 //==== TEST_CRITERIA MNA MNAST + setup({timeout: 90000}); var t = async_test(document.title, {timeout: 90000}), powerMgr = tizen.power, isScreenOn, changeCallback; @@ -60,8 +63,9 @@ t.step(function () { }); powerMgr.turnScreenOn(); + powerMgr.setScreenStateChangeListener(changeCallback); + setTimeout(t.step_func(function () { - powerMgr.setScreenStateChangeListener(changeCallback); powerMgr.turnScreenOff(); }), 500); }); diff --git a/common/tct-power-tizen-tests/power/PowerManager_unsetScreenStateChangeListener_successful.html b/common/tct-power-tizen-tests/power/PowerManager_unsetScreenStateChangeListener_successful.html index 8497339d2..5e362b5f4 100755 --- a/common/tct-power-tizen-tests/power/PowerManager_unsetScreenStateChangeListener_successful.html +++ b/common/tct-power-tizen-tests/power/PowerManager_unsetScreenStateChangeListener_successful.html @@ -39,26 +39,23 @@ Authors: + +
diff --git a/common/tct-power-tizen-tests/power/support/power_common.js b/common/tct-power-tizen-tests/power/support/power_common.js index 5234d13b4..19e96b270 100755 --- a/common/tct-power-tizen-tests/power/support/power_common.js +++ b/common/tct-power-tizen-tests/power/support/power_common.js @@ -27,3 +27,10 @@ var NOT_FOUND_ERR = 'NotFoundError'; var PowerScreenStates = [ "SCREEN_OFF", "SCREEN_DIM", "SCREEN_NORMAL" ]; +var TCT_SET_SCREEN_TIMEOUT_COMMAND = "vconftool set -f -t int db/setting/lcd_backlight_normal "; + +function screenTimeoutCommand(time){ + return TCT_SET_SCREEN_TIMEOUT_COMMAND + time; +} + +document.write(''); \ No newline at end of file diff --git a/common/tct-power-tizen-tests/power/support/unitcommon.js b/common/tct-power-tizen-tests/power/support/unitcommon.js index 8651d3469..e729a0371 100755 --- a/common/tct-power-tizen-tests/power/support/unitcommon.js +++ b/common/tct-power-tizen-tests/power/support/unitcommon.js @@ -553,4 +553,19 @@ 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-power-tizen-tests/tests.full.xml b/common/tct-power-tizen-tests/tests.full.xml index 974a55e10..959a44ee8 100755 --- a/common/tct-power-tizen-tests/tests.full.xml +++ b/common/tct-power-tizen-tests/tests.full.xml @@ -175,15 +175,8 @@ - + - Please set backlight time to 15 seconds - - - Click 'Run', do not touch the screen, wait until the screen is changed - Pass - - /opt/tct-power-tizen-tests/power/PowerManager_release_correct_check.html @@ -230,15 +223,8 @@ - + - Please set backlight time to 15 seconds - - - Check whether screen do not turn off - Pass - - /opt/tct-power-tizen-tests/power/PowerManager_request.html @@ -357,14 +343,8 @@ - + - - - Check if restoreScreenBrightness method called with non-optional arguments does what it should - method does what it should to do - - /opt/tct-power-tizen-tests/power/PowerManager_restoreScreenBrightness_check_effect.html @@ -555,18 +535,8 @@ - + - - - Click 'Run' - The screen should be turned off - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-power-tizen-tests/power/PowerManager_turnScreenOff_successful.html @@ -625,18 +595,8 @@ - + - - - Click 'Run' - The screen should be turned locked - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-power-tizen-tests/power/PowerManager_turnScreenOn_successful.html @@ -683,22 +643,8 @@ - + - - - Make sure that backlight time is 15 seconds (Settings, Display). - (None) - - - Click 'Run', do not touch the screen, wait until the screen is locked - The screen should be locked - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-power-tizen-tests/power/PowerManager_unsetScreenStateChangeListener_successful.html @@ -907,15 +853,8 @@ - + - Please set backlight time to 15 seconds - - - Click 'Run', do not touch the screen, wait until the screen is changed - Pass - - /opt/tct-power-tizen-tests/power/PowerManager_release_correct_check.html @@ -962,15 +901,8 @@ - + - Please set backlight time to 15 seconds - - - Check whether screen do not turn off - Pass - - /opt/tct-power-tizen-tests/power/PowerManager_request.html @@ -1089,14 +1021,8 @@ - + - - - Check if restoreScreenBrightness method called with non-optional arguments does what it should - method does what it should to do - - /opt/tct-power-tizen-tests/power/PowerManager_restoreScreenBrightness_check_effect.html @@ -1415,22 +1341,8 @@ - + - - - Make sure that backlight time is 15 seconds (Settings, Display). - (None) - - - Click 'Run', do not touch the screen, wait until the screen is locked - The screen should be locked - - - Unlock the screen and display the test application - The result should be 'Pass' - - /opt/tct-power-tizen-tests/power/PowerManager_unsetScreenStateChangeListener_successful.html diff --git a/common/tct-power-tizen-tests/tests.xml b/common/tct-power-tizen-tests/tests.xml index e378a874e..915efb372 100755 --- a/common/tct-power-tizen-tests/tests.xml +++ b/common/tct-power-tizen-tests/tests.xml @@ -77,15 +77,8 @@ /opt/tct-power-tizen-tests/power/PowerManager_release_TypeMismatch.html - - - Please set backlight time to 15 seconds - - - Click 'Run', do not touch the screen, wait until the screen is changed - Pass - - + + /opt/tct-power-tizen-tests/power/PowerManager_release_correct_check.html @@ -104,15 +97,8 @@ /opt/tct-power-tizen-tests/power/PowerManager_release_resource_TypeMismatch.html - + - Please set backlight time to 15 seconds - - - Check whether screen do not turn off - Pass - - /opt/tct-power-tizen-tests/power/PowerManager_request.html @@ -161,14 +147,8 @@ /opt/tct-power-tizen-tests/power/PowerManager_restoreScreenBrightness.html - + - - - Check if restoreScreenBrightness method called with non-optional arguments does what it should - method does what it should to do - - /opt/tct-power-tizen-tests/power/PowerManager_restoreScreenBrightness_check_effect.html @@ -247,18 +227,8 @@ /opt/tct-power-tizen-tests/power/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-power-tizen-tests/power/PowerManager_turnScreenOff_successful.html @@ -302,22 +272,8 @@ /opt/tct-power-tizen-tests/power/PowerManager_unsetScreenStateChangeListener_extra_argument.html - - - - - Make sure that backlight time is 15 seconds (Settings, Display). - (None) - - - Click 'Run', do not touch the screen, wait until the screen is locked - The screen should be locked - - - Unlock the screen and display the test application - The result should be 'Pass' - - + + /opt/tct-power-tizen-tests/power/PowerManager_unsetScreenStateChangeListener_successful.html @@ -407,15 +363,8 @@ /opt/tct-power-tizen-tests/power/PowerManager_release_TypeMismatch.html - + - Please set backlight time to 15 seconds - - - Click 'Run', do not touch the screen, wait until the screen is changed - Pass - - /opt/tct-power-tizen-tests/power/PowerManager_release_correct_check.html @@ -434,15 +383,8 @@ /opt/tct-power-tizen-tests/power/PowerManager_release_resource_TypeMismatch.html - + - Please set backlight time to 15 seconds - - - Check whether screen do not turn off - Pass - - /opt/tct-power-tizen-tests/power/PowerManager_request.html @@ -491,14 +433,8 @@ /opt/tct-power-tizen-tests/power/PowerManager_restoreScreenBrightness.html - + - - - Check if restoreScreenBrightness method called with non-optional arguments does what it should - method does what it should to do - - /opt/tct-power-tizen-tests/power/PowerManager_restoreScreenBrightness_check_effect.html @@ -602,18 +538,8 @@ /opt/tct-power-tizen-tests/power/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-power-tizen-tests/power/PowerManager_turnScreenOn_successful.html @@ -632,22 +558,8 @@ /opt/tct-power-tizen-tests/power/PowerManager_unsetScreenStateChangeListener_extra_argument.html - - - - - Make sure that backlight time is 15 seconds (Settings, Display). - (None) - - - Click 'Run', do not touch the screen, wait until the screen is locked - The screen should be locked - - - Unlock the screen and display the test application - The result should be 'Pass' - - + + /opt/tct-power-tizen-tests/power/PowerManager_unsetScreenStateChangeListener_successful.html