提交 807c5b9e 编写于 作者: G guduhanyan

20220112xts00

Signed-off-by: Nguduhanyan <xuyanjun27@163.com>
上级 86495186
...@@ -14,16 +14,7 @@ ...@@ -14,16 +14,7 @@
import("//build/ohos_var.gni") import("//build/ohos_var.gni")
group("miscservices") { group("miscservices") {
testonly = true testonly = true
if (is_standard_system) { deps = [ "TimeTest_js:time_js_test",
deps = [ "TimeTest_js:time_js_test" ] "TimerTest_js:timer_js_test", ]
} else {
deps = [
"DownloadTest:download_hap",
"InputMethodTest:InputMethodTest_hap",
"pasteboard:testpasteboard_hap",
"screenlock:ScreenLockTest_hap",
"timer:testtimer_hap",
"wallpaper:wallpaperTest_hap",
]
}
} }
...@@ -16,16 +16,16 @@ import("//test/xts/tools/build/suite.gni") ...@@ -16,16 +16,16 @@ import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("time_js_test") { ohos_js_hap_suite("time_js_test") {
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
deps = [ deps = [
":time_js_assets", ":hjs_demo_js_assets",
":time_resources", ":hjs_demo_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsTimeJSApiTest" hap_name = "TimeJSApiTest"
} }
ohos_js_assets("time_js_assets") { ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default" source_dir = "./src/main/js/default"
} }
ohos_resources("time_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
} }
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
"description": "Configuration for time js api Tests", "description": "Configuration for time js api Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "180000", "test-timeout": "21600000",
"package": "ohos.acts.miscservices.timer", "package": "ohos.acts.miscservices.timer",
"shell-timeout": "60000" "shell-timeout": "21600000"
}, },
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"ActsTimeJSApiTest.hap" "TimeJSApiTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
......
...@@ -13,5 +13,4 @@ ...@@ -13,5 +13,4 @@
* limitations under the License. * limitations under the License.
*/ */
require('./Time.test.js')
require('./SystemTimeJsunit.test.js') require('./SystemTimeJsunit.test.js')
\ No newline at end of file
...@@ -1853,4 +1853,132 @@ describe('TimeTest', function() { ...@@ -1853,4 +1853,132 @@ describe('TimeTest', function() {
console.log('SUB_systemTime_setTimezone_JS_API_3000 end'); console.log('SUB_systemTime_setTimezone_JS_API_3000 end');
done() done()
}) })
/**
* @tc.number SUB_systemTime_getTimezone_JS_API_0100
* @tc.name Test systemTime.getTimezone timezone = 'Anadyr, Russia'
* @tc.desc Test systemTime_getTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_getTimezone_test1', 0, async function (done) {
console.log('SUB_systemTime_getTimezone_JS_API_0100 start')
var res = systemTime.getTimeZone()
.then(data =>{
console.log('getTimezone ===data ' + data + res)
expect(true).to.a('boolean')
}).catch(error => {
console.log('getTimezone ===error ' + error)
console.log('getTimezone ===data ' + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_getTimezone_JS_API_0100 end');
done()
})
it('systemTime_getCurrentTime_test1', 0, async function (done) {
console.log('SUB_systemTime_getCurrentTime_JS_API_0100 start')
var res = systemTime.getCurrentTime()
.then(data =>{
console.log('getCurrentTime ===data ' + data + res)
expect(true).to.a('boolean')
}).catch(error => {
console.log('getCurrentTime ===error ' + error)
console.log('getCurrentTime ===data ' + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_getCurrentTime_JS_API_0100 end');
done()
})
it('systemTime_getCurrentTimeNs_test1', 0, async function (done) {
console.log('SUB_systemTimeNs_getCurrentTime_JS_API_0100 start')
var res = systemTime.getCurrentTimeNs()
.then(data =>{
console.log('getCurrentTimeNs ===data ' + data + res)
expect(true).to.a('boolean')
}).catch(error => {
console.log('getCurrentTimeNs ===error ' + error)
console.log('getCurrentTimeNs ===data ' + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_getCurrentTimeNs_JS_API_0100 end');
done()
})
it('systemTime_getRealActiveTime_test1', 0, async function (done) {
console.log('SUB_systemTime_getRealActiveTime_JS_API_0100 start')
var res = systemTime.getRealActiveTime()
.then(data =>{
console.log('getRealActiveTime ===data ' + data + res)
expect(true).to.a('boolean')
}).catch(error => {
console.log('getRealActiveTime ===error ' + error)
console.log('getRealActiveTime ===data ' + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_getRealActiveTime_JS_API_0100 end');
done()
})
it('systemTime_getRealActiveTimeNs_test1', 0, async function (done) {
console.log('SUB_systemTime_getRealActiveTimeNs_JS_API_0100 start')
var res = systemTime.getRealActiveTimeNs()
.then(data =>{
console.log('getRealActiveTimeNs ===data ' + data + res)
expect(true).to.a('boolean')
}).catch(error => {
console.log('getRealActiveTimeNs ===error ' + error)
console.log('getRealActiveTimeNs ===data ' + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_getRealActiveTimeNs_JS_API_0100 end');
done()
})
it('systemTime_getRealTime_test1', 0, async function (done) {
console.log('SUB_systemTime_getRealTime_JS_API_0100 start')
var res = systemTime.getRealTime()
.then(data =>{
console.log('getRealTime ===data ' + data + res)
expect(true).to.a('boolean')
}).catch(error => {
console.log('getRealTime ===error ' + error)
console.log('getRealTime ===data ' + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_getRealTime_JS_API_0100 end');
done()
})
it('systemTime_getRealTimeNs_test1', 0, async function (done) {
console.log('SUB_systemTime_getRealTimeNs_JS_API_0100 start')
var res = systemTime.getRealTimeNs()
.then(data =>{
console.log('getRealTimeNs ===data ' + data + res)
expect(true).to.a('boolean')
}).catch(error => {
console.log('getRealTimeNs ===error ' + error)
console.log('getRealTimeNs ===data ' + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_getRealTimeNs_JS_API_0100 end');
done()
})
it('systemTime_getDate_test1', 0, async function (done) {
console.log('SUB_systemTime_getDate_JS_API_0100 start')
var res = systemTime.getDate()
.then(data =>{
console.log('getDate ===data ' + data + res)
expect(true).to.a('boolean')
}).catch(error => {
console.log('getDate ===error ' + error)
console.log('getDate ===data ' + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_getDate_JS_API_0100 end');
done()
})
}) })
\ No newline at end of file
...@@ -16,16 +16,16 @@ import("//test/xts/tools/build/suite.gni") ...@@ -16,16 +16,16 @@ import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("timer_js_test") { ohos_js_hap_suite("timer_js_test") {
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
deps = [ deps = [
":time_js_assets", ":hjs_demo_js_assets",
":time_resources", ":hjs_demo_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsTimeJSApiTest" hap_name = "TimerJSApiTest"
} }
ohos_js_assets("time_js_assets") { ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default" source_dir = "./src/main/js/default"
} }
ohos_resources("time_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
} }
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
"description": "Configuration for time js api Tests", "description": "Configuration for time js api Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "60000", "test-timeout": "21600000",
"package": "ohos.acts.miscservices.timer", "package": "ohos.acts.miscservices.timer",
"shell-timeout": "60000" "shell-timeout": "21600000"
}, },
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"ActsTimeJSApiTest.hap" "TimerJSApiTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"string": [ "string": [
{ {
"name": "app_name", "name": "app_name",
"value": "JstimeTest" "value": "JstimerTest"
}, },
{ {
"name": "mainability_description", "name": "mainability_description",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册