From: lin qunfang Date: Tue, 8 May 2018 13:09:00 +0000 (+0800) Subject: [common][humanactivitymonitor][DPTTIZEN-3019, optimize readRecorderData_type_HRM tc] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d6dab9d7802bbf663b64e1a9eac92d6a082883c;p=test%2Ftct%2Fweb%2Fapi.git [common][humanactivitymonitor][DPTTIZEN-3019, optimize readRecorderData_type_HRM tc] Change-Id: Iec0554f40b35ff1c72cad578b48e61b7c8f453ec Signed-off-by: lin qunfang --- diff --git a/common/tct-humanactivitymonitor-tizen-tests/humanactivitymonitor/HumanActivityMonitorManager_readRecorderData_type_HRM.html b/common/tct-humanactivitymonitor-tizen-tests/humanactivitymonitor/HumanActivityMonitorManager_readRecorderData_type_HRM.html index 4d6ecb760..3770738b5 100755 --- a/common/tct-humanactivitymonitor-tizen-tests/humanactivitymonitor/HumanActivityMonitorManager_readRecorderData_type_HRM.html +++ b/common/tct-humanactivitymonitor-tizen-tests/humanactivitymonitor/HumanActivityMonitorManager_readRecorderData_type_HRM.html @@ -39,7 +39,9 @@ Authors: setup({timeout: 1500000}); -var t = async_test(document.title, {timeout: 1500000}), retValue = null, successCallback, date = new Date(), endTime = date.getTime() + 1200000, startTime = date.setDate(date.getDate() - 1), +var t = async_test(document.title, {timeout: 1500000}), retValue = null, successCallback, date = new Date(), + endTime = date.getTime() + 1200000, startTime = date.setDate(date.getDate() - 1), tries = 120; + options = { interval: 10, retentionPeriod: 1 @@ -50,9 +52,20 @@ var t = async_test(document.title, {timeout: 1500000}), retValue = null, success interval: 10 }; +function testReadRecorderData() { + retValue = tizen.humanactivitymonitor.readRecorderData("HRM", query, successCallback); + tries--; + if (tries > 0) { + setTimeout(testReadRecorderData, 10000); + } else { + assert_unreached("No data has been collected"); + } +} + t.step(function () { add_result_callback(function () { tizen.humanactivitymonitor.stopRecorder("HRM"); + tizen.humanactivitymonitor.stop("HRM"); }); successCallback = t.step_func(function (humanactivitydata) { @@ -64,9 +77,9 @@ t.step(function () { assert_unreached("Invalid error callback invoked:" + error.name + ": " + error.message); }); + tizen.humanactivitymonitor.start("HRM"); tizen.humanactivitymonitor.startRecorder("HRM", options); - setTimeout(function() { - retValue = tizen.humanactivitymonitor.readRecorderData("HRM", query, successCallback);}, 600000); + setTimeout(testReadRecorderData, 10000); }); diff --git a/common/tct-humanactivitymonitor-tizen-tests/tests.full.xml b/common/tct-humanactivitymonitor-tizen-tests/tests.full.xml index 26515ec66..6310654a7 100755 --- a/common/tct-humanactivitymonitor-tizen-tests/tests.full.xml +++ b/common/tct-humanactivitymonitor-tizen-tests/tests.full.xml @@ -1689,7 +1689,7 @@ - Waiting for 10 minutes for the callback. + Watch has to be weared on wrist. Waiting for 10 minutes for the callback. Pass should be shown in the page after 10 minutes. diff --git a/common/tct-humanactivitymonitor-tizen-tests/tests.xml b/common/tct-humanactivitymonitor-tizen-tests/tests.xml index e70dcecab..b22276209 100755 --- a/common/tct-humanactivitymonitor-tizen-tests/tests.xml +++ b/common/tct-humanactivitymonitor-tizen-tests/tests.xml @@ -873,7 +873,7 @@ - Waiting for 10 minutes for the callback. + Watch has to be weared on wrist. Waiting for 10 minutes for the callback. Pass should be shown in the page after 10 minutes.