提交 ba5af568 编写于 作者: G guduhanyan

xts2022012700

Signed-off-by: Nguduhanyan <xuyanjun27@163.com>
上级 c9358505
...@@ -20,1965 +20,1103 @@ import systemTime from '@ohos.systemtime' ...@@ -20,1965 +20,1103 @@ import systemTime from '@ohos.systemtime'
describe('TimeTest', function() { describe('TimeTest', function() {
console.log('start################################start'); console.log('start################################start');
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_0100 * @tc.number SUB_systemTime_setTimezone_JS_API_0100
* @tc.name Test systemTime.setTime time = 0 * @tc.name Test systemTime.setTimezone timezone = 'Anadyr, Russia'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test1', 0, async function (done) { it('systemTime_setTimezone_test1',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_0100 start") console.log('SUB_systemTime_setTimezone_JS_API_0100 start')
systemTime.setTime(0) var timezone = 'Anadyr, Russia'
.then(data =>{
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_0100 end'); console.log('SUB_systemTime_setTimezone_JS_API_0100 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_0200 * @tc.number SUB_systemTime_setTimezone_JS_API_0200
* @tc.name Test systemTime.setTime time = 1 * @tc.name Test systemTime.setTimezone timezone = 'Honiara, SolomonIslands'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test2', 0, async function (done) { it('systemTime_setTimezone_test2',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_0200 start") console.log('SUB_systemTime_setTimezone_JS_API_0200 start')
systemTime.setTime(1) var timezone = 'Honiara, SolomonIslands'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_0200 end'); console.log('SUB_systemTime_setTimezone_JS_API_0200 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_0300 * @tc.number SUB_systemTime_setTimezone_JS_API_0300
* @tc.name Test systemTime.setTime time = Number.MAX_VALUE/2 * @tc.name Test systemTime.setTimezone timezone = 'Melbourne, Australia'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test3', 0, async function (done) { it('systemTime_setTimezone_test3',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_0300 start") console.log('SUB_systemTime_setTimezone_JS_API_0300 start')
systemTime.setTime(Number.MAX_VALUE/2) var timezone = 'Melbourne, Australia'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_0300 end'); console.log('SUB_systemTime_setTimezone_JS_API_0300 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_0400 * @tc.number SUB_systemTime_setTimezone_JS_API_0400
* @tc.name Test systemTime.setTime4 time = Number.MAX_VALUE - 1 * @tc.name Test systemTime.setTimezone timezone = 'Tokyo, Japan'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test4', 0, async function (done) { it('systemTime_setTimezone_test4',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_0400 start") console.log('SUB_systemTime_setTimezone_JS_API_0400 start')
systemTime.setTime(Number.MAX_VALUE - 1) var timezone = 'Tokyo, Japan'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_0400 end'); console.log('SUB_systemTime_setTimezone_JS_API_0400 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_0500 * @tc.number SUB_systemTime_setTimezone_JS_API_0500
* @tc.name Test systemTime.setTime time = Number.MAX_VALUE * @tc.name Test systemTime.setTimezone timezone = 'Beijing, China'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test5', 0, async function (done) { it('systemTime_setTimezone_test5',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_0500 start") console.log('SUB_systemTime_setTimezone_JS_API_0500 start')
systemTime.setTime(Number.MAX_VALUE) var timezone = 'Beijing, China'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_0500 end'); console.log('SUB_systemTime_setTimezone_JS_API_0500 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_0600 * @tc.number SUB_systemTime_setTimezone_JS_API_0600
* @tc.name Test systemTime.setTime time = Number.MIN_VALUE * @tc.name Test systemTime.setTimezone timezone = 'Jakarta, Indonesia'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test6', 0, async function (done) { it('systemTime_setTimezone_test6',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_0600 start") console.log('SUB_systemTime_setTimezone_JS_API_0600 start')
systemTime.setTime(Number.MIN_VALUE) var timezone = 'Jakarta, Indonesia'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_0600 end'); console.log('SUB_systemTime_setTimezone_JS_API_0600 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_0700 * @tc.number SUB_systemTime_setTimezone_JS_API_0700
* @tc.name Test systemTime.setTime time = -1 * @tc.name Test systemTime.setTimezone timezone = 'Dhaka, Bangladesh'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test7', 0, async function (done) { it('systemTime_setTimezone_test7',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_0700 start") console.log('SUB_systemTime_setTimezone_JS_API_0700 start')
systemTime.setTime(-1) var timezone = 'Dhaka, Bangladesh'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_0700 end'); console.log('SUB_systemTime_setTimezone_JS_API_0700 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_0800 * @tc.number SUB_systemTime_setTimezone_JS_API_0800
* @tc.name Test systemTime.setTime time = -Number.MIN_VALUE * @tc.name Test systemTime.setTimezone timezone = 'Tashkent, Uzbekistan'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test8', 0, async function (done) { it('systemTime_setTimezone_test8',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_0800 start") console.log('SUB_systemTime_setTimezone_JS_API_0800 start')
systemTime.setTime(-Number.MIN_VALUE) var timezone = 'Tashkent, Uzbekistan'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_0800 end'); console.log('SUB_systemTime_setTimezone_JS_API_0800 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_0900 * @tc.number SUB_systemTime_setTimezone_JS_API_0900
* @tc.name Test systemTime.setTime time = -Number.MAX_VALUE/2 * @tc.name Test systemTime.setTimezone timezone = 'Dubai, U.A.E.'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test9', 0, async function (done) { it('systemTime_setTimezone_test9',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_0900 start") console.log('SUB_systemTime_setTimezone_JS_API_0900 start')
systemTime.setTime(-Number.MAX_VALUE/2) var timezone = 'Dubai, U.A.E.'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_0900 end'); console.log('SUB_systemTime_setTimezone_JS_API_0900 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_1000 * @tc.number SUB_systemTime_setTimezone_JS_API_1000
* @tc.name Test systemTime.setTime time = -Number.MAX_VALUE + 1 * @tc.name Test systemTime.setTimezone timezone = 'Moscow, Russia'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test10', 0, async function (done) { it('systemTime_setTimezone_test10',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_1000 start") console.log('SUB_systemTime_setTimezone_JS_API_1000 start')
systemTime.setTime(-Number.MAX_VALUE + 1) var timezone = 'Moscow, Russia'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_1000 end'); console.log('SUB_systemTime_setTimezone_JS_API_1000 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_1100 * @tc.number SUB_systemTime_setTimezone_JS_API_1100
* @tc.name Test systemTime.setTime time = -Number.MAX_VALUE * @tc.name Test systemTime.setTimezone timezone = 'Brussels, Belgium'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test11', 0, async function (done) { it('systemTime_setTimezone_test11',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_1100 start") console.log('SUB_systemTime_setTimezone_JS_API_1100 start')
systemTime.setTime(-Number.MAX_VALUE) var timezone = 'Brussels, Belgium'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_1100 end'); console.log('SUB_systemTime_setTimezone_JS_API_1100 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_1200 * @tc.number SUB_systemTime_setTimezone_JS_API_1200
* @tc.name Test systemTime.setTime time = Number.NEGATIVE_INFINITY * @tc.name Test systemTime.setTimezone timezone = 'London, England'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test12', 0, async function (done) { it('systemTime_setTimezone_test12',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_1200 start") console.log('SUB_systemTime_setTimezone_JS_API_1200 start')
systemTime.setTime(Number.NEGATIVE_INFINITY) var timezone = 'London, England'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_1200 end'); console.log('SUB_systemTime_setTimezone_JS_API_1200 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_1300 * @tc.number SUB_systemTime_setTimezone_JS_API_1300
* @tc.name Test systemTime.setTime time = Number.POSITIVE_INFINITY * @tc.name Test systemTime.setTimezone timezone = 'Accra, Ghana'
* @tc.desc Test systemTime_setTime API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTime_test13', 0, async function (done) { it('systemTime_setTimezone_test13',0, async () => {
console.log("SUB_systemTime_setTime_JS_API_1300 start") console.log('SUB_systemTime_setTimezone_JS_API_1300 start')
systemTime.setTime(Number.POSITIVE_INFINITY) var timezone = 'Accra, Ghana'
.then(data => {
console.log("setTime ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setTime ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setTime ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setTime_JS_API_1300 end'); console.log('SUB_systemTime_setTimezone_JS_API_1300 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_0100 * @tc.number SUB_systemTime_setTimezone_JS_API_1400
* @tc.name Test systemTime.setDate date = new Date() * @tc.name Test systemTime.setTimezone timezone = 'Praia, CaboVerde'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test1', 0, async function (done) { it('systemTime_setTimezone_test14',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_0100 start") console.log('SUB_systemTime_setTimezone_JS_API_1400 start')
systemTime.setDate(new Date()) var timezone = 'Praia, CaboVerde'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_0100 end'); console.log('SUB_systemTime_setTimezone_JS_API_1400 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_0200 * @tc.number SUB_systemTime_setTimezone_JS_API_1500
* @tc.name Test systemTime.setDate date = new Date(2022,1,1) * @tc.name Test systemTime.setTimezone timezone = 'Nuuk, Greenland'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test2', 0, async function (done) { it('systemTime_setTimezone_test15',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_0200 start") console.log('SUB_systemTime_setTimezone_JS_API_1500 start')
systemTime.setDate(new Date(2022,1,1)) var timezone = 'Nuuk, Greenland'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_0200 end'); console.log('SUB_systemTime_setTimezone_JS_API_1500 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_0300 * @tc.number SUB_systemTime_setTimezone_JS_API_1600
* @tc.name Test systemTime.setDate date = new Date(2022,1,15) * @tc.name Test systemTime.setTimezone timezone = 'Buenos Aires, Argentina'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test3', 0, async function (done) { it('systemTime_setTimezone_test16',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_0300 start") console.log('SUB_systemTime_setTimezone_JS_API_1600 start')
systemTime.setDate(new Date(2022,1,15)) var timezone = 'Buenos Aires, Argentina'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_0300 end'); console.log('SUB_systemTime_setTimezone_JS_API_1600 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_0400 * @tc.number SUB_systemTime_setTimezone_JS_API_1700
* @tc.name Test systemTime.setDate date = new Date(2022,1,31) * @tc.name Test systemTime.setTimezone timezone = 'New York, U.S.A.'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test4', 0, async function (done) { it('systemTime_setTimezone_test17',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_0400 start") console.log('SUB_systemTime_setTimezone_JS_API_1700 start')
systemTime.setDate(new Date(2022,1,31)) var timezone = 'New York, U.S.A.'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_0400 end'); console.log('SUB_systemTime_setTimezone_JS_API_1700 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_0500 * @tc.number SUB_systemTime_setTimezone_JS_API_1800
* @tc.name Test systemTime.setDate date = new Date(2022,1,32) * @tc.name Test systemTime.setTimezone timezone = 'Mexico City, Mexico'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test5', 0, async function (done) { it('systemTime_setTimezone_test18',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_0500 start") console.log('SUB_systemTime_setTimezone_JS_API_1800 start')
systemTime.setDate(new Date(2022,1,32)) var timezone = 'Mexico City, Mexico'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(false).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_0500 end'); console.log('SUB_systemTime_setTimezone_JS_API_1800 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_0600 * @tc.number SUB_systemTime_setTimezone_JS_API_1900
* @tc.name Test systemTime.setDate date = new Date(2022,2,29) * @tc.name Test systemTime.setTimezone timezone = 'Guatemala City, Guatemala'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test6', 0, async function (done) { it('systemTime_setTimezone_test19',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_0600 start") console.log('SUB_systemTime_setTimezone_JS_API_1900 start')
systemTime.setDate(new Date(2022,2,29)) var timezone = 'Guatemala City, Guatemala'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(false).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_0600 end'); console.log('SUB_systemTime_setTimezone_JS_API_1900 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_0700 * @tc.number SUB_systemTime_setTimezone_JS_API_2000
* @tc.name Test systemTime.setDate date = new Date(2040,2,29) * @tc.name Test systemTime.setTimezone timezone = 'Los Angeles, U.S.A.'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test7', 0, async function (done) { it('systemTime_setTimezone_test20',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_0700 start") console.log('SUB_systemTime_setTimezone_JS_API_2000 start')
systemTime.setDate(new Date(2040,2,29)) var timezone = 'Los Angeles, U.S.A.'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_0700 end'); console.log('SUB_systemTime_setTimezone_JS_API_2000 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_0800 * @tc.number SUB_systemTime_setTimezone_JS_API_2100
* @tc.name Test systemTime.setDate date = new Date(2040,2,30) * @tc.name Test systemTime.setTimezone timezone = 'Anchorage, U.S.A.'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test8', 0, async function (done) { it('systemTime_setTimezone_test20',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_0800 start") console.log('SUB_systemTime_setTimezone_JS_API_2000 start')
systemTime.setDate(new Date(2040,2,30)) var timezone = 'Anchorage, U.S.A.'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(false).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_0800 end'); console.log('SUB_systemTime_setTimezone_JS_API_2000 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_0900 * @tc.number SUB_systemTime_setTimezone_JS_API_2200
* @tc.name Test systemTime.setDate date = new Date(2022,6,30) * @tc.name Test systemTime.setTimezone timezone = 'Adak, U.S.A.'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test9', 0, async function (done) { it('systemTime_setTimezone_test22',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_0900 start") console.log('SUB_systemTime_setTimezone_JS_API_2200 start')
systemTime.setDate(new Date(2022,6,30)) var timezone = 'Adak, U.S.A.'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_0900 end'); console.log('SUB_systemTime_setTimezone_JS_API_2200 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_1000 * @tc.number SUB_systemTime_setTimezone_JS_API_2300
* @tc.name Test systemTime.setDate date = new Date(2022,6,31) * @tc.name Test systemTime.setTimezone timezone = 'Honolulu, U.S.A.'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test10', 0, async function (done) { it('systemTime_setTimezone_test23',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_1000 start") console.log('SUB_systemTime_setTimezone_JS_API_2300 start')
systemTime.setDate(new Date(2022,6,31)) var timezone = 'Honolulu, U.S.A.'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(false).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_1000 end'); console.log('SUB_systemTime_setTimezone_JS_API_2300 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_1100 * @tc.number SUB_systemTime_setTimezone_JS_API_2400
* @tc.name Test systemTime.setDate date = new Date(2022,12,31) * @tc.name Test systemTime.setTimezone timezone = 'Alofi, Niue'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test11', 0, async function (done) { it('systemTime_setTimezone_test24',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_1100 start") console.log('SUB_systemTime_setTimezone_JS_API_2400 start')
systemTime.setDate(new Date(2022,12,31)) var timezone = 'Alofi, Niue'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(true).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_1100 end'); console.log('SUB_systemTime_setTimezone_JS_API_2400 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_1200 * @tc.number SUB_systemTime_setTimezone_JS_API_2500
* @tc.name Test systemTime.setDate date = new Date(2022,13,1) * @tc.name Test systemTime.setTimezone timezone = 'Baker Island, U.S.A.'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test12', 0, async function (done) { it('systemTime_setTimezone_test25',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_1200 start") console.log('SUB_systemTime_setTimezone_JS_API_2500 start')
systemTime.setDate(new Date(2022,13,1)) var timezone = 'Baker Island, U.S.A.'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(false).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_1200 end'); console.log('SUB_systemTime_setTimezone_JS_API_2500 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_1300 * @tc.number SUB_systemTime_setTimezone_JS_API_2600
* @tc.name Test systemTime.setDate date = new Date(2022000,1,1) * @tc.name Test systemTime.setTimezone timezone = 'XXXX, Asia'
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test13', 0, async function (done) { it('systemTime_setTimezone_test26',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_1300 start") console.log('SUB_systemTime_setTimezone_JS_API_2600 start')
systemTime.setDate(new Date(2022000,1,1)) var timezone = 'Baker Island, U.S.A.'
.then(data =>{
console.log("setDate ===data " + data) console.log('setTimezone = ' + timezone)
expect(false).to.a('boolean') systemTime.setTimezone(timezone)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTimeZone = systemTime.getTimeZone()
console.log("setDate ===data " + data) console.log('GetTimezone = ' + resGetTimeZone)
execpt(0).assertLarger(1) assert.equal(resGetTimeZone,timezone)
});
console.log('SUB_systemTime_setDate_JS_API_1300 end'); console.log('setTimezone = XXXX, Asia')
done() systemTime.setTimezone('XXXX, Asia')
var resGetTimeZone = systemTime.getTimeZone()
console.log('GetTimezone = ' + resGetTimeZone)
assert.equal(resGetTimeZone,timezone)
console.log('SUB_systemTime_setTimezone_JS_API_2600 end');
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_1400 * @tc.number SUB_systemTime_setTime_JS_API_0100
* @tc.name Test systemTime.setDate date = new Date(0) * @tc.name Test systemTime.setTime time = 0
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTime API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test14', 0, async function (done) { it('systemTime_setTime_test1',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_1400 start") console.log('SUB_systemTime_setTime_JS_API_0100 start')
systemTime.setDate(new Date(0)) var time = 0
.then(data =>{
console.log("setDate ===data " + data) console.log('setTime = ' + time)
expect(true).to.a('boolean') systemTime.setTime(time)
}).catch(error => {
console.log("setDate ===error " + error) var resGetTime = systemTime.getCurrentTime()
console.log("setDate ===data " + data) console.log('GetTime = ' + resGetTime)
execpt(0).assertLarger(1) assert.equal(resGetTime,time)
});
console.log('SUB_systemTime_setDate_JS_API_1400 end'); sleep(5000).then(() => {
done() resGetTime = systemTime.getCurrentTime();
console.log('GetTime = ' + resGetTime);
assert.equal(resGetTime <= (time + 6000) && resGetTime >= (time + 5000));
console.log('SUB_systemTime_setTime_JS_API_0100 end');
})
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_1500 * @tc.number SUB_systemTime_setTime_JS_API_0200
* @tc.name Test systemTime.setDate date = new Date(-1) * @tc.name Test systemTime.setTime time = 1
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTime API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test15', 0, async function (done) { it('systemTime_setTime_test2',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_1500 start") console.log('SUB_systemTime_setTime_JS_API_0200 start')
systemTime.setDate(new Date(-1)) var time = 1
.then(data =>{
console.log("setDate ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_1500 end');
done()
})
/** console.log('setTime = ' + time)
* @tc.number SUB_systemTime_setDate_JS_API_1600 systemTime.setTime(time)
* @tc.name Test systemTime.setDate date = new Date(Number.MAX_VALUE/2)
* @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setDate_test16', 0, async function (done) {
console.log("SUB_systemTime_setDate_JS_API_1600 start")
systemTime.setDate(new Date(Number.MAX_VALUE/2))
.then(data =>{
console.log("setDate ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_1600 end');
done()
})
/** var resGetTime = systemTime.getCurrentTime()
* @tc.number SUB_systemTime_setDate_JS_API_1700 console.log('GetTime = ' + resGetTime)
* @tc.name Test systemTime.setDate date = new Date(-Number.MAX_VALUE/2) assert.equal(resGetTime,time)
* @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setDate_test17', 0, async function (done) {
console.log("SUB_systemTime_setDate_JS_API_1700 start")
systemTime.setDate(new Date(-Number.MAX_VALUE/2))
.then(data =>{
console.log("setDate ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_1700 end');
done()
})
/** sleep(5000).then(() => {
* @tc.number SUB_systemTime_setDate_JS_API_1800 resGetTime = systemTime.getCurrentTime();
* @tc.name Test systemTime.setDate date = new Date(Number.MAX_VALUE) console.log('GetTime = ' + resGetTime);
* @tc.desc Test systemTime_setDate API functionality. assert.equal(resGetTime <= (time + 6000) && resGetTime >= (time + 5000));
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setDate_test18', 0, async function (done) {
console.log("SUB_systemTime_setDate_JS_API_1800 start")
systemTime.setDate(new Date(Number.MAX_VALUE))
.then(data =>{
console.log("setDate ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_1800 end');
done()
})
/** console.log('SUB_systemTime_setTime_JS_API_0200 end');
* @tc.number SUB_systemTime_setDate_JS_API_1900
* @tc.name Test systemTime.setDate date = new Date(-Number.MAX_VALUE)
* @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setDate_test19', 0, async function (done) {
console.log("SUB_systemTime_setDate_JS_API_1900 start")
systemTime.setDate(new Date(-Number.MAX_VALUE))
.then(data =>{
console.log("setDate ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_1900 end');
done()
}) })
/**
* @tc.number SUB_systemTime_setDate_JS_API_2000
* @tc.name Test systemTime.setDate date = new Date("June 1, 2022 11:13:00")
* @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setDate_test20', 0, async function (done) {
console.log("SUB_systemTime_setDate_JS_API_2000 start")
systemTime.setDate(new Date("June 1, 2022 11:13:00"))
.then(data =>{
console.log("setDate ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_2000 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_2100 * @tc.number SUB_systemTime_setTime_JS_API_0300
* @tc.name Test systemTime.setDate date = new Date("June 30, 2022 11:13:00") * @tc.name Test systemTime.setTime time = Number.MAX_VALUE/2
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTime API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test21', 0, async function (done) { it('systemTime_setTime_test3',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_2100 start") console.log('SUB_systemTime_setTime_JS_API_0300 start')
systemTime.setDate(new Date("June 30, 2022 11:13:00")) var time = Number.MAX_VALUE/2
.then(data =>{
console.log("setDate ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_2100 end');
done()
})
/** console.log('setTime = ' + time)
* @tc.number SUB_systemTime_setDate_JS_API_2200 systemTime.setTime(time)
* @tc.name Test systemTime.setDate date = new Date("June 31, 2022 11:13:00")
* @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setDate_test22', 0, async function (done) {
console.log("SUB_systemTime_setDate_JS_API_2200 start")
systemTime.setDate(new Date("June 31, 2022 11:13:00"))
.then(data =>{
console.log("setDate ===data " + data)
expect(false).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_2200 end');
done()
})
/** var resGetTime = systemTime.getCurrentTime()
* @tc.number SUB_systemTime_setDate_JS_API_2300 console.log('GetTime = ' + resGetTime)
* @tc.name Test systemTime.setDate date = new Date("July 32, 2022 11:13:00") assert.equal(resGetTime,time)
* @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setDate_test23', 0, async function (done) {
console.log("SUB_systemTime_setDate_JS_API_2300 start")
systemTime.setDate(new Date("July 32, 2022 11:13:00"))
.then(data =>{
console.log("setDate ===data " + data)
expect(false).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_2300 end');
done()
})
/** sleep(5000).then(() => {
* @tc.number SUB_systemTime_setDate_JS_API_2400 resGetTime = systemTime.getCurrentTime();
* @tc.name Test systemTime.setDate date = new Date("July 31, 2022") console.log('GetTime = ' + resGetTime);
* @tc.desc Test systemTime_setDate API functionality. assert.equal(resGetTime <= (time + 6000) && resGetTime >= (time + 5000));
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setDate_test24', 0, async function (done) {
console.log("SUB_systemTime_setDate_JS_API_2400 start")
systemTime.setDate(new Date("July 31, 2022"))
.then(data =>{
console.log("setDate ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_2400 end');
done()
})
/** console.log('SUB_systemTime_setTime_JS_API_0300 end');
* @tc.number SUB_systemTime_setDate_JS_API_2500 })
* @tc.name Test systemTime.setDate date = new Date("February 28, 2022 11:13:00")
* @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setDate_test25', 0, async function (done) {
console.log("SUB_systemTime_setDate_JS_API_2500 start")
systemTime.setDate(new Date("February 28, 2022 11:13:00"))
.then(data =>{
console.log("setDate ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_2500 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_2600 * @tc.number SUB_systemTime_setTime_JS_API_0400
* @tc.name Test systemTime.setDate date = new Date("February 29, 2022 11:13:00") * @tc.name Test systemTime.setTime time = Number.MAX_VALUE/2, getCurrentTimeNs
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTime API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test26', 0, async function (done) { it('systemTime_setTime_test4',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_2600 start") console.log('SUB_systemTime_setTime_JS_API_0400 start')
systemTime.setDate(new Date("February 29, 2022 11:13:00")) var time = Number.MAX_VALUE/2
.then(data =>{
console.log("setDate ===data " + data) console.log('setTime = ' + time)
expect(false).to.a('boolean') systemTime.setTime(time)
}).catch(error => {
console.log("setDate ===error " + error) sleep(5000).then(() => {
console.log("setDate ===data " + data) var resGetTime = systemTime.getCurrentTimeNs();
execpt(0).assertLarger(1) console.log('GetTime = ' + resGetTime);
}); assert.equal(resGetTime <= ((time + 6000) * 1000000) && resGetTime >= ((time + 5000) * 1000000));
console.log('SUB_systemTime_setDate_JS_API_2600 end');
done() console.log('SUB_systemTime_setTime_JS_API_0400 end');
})
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_2700 * @tc.number SUB_systemTime_setTime_JS_API_0500
* @tc.name Test systemTime.setDate date = new Date("February 29, 2040 11:13:00") * @tc.name Test systemTime.setTime time = -1
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setTime API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test27', 0, async function (done) { it('systemTime_setTime_test5',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_2700 start") console.log('SUB_systemTime_setTime_JS_API_0500 start')
systemTime.setDate(new Date("February 29, 2040 11:13:00")) var time = -1
.then(data =>{
console.log("setDate ===data " + data) console.log('setTime = ' + time)
expect(true).to.a('boolean') systemTime.setTime(time)
}).catch(error => {
console.log("setDate ===error " + error) console.log('SUB_systemTime_setTime_JS_API_0500 end');
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_2700 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_2800 * @tc.number SUB_systemTime_setDate_JS_API_0100
* @tc.name Test systemTime.setDate date = new Date("February 1, 2022 00:00:00") * @tc.name Test systemTime.setDate date = new Date()
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test28', 0, async function (done) { it('systemTime_setDate_test1',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_2800 start") console.log('SUB_systemTime_setDate_JS_API_0100 start')
systemTime.setDate(new Date("February 1, 2022 00:00:00")) var date = new Date()
.then(data =>{
console.log("setDate ===data " + data) console.log('setDate = ' + date)
expect(true).to.a('boolean') systemTime.setDate(date)
}).catch(error => {
console.log("setDate ===error " + error) var resGetDate = systemTime.getDate()
console.log("setDate ===data " + data) console.log('GetDate = ' + resGetDate)
execpt(0).assertLarger(1) assert.deepEqual(resGetDate,date)
});
console.log('SUB_systemTime_setDate_JS_API_2800 end'); console.log('SUB_systemTime_setDate_JS_API_0100 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_2900 * @tc.number SUB_systemTime_setDate_JS_API_0200
* @tc.name Test systemTime.setDate date = new Date("February 1, 2022 12:00:00") * @tc.name Test systemTime.setDate date = new Date(2022,1,1)
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test29', 0, async function (done) { it('systemTime_setDate_test2',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_2900 start") console.log('SUB_systemTime_setDate_JS_API_0200 start')
systemTime.setDate(new Date("February 1, 2022 12:00:00")) var date = new Date(2022,1,1)
.then(data =>{
console.log("setDate ===data " + data) console.log('setDate = ' + date)
expect(true).to.a('boolean') systemTime.setDate(date)
}).catch(error => {
console.log("setDate ===error " + error) var resGetDate = systemTime.getDate()
console.log("setDate ===data " + data) console.log('GetDate = ' + resGetDate)
execpt(0).assertLarger(1) assert.deepEqual(resGetDate,date)
});
console.log('SUB_systemTime_setDate_JS_API_2900 end'); console.log('SUB_systemTime_setDate_JS_API_0200 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_3000 * @tc.number SUB_systemTime_setDate_JS_API_0300
* @tc.name Test systemTime.setDate date = new Date("February 1, 2022 23:00:00") * @tc.name Test systemTime.setDate date = new Date(2022,1,15)
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test30', 0, async function (done) { it('systemTime_setDate_test3',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_3000 start") console.log('SUB_systemTime_setDate_JS_API_0300 start')
systemTime.setDate(new Date("February 1, 2022 23:00:00")) var date = new Date(2022,1,15)
.then(data =>{
console.log("setDate ===data " + data) console.log('setDate = ' + date)
expect(true).to.a('boolean') systemTime.setDate(date)
}).catch(error => {
console.log("setDate ===error " + error) var resGetDate = systemTime.getDate()
console.log("setDate ===data " + data) console.log('GetDate = ' + resGetDate)
execpt(0).assertLarger(1) assert.deepEqual(resGetDate,date)
});
console.log('SUB_systemTime_setDate_JS_API_3000 end'); console.log('SUB_systemTime_setDate_JS_API_0300 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_3100 * @tc.number SUB_systemTime_setDate_JS_API_0400
* @tc.name Test systemTime.setDate date = new Date("February 1, 2022 23:59:59") * @tc.name Test systemTime.setDate date = new Date(2022,1,31)
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test31', 0, async function (done) { it('systemTime_setDate_test4',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_3100 start") console.log('SUB_systemTime_setDate_JS_API_0400 start')
systemTime.setDate(new Date("February 1, 2022 23:59:59")) var date = new Date(2022,1,31)
.then(data =>{
console.log("setDate ===data " + data) console.log('setDate = ' + date)
expect(true).to.a('boolean') systemTime.setDate(date)
}).catch(error => {
console.log("setDate ===error " + error) var resGetDate = systemTime.getDate()
console.log("setDate ===data " + data) console.log('GetDate = ' + resGetDate)
execpt(0).assertLarger(1) assert.deepEqual(resGetDate,date)
});
console.log('SUB_systemTime_setDate_JS_API_3100 end'); console.log('SUB_systemTime_setDate_JS_API_0400 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_3200 * @tc.number SUB_systemTime_setDate_JS_API_0500
* @tc.name Test systemTime.setDate date = new Date("February 1, 2022 24:00:00") * @tc.name Test systemTime.setDate date = new Date(2022,1,32)
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test32', 0, async function (done) { it('systemTime_setDate_test5',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_3200 start") console.log('SUB_systemTime_setDate_JS_API_0500 start')
systemTime.setDate(new Date("February 1, 2022 24:00:00")) var date = new Date(2022,1,31)
.then(data =>{
console.log("setDate ===data " + data) console.log('setDate = ' + date)
expect(false).to.a('boolean') systemTime.setDate(date)
}).catch(error => {
console.log("setDate ===error " + error) var resGetDate = systemTime.getDate()
console.log("setDate ===data " + data) console.log('GetDate = ' + resGetDate)
execpt(0).assertLarger(1) assert.deepEqual(resGetDate,date)
});
console.log('SUB_systemTime_setDate_JS_API_3200 end'); console.log('setDate = new Date(2022,1,32)')
done() systemTime.setDate(new Date(2022,1,32))
var resGetDate = systemTime.getDate()
console.log('GetDate = ' + resGetDate)
assert.deepEqual(resGetDate,date)
console.log('SUB_systemTime_setDate_JS_API_0500 end');
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_3300 * @tc.number SUB_systemTime_setDate_JS_API_0600
* @tc.name Test systemTime.setDate date = new Date("February 1, 2022 12:59:00") * @tc.name Test systemTime.setDate date = new Date(2022,2,29)
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test33', 0, async function (done) { it('systemTime_setDate_test6',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_3300 start") console.log('SUB_systemTime_setDate_JS_API_0600 start')
systemTime.setDate(new Date("February 1, 2022 12:59:00")) var date = new Date(2022,1,31)
.then(data =>{
console.log("setDate ===data " + data) console.log('setDate = ' + date)
expect(true).to.a('boolean') systemTime.setDate(date)
}).catch(error => {
console.log("setDate ===error " + error) var resGetDate = systemTime.getDate()
console.log("setDate ===data " + data) console.log('GetDate = ' + resGetDate)
execpt(0).assertLarger(1) assert.deepEqual(resGetDate,date)
});
console.log('SUB_systemTime_setDate_JS_API_3300 end'); console.log('setDate = new Date(2022,2,29)')
done() systemTime.setDate(new Date(2022,2,29))
var resGetDate = systemTime.getDate()
console.log('GetDate = ' + resGetDate)
assert.deepEqual(resGetDate,date)
console.log('SUB_systemTime_setDate_JS_API_0600 end');
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_3400 * @tc.number SUB_systemTime_setDate_JS_API_0700
* @tc.name Test systemTime.setDate date = new Date("February 1, 2022 12:00:59") * @tc.name Test systemTime.setDate date = new Date(2040,2,29)
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test34', 0, async function (done) { it('systemTime_setDate_test7',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_3400 start") console.log('SUB_systemTime_setDate_JS_API_0700 start')
systemTime.setDate(new Date("February 1, 2022 12:00:59")) var date = new Date(2040,2,29)
.then(data =>{
console.log("setDate ===data " + data) console.log('setDate = ' + date)
expect(true).to.a('boolean') systemTime.setDate(date)
}).catch(error => {
console.log("setDate ===error " + error) var resGetDate = systemTime.getDate()
console.log("setDate ===data " + data) console.log('GetDate = ' + resGetDate)
execpt(0).assertLarger(1) assert.deepEqual(resGetDate,date)
});
console.log('SUB_systemTime_setDate_JS_API_3400 end'); console.log('SUB_systemTime_setDate_JS_API_0700 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_3500 * @tc.number SUB_systemTime_setDate_JS_API_0800
* @tc.name Test systemTime.setDate date = new Date("February 1, 2022 12:00:60") * @tc.name Test systemTime.setDate date = new Date(2040,2,30)
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test35', 0, async function (done) { it('systemTime_setDate_test8',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_3500 start") console.log('SUB_systemTime_setDate_JS_API_0800 start')
systemTime.setDate(new Date("February 1, 2022 12:00:60")) var date = new Date(2022,1,31)
.then(data =>{
console.log("setDate ===data " + data) console.log('setDate = ' + date)
expect(false).to.a('boolean') systemTime.setDate(date)
}).catch(error => {
console.log("setDate ===error " + error) var resGetDate = systemTime.getDate()
console.log("setDate ===data " + data) console.log('GetDate = ' + resGetDate)
execpt(0).assertLarger(1) assert.deepEqual(resGetDate,date)
});
console.log('SUB_systemTime_setDate_JS_API_3500 end'); console.log('setDate = new Date(2040,2,30)')
done() systemTime.setDate(new Date(2040,2,30))
var resGetDate = systemTime.getDate()
console.log('GetDate = ' + resGetDate)
assert.deepEqual(resGetDate,date)
console.log('SUB_systemTime_setDate_JS_API_0800 end');
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_3600 * @tc.number SUB_systemTime_setDate_JS_API_0900
* @tc.name Test systemTime.setDate date = new Date("February 1, 2022 12:60:00") * @tc.name Test systemTime.setDate date = new Date(2022,6,30)
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test36', 0, async function (done) { it('systemTime_setDate_test9',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_3600 start") console.log('SUB_systemTime_setDate_JS_API_0900 start')
systemTime.setDate(new Date("February 1, 2022 12:60:00")) var date = new Date(2022,6,30)
.then(data =>{
console.log("setDate ===data " + data) console.log('setDate = ' + date)
expect(false).to.a('boolean') systemTime.setDate(date)
}).catch(error => {
console.log("setDate ===error " + error) var resGetDate = systemTime.getDate()
console.log("setDate ===data " + data) console.log('GetDate = ' + resGetDate)
execpt(0).assertLarger(1) assert.deepEqual(resGetDate,date)
});
console.log('SUB_systemTime_setDate_JS_API_3600 end'); console.log('SUB_systemTime_setDate_JS_API_0900 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setDate_JS_API_3700 * @tc.number SUB_systemTime_setDate_JS_API_1000
* @tc.name Test systemTime.setDate date = new Date("!!@#$%^&*") * @tc.name Test systemTime.setDate date = new Date(2022,6,31)
* @tc.desc Test systemTime_setDate API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setDate_test37', 0, async function (done) { it('systemTime_setDate_test10',0, async () => {
console.log("SUB_systemTime_setDate_JS_API_3700 start") console.log('SUB_systemTime_setDate_JS_API_1000 start')
systemTime.setDate(new Date("!!@#$%^&*")) var date = new Date(2022,1,31)
.then(data =>{
console.log("setDate ===data " + data)
expect(false).to.a('boolean')
}).catch(error => {
console.log("setDate ===error " + error)
console.log("setDate ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setDate_JS_API_3700 end');
done()
})
/** console.log('setDate = ' + date)
* @tc.number SUB_systemTime_setTimezone_JS_API_0100 systemTime.setDate(date)
* @tc.name Test systemTime.setTimezone timezone = "Anadyr, Russia"
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test1', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_0100 start")
systemTime.setTimezone("Anadyr, Russia")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_0100 end');
done()
})
/** var resGetDate = systemTime.getDate()
* @tc.number SUB_systemTime_setTimezone_JS_API_0200 console.log('GetDate = ' + resGetDate)
* @tc.name Test systemTime.setTimezone timezone = "Honiara, SolomonIslands" assert.deepEqual(resGetDate,date)
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test2', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_0200 start")
systemTime.setTimezone("Honiara, SolomonIslands")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_0200 end');
done()
})
/** console.log('setDate = new Date(2022,6,31)')
* @tc.number SUB_systemTime_setTimezone_JS_API_0300 systemTime.setDate(new Date(2022,6,31))
* @tc.name Test systemTime.setTimezone timezone = "Melbourne, Australia"
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test3', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_0300 start")
systemTime.setTimezone("Melbourne, Australia")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_0300 end');
done()
})
/** var resGetDate = systemTime.getDate()
* @tc.number SUB_systemTime_setTimezone_JS_API_0400 console.log('GetDate = ' + resGetDate)
* @tc.name Test systemTime.setTimezone timezone = "Tokyo, Japan" assert.deepEqual(resGetDate,date)
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test4', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_0400 start")
systemTime.setTimezone("Tokyo, Japan")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_0400 end');
done()
})
/** console.log('SUB_systemTime_setDate_JS_API_1000 end');
* @tc.number SUB_systemTime_setTimezone_JS_API_0500
* @tc.name Test systemTime.setTimezone timezone = "Beijing, China"
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test5', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_0500 start")
systemTime.setTimezone("Beijing, China")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_0500 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTimezone_JS_API_0600 * @tc.number SUB_systemTime_setDate_JS_API_1100
* @tc.name Test systemTime.setTimezone timezone = "Jakarta, Indonesia" * @tc.name Test systemTime.setDate date = new Date(2022,12,31)
* @tc.desc Test systemTime_setTimezone API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTimezone_test6', 0, async function (done) { it('systemTime_setDate_test11',0, async () => {
console.log("SUB_systemTime_setTimezone_JS_API_0600 start") console.log('SUB_systemTime_setDate_JS_API_1100 start')
systemTime.setTimezone("Jakarta, Indonesia") var date = new Date(2022,12,31)
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_0600 end');
done()
})
/** console.log('setDate = ' + date)
* @tc.number SUB_systemTime_setTimezone_JS_API_0700 systemTime.setDate(date)
* @tc.name Test systemTime.setTimezone timezone = "Dhaka, Bangladesh"
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test7', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_0700 start")
systemTime.setTimezone("Dhaka, Bangladesh")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_0700 end');
done()
})
/** var resGetDate = systemTime.getDate()
* @tc.number SUB_systemTime_setTimezone_JS_API_0800 console.log('GetDate = ' + resGetDate)
* @tc.name Test systemTime.setTimezone timezone = "Tashkent, Uzbekistan" assert.deepEqual(resGetDate,date)
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test8', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_0800 start")
systemTime.setTimezone("Tashkent, Uzbekistan")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_0800 end');
done()
})
/** console.log('SUB_systemTime_setDate_JS_API_1100 end');
* @tc.number SUB_systemTime_setTimezone_JS_API_0900
* @tc.name Test systemTime.setTimezone timezone = "Dubai, U.A.E."
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test9', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_0900 start")
systemTime.setTimezone("Dubai, U.A.E.")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_0900 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTimezone_JS_API_1000 * @tc.number SUB_systemTime_setDate_JS_API_1200
* @tc.name Test systemTime.setTimezone timezone = "Moscow, Russia" * @tc.name Test systemTime.setDate date = new Date(2022,13,1)
* @tc.desc Test systemTime_setTimezone API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTimezone_test10', 0, async function (done) { it('systemTime_setDate_test12',0, async () => {
console.log("SUB_systemTime_setTimezone_JS_API_1000 start") console.log('SUB_systemTime_setDate_JS_API_1200 start')
systemTime.setTimezone("Moscow, Russia") var date = new Date(2022,1,31)
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_1000 end');
done()
})
/** console.log('setDate = ' + date)
* @tc.number SUB_systemTime_setTimezone_JS_API_1100 systemTime.setDate(date)
* @tc.name Test systemTime.setTimezone timezone = "Brussels, Belgium"
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test11', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_1100 start")
systemTime.setTimezone("Brussels, Belgium")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_1100 end');
done()
})
/** var resGetDate = systemTime.getDate()
* @tc.number SUB_systemTime_setTimezone_JS_API_1200 console.log('GetDate = ' + resGetDate)
* @tc.name Test systemTime.setTimezone timezone = "London, England" assert.deepEqual(resGetDate,date)
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test12', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_1200 start")
systemTime.setTimezone("London, England")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_1200 end');
done()
})
/** console.log('setDate = new Date(2022,13,1)')
* @tc.number SUB_systemTime_setTimezone_JS_API_1300 systemTime.setDate(new Date(2022,13,1))
* @tc.name Test systemTime.setTimezone timezone = "Accra, Ghana"
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test13', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_1300 start")
systemTime.setTimezone("Accra, Ghana")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_1300 end');
done()
})
/** var resGetDate = systemTime.getDate()
* @tc.number SUB_systemTime_setTimezone_JS_API_1400 console.log('GetDate = ' + resGetDate)
* @tc.name Test systemTime.setTimezone timezone = "Praia, CaboVerde" assert.deepEqual(resGetDate,date)
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test14', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_1400 start")
systemTime.setTimezone("Praia, CaboVerde")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_1400 end');
done()
})
/** console.log('SUB_systemTime_setDate_JS_API_1200 end');
* @tc.number SUB_systemTime_setTimezone_JS_API_1500
* @tc.name Test systemTime.setTimezone timezone = "Nuuk, Greenland"
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test15', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_1500 start")
systemTime.setTimezone("Nuuk, Greenland")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_1500 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTimezone_JS_API_1600 * @tc.number SUB_systemTime_getRealActiveTime_JS_API_0100
* @tc.name Test systemTime.setTimezone timezone = "Buenos Aires, Argentina" * @tc.name Test systemTime.getRealActiveTime
* @tc.desc Test systemTime_setTimezone API functionality. * @tc.desc Test systemTime_getRealActiveTime API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTimezone_test16', 0, async function (done) { it('systemTime_getRealActiveTime_test1',0, async () => {
console.log("SUB_systemTime_setTimezone_JS_API_1600 start") console.log('SUB_systemTime_getRealActiveTime_JS_API_0100 start')
systemTime.setTimezone("Buenos Aires, Argentina")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_1600 end');
done()
})
/** var resGetTime0 = systemTime.getRealActiveTime()
* @tc.number SUB_systemTime_setTimezone_JS_API_1700 console.log('GetTime0 = ' + resGetTime0)
* @tc.name Test systemTime.setTimezone timezone = "New York, U.S.A."
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test17', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_1700 start")
systemTime.setTimezone("New York, U.S.A.")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_1700 end');
done()
})
/** sleep(5000).then(() => {
* @tc.number SUB_systemTime_setTimezone_JS_API_1800 var resGetTime1 = systemTime.getRealActiveTime();
* @tc.name Test systemTime.setTimezone timezone = "Mexico City, Mexico" console.log('GetTime1 = ' + resGetTime1);
* @tc.desc Test systemTime_setTimezone API functionality. assert.equal(resGetTime1 <= (resGetTime0 + 6000) && resGetTime1 >= (resGetTime0 + 5000));
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test18', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_1800 start")
systemTime.setTimezone("Mexico City, Mexico")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_1800 end');
done()
})
/** console.log('SUB_systemTime_getRealActiveTime_JS_API_0100 end');
* @tc.number SUB_systemTime_setTimezone_JS_API_1900
* @tc.name Test systemTime.setTimezone timezone = "Guatemala City, Guatemala"
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test19', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_1900 start")
systemTime.setTimezone("Guatemala City, Guatemala")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_1900 end');
done()
}) })
/**
* @tc.number SUB_systemTime_setTimezone_JS_API_2000
* @tc.name Test systemTime.setTimezone timezone = "Los Angeles, U.S.A."
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test20', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_2000 start")
systemTime.setTimezone("Los Angeles, U.S.A.")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_2000 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTimezone_JS_API_2100 * @tc.number SUB_systemTime_getRealActiveTimeNs_JS_API_0100
* @tc.name Test systemTime.setTimezone timezone = "Anchorage, U.S.A." * @tc.name Test systemTime.getRealActiveTimeNs
* @tc.desc Test systemTime_setTimezone API functionality. * @tc.desc Test systemTime_getRealActiveTimeNs API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTimezone_test21', 0, async function (done) { it('systemTime_getRealActiveTimeNs_test1',0, async () => {
console.log("SUB_systemTime_setTimezone_JS_API_2100 start") console.log('SUB_systemTime_getRealActiveTimeNs_JS_API_0100 start')
systemTime.setTimezone("Anchorage, U.S.A.")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_2100 end');
done()
})
/** var resGetTime0 = systemTime.getRealActiveTimeNs()
* @tc.number SUB_systemTime_setTimezone_JS_API_2200 console.log('GetTime0 = ' + resGetTime0)
* @tc.name Test systemTime.setTimezone timezone = "Adak, U.S.A."
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test22', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_2200 start")
systemTime.setTimezone("Adak, U.S.A.")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_2200 end');
done()
})
/** sleep(5000).then(() => {
* @tc.number SUB_systemTime_setTimezone_JS_API_2300 var resGetTime1 = systemTime.getRealActiveTimeNs();
* @tc.name Test systemTime.setTimezone timezone = "Honolulu, U.S.A." console.log('GetTime1 = ' + resGetTime1);
* @tc.desc Test systemTime_setTimezone API functionality. assert.equal(resGetTime1 <= (resGetTime0 + 6000 * 1000000) && resGetTime1 >= (resGetTime0 + 5000 * 1000000));
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test23', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_2300 start")
systemTime.setTimezone("Honolulu, U.S.A.")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_2300 end');
done()
})
/** console.log('SUB_systemTime_getRealActiveTimeNs_JS_API_0100 end');
* @tc.number SUB_systemTime_setTimezone_JS_API_2400
* @tc.name Test systemTime.setTimezone timezone = "Alofi, Niue"
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test24', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_2400 start")
systemTime.setTimezone("Alofi, Niue")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_2400 end');
done()
}) })
/**
* @tc.number SUB_systemTime_setTimezone_JS_API_2500
* @tc.name Test systemTime.setTimezone timezone = "Baker Island, U.S.A."
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test25', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_2500 start")
systemTime.setTimezone("Baker Island, U.S.A.")
.then(data =>{
console.log("setTimezone ===data " + data)
expect(true).to.a('boolean')
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_2500 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_setTimezone_JS_API_2600 * @tc.number SUB_systemTime_getRealTime_JS_API_0100
* @tc.name Test systemTime.setTimezone timezone = "Tomsk, Asia" * @tc.name Test systemTime.getRealTime
* @tc.desc Test systemTime_setTimezone API functionality. * @tc.desc Test systemTime_getRealTime API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setTimezone_test26', 0, async function (done) { it('systemTime_getRealTime_test1',0, async () => {
console.log("SUB_systemTime_setTimezone_JS_API_2600 start") console.log('SUB_systemTime_getRealTime_JS_API_0100 start')
systemTime.setTimezone("Tomsk, Asia")
.then(data =>{
console.log("setTimezone ===data " + data)
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_2600 end');
done()
})
/** var resGetTime0 = systemTime.getRealTime()
* @tc.number SUB_systemTime_setTimezone_JS_API_2700 console.log('GetTime0 = ' + resGetTime0)
* @tc.name Test systemTime.setTimezone timezone = "Chongqing, China"
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test27', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_2700 start")
systemTime.setTimezone("Beijing, China")
.then(data =>{
console.log("setTimezone ===data " + data)
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_2700 end');
done()
})
/** sleep(5000).then(() => {
* @tc.number SUB_systemTime_setTimezone_JS_API_2800 var resGetTime1 = systemTime.getRealTime();
* @tc.name Test systemTime.setTimezone timezone = "" console.log('GetTime1 = ' + resGetTime1);
* @tc.desc Test systemTime_setTimezone API functionality. assert.equal(resGetTime1 <= (resGetTime0 + 6000) && resGetTime1 >= (resGetTime0 + 5000));
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test28', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_2800 start")
systemTime.setTimezone("")
.then(data =>{
console.log("setTimezone ===data " + data)
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_2800 end');
done()
})
/** console.log('SUB_systemTime_getRealTime_JS_API_0100 end');
* @tc.number SUB_systemTime_setTimezone_JS_API_2900
* @tc.name Test systemTime.setTimezone timezone = "AAA...."
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test29', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_2900 start")
systemTime.setTimezone("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
.then(data =>{
console.log("setTimezone ===data " + data)
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_2900 end');
done()
}) })
/**
* @tc.number SUB_systemTime_setTimezone_JS_API_3000
* @tc.name Test systemTime.setTimezone timezone = "~!@#$%^&*?;'[])(*-=+"
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('systemTime_setTimezone_test30', 0, async function (done) {
console.log("SUB_systemTime_setTimezone_JS_API_3000 start")
systemTime.setTimezone("~!@#$%^&*?;'[])(*-=+")
.then(data =>{
console.log("setTimezone ===data " + data)
}).catch(error => {
console.log("setTimezone ===error " + error)
console.log("setTimezone ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTimezone_JS_API_3000 end');
done()
}) })
/** /**
* @tc.number SUB_systemTime_getTimezone_JS_API_0100 * @tc.number SUB_systemTime_getRealTimeNs_JS_API_0100
* @tc.name Test systemTime.getTimezone timezone = 'Anadyr, Russia' * @tc.name Test systemTime.getRealTimeNs
* @tc.desc Test systemTime_getTimezone API functionality. * @tc.desc Test systemTime_getRealTimeNs API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_getTimezone_test1', 0, async function (done) { it('systemTime_getRealTimeNs_test1',0, async () => {
console.log('SUB_systemTime_getTimezone_JS_API_0100 start') console.log('SUB_systemTime_getRealTimeNs_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) { var resGetTime0 = systemTime.getRealTimeNs()
console.log('SUB_systemTime_getRealActiveTimeNs_JS_API_0100 start') console.log('GetTime0 = ' + resGetTime0)
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) { sleep(5000).then(() => {
console.log('SUB_systemTime_getRealTime_JS_API_0100 start') var resGetTime1 = systemTime.getRealTimeNs();
var res = systemTime.getRealTime() console.log('GetTime1 = ' + resGetTime1);
.then(data =>{ assert.equal(resGetTime1 <= (resGetTime0 + 6000 * 1000000) && resGetTime1 >= (resGetTime0 + 5000 * 1000000));
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'); 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()
}) })
function sleep (time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
}) })
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册