From: tangkaiyuan Date: Fri, 19 May 2023 02:29:29 +0000 (+0800) Subject: [common][events-cordova][change manual tcs to auto tcs] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F293053%2F3;p=test%2Ftct%2Fweb%2Fapi.git [common][events-cordova][change manual tcs to auto tcs] Change-Id: I2ef809cbdde349df795752411f47df5c362c6064 Signed-off-by: tangkaiyuan --- diff --git a/common/tct-events-cordova-tests/events/cordova_events_addEventListener_pause.html b/common/tct-events-cordova-tests/events/cordova_events_addEventListener_pause.html index 094b720db..edceba797 100755 --- a/common/tct-events-cordova-tests/events/cordova_events_addEventListener_pause.html +++ b/common/tct-events-cordova-tests/events/cordova_events_addEventListener_pause.html @@ -23,6 +23,7 @@ Authors: cordova_events_addEventListener_pause + @@ -56,6 +57,7 @@ t.step(function () { deviceReady = t.step_func(function() { document.addEventListener("pause", onPause, true); + executeCommand(PAUSE_TEST_APP); }); document.addEventListener("deviceready", deviceReady, true); diff --git a/common/tct-events-cordova-tests/events/cordova_events_addEventListener_resume.html b/common/tct-events-cordova-tests/events/cordova_events_addEventListener_resume.html index 0d9279b66..70d3111bf 100755 --- a/common/tct-events-cordova-tests/events/cordova_events_addEventListener_resume.html +++ b/common/tct-events-cordova-tests/events/cordova_events_addEventListener_resume.html @@ -23,6 +23,7 @@ Authors: cordova_events_addEventListener_resume + @@ -56,6 +57,7 @@ t.step(function () { deviceReady = t.step_func(function() { document.addEventListener("resume", onResume, true); + executeCommand(RESUME_TEST_APP); }); document.addEventListener("deviceready", deviceReady, true); diff --git a/common/tct-events-cordova-tests/events/support/event_common.js b/common/tct-events-cordova-tests/events/support/event_common.js new file mode 100755 index 000000000..efabd98a3 --- /dev/null +++ b/common/tct-events-cordova-tests/events/support/event_common.js @@ -0,0 +1,37 @@ +/* + +Copyright (c) 2014 Samsung Electronics Co., Ltd. + +Licensed under the Apache License, Version 2.0 (the License); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Authors: + + */ + +var PAUSE_TEST_APP = "aul_test pause events0001.CordovaAPIEvents"; +var RESUME_TEST_APP = "aul_test resume events0001.CordovaAPIEvents"; + +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(''); diff --git a/common/tct-events-cordova-tests/tests.full.xml b/common/tct-events-cordova-tests/tests.full.xml index e5be0b28c..270500c57 100755 --- a/common/tct-events-cordova-tests/tests.full.xml +++ b/common/tct-events-cordova-tests/tests.full.xml @@ -39,28 +39,16 @@ - + - - - Run the test and switch to a different application and then return to the test application. - Pass. - - /opt/tct-events-cordova-tests/events/cordova_events_addEventListener_pause.html - + - - - Run the test and switch to a different application and then return to the test application. - Pass. - - /opt/tct-events-cordova-tests/events/cordova_events_addEventListener_resume.html diff --git a/common/tct-events-cordova-tests/tests.xml b/common/tct-events-cordova-tests/tests.xml index 155fecf5b..b762bb358 100755 --- a/common/tct-events-cordova-tests/tests.xml +++ b/common/tct-events-cordova-tests/tests.xml @@ -83,33 +83,13 @@ /opt/tct-events-cordova-tests/events/cordova_events_addEventListener_deviceready.html - + - - - Run the test - TC is running - - - Click the "power" button or switch to a different application and then return to the test application. - TC is pass - - /opt/tct-events-cordova-tests/events/cordova_events_addEventListener_pause.html - + - - - Run the test - TC is running - - - Click the "power" button or switch to a different application and then return to the test application. - TC is pass - - /opt/tct-events-cordova-tests/events/cordova_events_addEventListener_resume.html