From: tangkaiyuan Date: Thu, 29 Dec 2022 06:26:35 +0000 (+0800) Subject: [common][tv-info][change manual tcs to auto tcs] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=281932d4226f038dd296da15a92324c49f4e3c4c;p=test%2Ftct%2Fweb%2Fapi.git [common][tv-info][change manual tcs to auto tcs] Change-Id: Ic872571aee6f4febf75c93e580817b91d058cab2 Signed-off-by: tangkaiyuan --- diff --git a/common/tct-tv-info-tizen-tests/tests.full.xml b/common/tct-tv-info-tizen-tests/tests.full.xml index f016d9992..8a33cfd76 100755 --- a/common/tct-tv-info-tizen-tests/tests.full.xml +++ b/common/tct-tv-info-tizen-tests/tests.full.xml @@ -19,16 +19,8 @@ - + - TV is running normally - - - After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to -enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions. - PASS - - /opt/tct-tv-info-tizen-tests/tv-info/CaptionMenuChangeCallback_onchange.html @@ -51,16 +43,8 @@ enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" - + - TV is running normally - - - After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to -enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions. - PASS - - /opt/tct-tv-info-tizen-tests/tv-info/TVInfoManager_addCaptionValueChangeListener.html @@ -323,16 +307,8 @@ enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" - + - TV is running normally - - - After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to -enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions. - PASS - - /opt/tct-tv-info-tizen-tests/tv-info/TVInfoManager_removeCaptionValueChangeListener.html diff --git a/common/tct-tv-info-tizen-tests/tests.xml b/common/tct-tv-info-tizen-tests/tests.xml index 3278bf153..03cccccfe 100755 --- a/common/tct-tv-info-tizen-tests/tests.xml +++ b/common/tct-tv-info-tizen-tests/tests.xml @@ -12,16 +12,8 @@ /opt/tct-tv-info-tizen-tests/tv-info/CaptionMenuChangeCallback_notexist.html - - - TV is running normally - - - After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to -enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions. - PASS - - + + /opt/tct-tv-info-tizen-tests/tv-info/CaptionMenuChangeCallback_onchange.html @@ -30,16 +22,8 @@ enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" /opt/tct-tv-info-tizen-tests/tv-info/TVInfoManagerObject_notexist.html - + - TV is running normally - - - After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to -enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions. - PASS - - /opt/tct-tv-info-tizen-tests/tv-info/TVInfoManager_addCaptionValueChangeListener.html @@ -148,16 +132,8 @@ enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" /opt/tct-tv-info-tizen-tests/tv-info/TVInfoManager_notexist.html - + - TV is running normally - - - After press Run button, change the caption state (ON to OFF or OFF to ON) using the command 'vconftool set -t int db/menu/caption/caption "1" -f' to -enable captions or the command 'vconftool set -t int db/menu/caption/caption "0" -f' to disable captions. - PASS - - /opt/tct-tv-info-tizen-tests/tv-info/TVInfoManager_removeCaptionValueChangeListener.html diff --git a/common/tct-tv-info-tizen-tests/tv-info/CaptionMenuChangeCallback_onchange.html b/common/tct-tv-info-tizen-tests/tv-info/CaptionMenuChangeCallback_onchange.html index 2305ba314..b466ddcfb 100755 --- a/common/tct-tv-info-tizen-tests/tv-info/CaptionMenuChangeCallback_onchange.html +++ b/common/tct-tv-info-tizen-tests/tv-info/CaptionMenuChangeCallback_onchange.html @@ -23,6 +23,7 @@ Authors: CaptionMenuChangeCallback_onchange +
@@ -44,9 +45,9 @@ setup({timeout: 90000}); var t = async_test(document.title, {timeout: 90000}), watcherId, callback, oldValue; t.step(function () { - callback = t.step_func(function (key, value){ + callback = t.step_func(function (key, value) { assert_equals(key, "CAPTION_ONOFF_KEY", "Incorrect watched key"); - if (oldValue == "CAPTION_ON"){ + if (oldValue == "CAPTION_ON") { assert_equals(value, "CAPTION_OFF", "Incorrect value of watched key"); } else { assert_equals(value, "CAPTION_ON", "Incorrect value of watched key"); @@ -57,6 +58,11 @@ t.step(function () { oldValue = tizen.tvinfo.getCaptionValue("CAPTION_ONOFF_KEY"); watcherId = tizen.tvinfo.addCaptionValueChangeListener("CAPTION_ONOFF_KEY", callback); + if (oldValue == "CAPTION_ON") { + executeCommand(DISABLE_CAPTION); + } else { + executeCommand(ENABLE_CAPTION); + } }); diff --git a/common/tct-tv-info-tizen-tests/tv-info/TVInfoManager_addCaptionValueChangeListener.html b/common/tct-tv-info-tizen-tests/tv-info/TVInfoManager_addCaptionValueChangeListener.html index d18d0ce37..41cc6f316 100755 --- a/common/tct-tv-info-tizen-tests/tv-info/TVInfoManager_addCaptionValueChangeListener.html +++ b/common/tct-tv-info-tizen-tests/tv-info/TVInfoManager_addCaptionValueChangeListener.html @@ -23,6 +23,7 @@ Authors: TVInfoManager_addCaptionValueChangeListener +
@@ -44,11 +45,11 @@ setup({timeout: 90000}); var t = async_test(document.title, {timeout: 90000}), oldValue, watcherId, callback; t.step(function () { - callback = t.step_func(function (key, value){ + callback = t.step_func(function (key, value) { assert_not_equals(watcherId, null, "id should be not null"); assert_type(watcherId, "long", "watcherId should be type of number"); assert_equals(key, "CAPTION_ONOFF_KEY", "Incorrect watched key"); - if (oldValue == "CAPTION_ON"){ + if (oldValue == "CAPTION_ON") { assert_equals(value, "CAPTION_OFF", "Incorrect value of watched key"); } else { assert_equals(value, "CAPTION_ON", "Incorrect value of watched key"); @@ -59,6 +60,11 @@ t.step(function () { oldValue = tizen.tvinfo.getCaptionValue("CAPTION_ONOFF_KEY"); watcherId = tizen.tvinfo.addCaptionValueChangeListener("CAPTION_ONOFF_KEY", callback); + if (oldValue == "CAPTION_ON") { + executeCommand(DISABLE_CAPTION); + } else { + executeCommand(ENABLE_CAPTION); + } }); diff --git a/common/tct-tv-info-tizen-tests/tv-info/TVInfoManager_removeCaptionValueChangeListener.html b/common/tct-tv-info-tizen-tests/tv-info/TVInfoManager_removeCaptionValueChangeListener.html index f71160b6c..630ce6eb0 100755 --- a/common/tct-tv-info-tizen-tests/tv-info/TVInfoManager_removeCaptionValueChangeListener.html +++ b/common/tct-tv-info-tizen-tests/tv-info/TVInfoManager_removeCaptionValueChangeListener.html @@ -23,6 +23,7 @@ Authors: TVInfoManager_removeCaptionValueChangeListener +
@@ -41,16 +42,22 @@ Authors: setup({timeout: 90000}); -var t = async_test(document.title, {timeout: 90000}), watcherId, callback, retValue = null; +var t = async_test(document.title, {timeout: 90000}), oldValue, watcherId, callback, retValue = null; t.step(function () { - callback = t.step_func(function (key, value){ + callback = t.step_func(function (key, value) { retValue = tizen.tvinfo.removeCaptionValueChangeListener(watcherId); assert_equals(retValue, undefined, "removeCaptionValueChangeListener returns wrong value"); t.done(); }); watcherId = tizen.tvinfo.addCaptionValueChangeListener("CAPTION_ONOFF_KEY", callback); + oldValue = tizen.tvinfo.getCaptionValue("CAPTION_ONOFF_KEY"); + if (oldValue == "CAPTION_ON") { + executeCommand(DISABLE_CAPTION); + } else { + executeCommand(ENABLE_CAPTION); + } }); diff --git a/common/tct-tv-info-tizen-tests/tv-info/support/tv-info_common.js b/common/tct-tv-info-tizen-tests/tv-info/support/tv-info_common.js index 6a2b47de8..013d4ba9c 100755 --- a/common/tct-tv-info-tizen-tests/tv-info/support/tv-info_common.js +++ b/common/tct-tv-info-tizen-tests/tv-info/support/tv-info_common.js @@ -42,3 +42,21 @@ var WINDOW_OPACITY_VALUE = ["CAPTION_OPACITY_SOLID", "CAPTION_OPACITY_FLASHING", var EDGE_TYPE_VALUE = ["CAPTION_EDGE_NONE", "CAPTION_EDGE_RAISED", "CAPTION_EDGE_DEPRESSED", "CAPTION_EDGE_UNIFORM", "CAPTION_EDGE_DROP_SHADOWED"]; var CAPTION_STYLE_VALUE = ["CAPTION_STYLE_DEFAULT", "CAPTION_STYLE_BOLD", "CAPTION_STYLE_ITALIC"]; + +DISABLE_CAPTION = 'vconftool set -t int db/menu/caption/caption "0" -f'; +ENABLE_CAPTION = 'vconftool set -t int db/menu/caption/caption "1" -f'; + +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)); +} + +document.write('');