提交 d533a394 编写于 作者: Z zhaoyuan17

Modify test code and change sound empty

Signed-off-by: Nzhaoyuan17 <zhaoyuan17@huawei.com>
上级 a5674e5d
...@@ -27,8 +27,8 @@ group("actsabilitymanagertest") { ...@@ -27,8 +27,8 @@ group("actsabilitymanagertest") {
"actsamstestfourthscene:ActsAmsTestFourthSceneTest", "actsamstestfourthscene:ActsAmsTestFourthSceneTest",
"actsamstestsecondscene:ActsAmsTestSecondSceneTest", "actsamstestsecondscene:ActsAmsTestSecondSceneTest",
"actsamstestthirdscene:ActsAmsTestThirdSceneTest", "actsamstestthirdscene:ActsAmsTestThirdSceneTest",
"sceneProject/clearmissionscallback:ClearMissionsCallBack", "clearmissionscallback:ClearMissionsCallBack",
"sceneProject/clearmissionspromise:ClearMissionsPromise", "clearmissionspromise:ClearMissionsPromise",
"sceneProject/simulateEAbility:simulateEAbility", "sceneProject/simulateEAbility:simulateEAbility",
"sceneProject/simulateFAbilityFir:simulateFAbilityFir", "sceneProject/simulateFAbilityFir:simulateFAbilityFir",
"sceneProject/simulateFAbilitySed:simulateFAbilitySed", "sceneProject/simulateFAbilitySed:simulateFAbilitySed",
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
import file from '@system.file' import file from '@system.file'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index' import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -23,22 +23,25 @@ export default { ...@@ -23,22 +23,25 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
console.info('onShow finish')
const core = Core.getInstance() const core = Core.getInstance()
const expectExtend = new ExpectExtend({ const expectExtend = new ExpectExtend({
'id': 'extend' 'id': 'extend'
}) })
const reportExtend = new ReportExtend(file) const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.addService('report', reportExtend) core.addService('report', reportExtend)
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
core.execute() core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
import file from '@system.file' import file from '@system.file'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index' import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
var once = true
export default { export default {
data: { data: {
title: "" title: ""
...@@ -23,22 +23,25 @@ export default { ...@@ -23,22 +23,25 @@ export default {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onShow() {
console.info('onShow finish') if (once) {
once = false
console.info('onShow finish')
const core = Core.getInstance() const core = Core.getInstance()
const expectExtend = new ExpectExtend({ const expectExtend = new ExpectExtend({
'id': 'extend' 'id': 'extend'
}) })
const reportExtend = new ReportExtend(file) const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.addService('report', reportExtend) core.addService('report', reportExtend)
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
core.execute() core.execute()
}
}, },
onReady() { onReady() {
console.info('onReady'); console.info('onReady');
......
...@@ -16,6 +16,7 @@ import notification from '@ohos.notification' ...@@ -16,6 +16,7 @@ import notification from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 2000; const TIMEOUT = 2000;
const SOUNDURL = "file://system/etc/Light.ogg";
describe('ActsAnsGetSlotTestCallback', function () { describe('ActsAnsGetSlotTestCallback', function () {
/* /*
...@@ -43,6 +44,7 @@ describe('ActsAnsGetSlotTestCallback', function () { ...@@ -43,6 +44,7 @@ describe('ActsAnsGetSlotTestCallback', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(2); expect(data.lockscreenVisibility).assertEqual(2);
expect(data.vibrationEnabled).assertEqual(true); expect(data.vibrationEnabled).assertEqual(true);
expect(data.sound).assertEqual(SOUNDURL);
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlot ActsAnsGetSlotTestCallback_0100 finish====>"); console.debug("====>getSlot ActsAnsGetSlotTestCallback_0100 finish====>");
...@@ -77,6 +79,7 @@ describe('ActsAnsGetSlotTestCallback', function () { ...@@ -77,6 +79,7 @@ describe('ActsAnsGetSlotTestCallback', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(2); expect(data.lockscreenVisibility).assertEqual(2);
expect(data.vibrationEnabled).assertEqual(true); expect(data.vibrationEnabled).assertEqual(true);
expect(data.sound).assertEqual(SOUNDURL);
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlot ActsAnsGetSlotTestCallback_0200 finish====>"); console.debug("====>getSlot ActsAnsGetSlotTestCallback_0200 finish====>");
...@@ -118,6 +121,7 @@ describe('ActsAnsGetSlotTestCallback', function () { ...@@ -118,6 +121,7 @@ describe('ActsAnsGetSlotTestCallback', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(3); expect(data.lockscreenVisibility).assertEqual(3);
expect(data.vibrationEnabled).assertEqual(false); expect(data.vibrationEnabled).assertEqual(false);
expect(data.sound).assertEqual("");
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlot ActsAnsGetSlotTestCallback_0300 finish====>"); console.debug("====>getSlot ActsAnsGetSlotTestCallback_0300 finish====>");
...@@ -159,6 +163,7 @@ describe('ActsAnsGetSlotTestCallback', function () { ...@@ -159,6 +163,7 @@ describe('ActsAnsGetSlotTestCallback', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(3); expect(data.lockscreenVisibility).assertEqual(3);
expect(data.vibrationEnabled).assertEqual(false); expect(data.vibrationEnabled).assertEqual(false);
expect(data.sound).assertEqual("");
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlotActsAnsGetSlotTestCallback_0400 finish====>"); console.debug("====>getSlotActsAnsGetSlotTestCallback_0400 finish====>");
...@@ -200,6 +205,7 @@ describe('ActsAnsGetSlotTestCallback', function () { ...@@ -200,6 +205,7 @@ describe('ActsAnsGetSlotTestCallback', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(3); expect(data.lockscreenVisibility).assertEqual(3);
expect(data.vibrationEnabled).assertEqual(false); expect(data.vibrationEnabled).assertEqual(false);
expect(data.sound).assertEqual("");
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlot ActsAnsGetSlotTestCallback_0500 finish====>"); console.debug("====>getSlot ActsAnsGetSlotTestCallback_0500 finish====>");
......
...@@ -16,6 +16,7 @@ import notification from '@ohos.notification' ...@@ -16,6 +16,7 @@ import notification from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 2000; const TIMEOUT = 2000;
const SOUNDURL = "file://system/etc/Light.ogg";
describe('ActsAnsGetSlotTestPromise', function () { describe('ActsAnsGetSlotTestPromise', function () {
/* /*
...@@ -45,6 +46,7 @@ describe('ActsAnsGetSlotTestPromise', function () { ...@@ -45,6 +46,7 @@ describe('ActsAnsGetSlotTestPromise', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(2); expect(data.lockscreenVisibility).assertEqual(2);
expect(data.vibrationEnabled).assertEqual(true); expect(data.vibrationEnabled).assertEqual(true);
expect(data.sound).assertEqual(SOUNDURL);
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlot ActsAnsGetSlotTestPromise_0100 finish====>"); console.debug("====>getSlot ActsAnsGetSlotTestPromise_0100 finish====>");
...@@ -87,6 +89,7 @@ describe('ActsAnsGetSlotTestPromise', function () { ...@@ -87,6 +89,7 @@ describe('ActsAnsGetSlotTestPromise', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(2); expect(data.lockscreenVisibility).assertEqual(2);
expect(data.vibrationEnabled).assertEqual(true); expect(data.vibrationEnabled).assertEqual(true);
expect(data.sound).assertEqual(SOUNDURL);
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlot Promise SERVICE_INFORMATION ActsAnsGetSlotTestPromise_0200 finish====>"); console.debug("====>getSlot Promise SERVICE_INFORMATION ActsAnsGetSlotTestPromise_0200 finish====>");
...@@ -129,6 +132,7 @@ describe('ActsAnsGetSlotTestPromise', function () { ...@@ -129,6 +132,7 @@ describe('ActsAnsGetSlotTestPromise', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(3); expect(data.lockscreenVisibility).assertEqual(3);
expect(data.vibrationEnabled).assertEqual(false); expect(data.vibrationEnabled).assertEqual(false);
expect(data.sound).assertEqual("");
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlot Promise CONTENT_INFORMATION ActsAnsGetSlotTestPromise_0300 finish====>"); console.debug("====>getSlot Promise CONTENT_INFORMATION ActsAnsGetSlotTestPromise_0300 finish====>");
...@@ -171,6 +175,7 @@ describe('ActsAnsGetSlotTestPromise', function () { ...@@ -171,6 +175,7 @@ describe('ActsAnsGetSlotTestPromise', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(3); expect(data.lockscreenVisibility).assertEqual(3);
expect(data.vibrationEnabled).assertEqual(false); expect(data.vibrationEnabled).assertEqual(false);
expect(data.sound).assertEqual("");
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlot Promise OTHER_TYPES ActsAnsGetSlotTestPromise_0400 finish====>"); console.debug("====>getSlot Promise OTHER_TYPES ActsAnsGetSlotTestPromise_0400 finish====>");
...@@ -213,6 +218,7 @@ describe('ActsAnsGetSlotTestPromise', function () { ...@@ -213,6 +218,7 @@ describe('ActsAnsGetSlotTestPromise', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(3); expect(data.lockscreenVisibility).assertEqual(3);
expect(data.vibrationEnabled).assertEqual(false); expect(data.vibrationEnabled).assertEqual(false);
expect(data.sound).assertEqual("");
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlotPromise UNKNOWN_TYPE ActsAnsGetSlotTestPromise_0500 finish====>"); console.debug("====>getSlotPromise UNKNOWN_TYPE ActsAnsGetSlotTestPromise_0500 finish====>");
......
...@@ -16,6 +16,7 @@ import notification from '@ohos.notification' ...@@ -16,6 +16,7 @@ import notification from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 3000; const TIMEOUT = 3000;
const SOUNDURL = "file://system/etc/Light.ogg";
describe('ActsAnsRemoveSlotTest', function () { describe('ActsAnsRemoveSlotTest', function () {
/* /*
...@@ -38,6 +39,7 @@ describe('ActsAnsRemoveSlotTest', function () { ...@@ -38,6 +39,7 @@ describe('ActsAnsRemoveSlotTest', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(2); expect(data.lockscreenVisibility).assertEqual(2);
expect(data.vibrationEnabled).assertEqual(true); expect(data.vibrationEnabled).assertEqual(true);
expect(data.sound).assertEqual(SOUNDURL);
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlot ActsAnsRemoveSlotTest_0100 finish====>"); console.debug("====>getSlot ActsAnsRemoveSlotTest_0100 finish====>");
...@@ -82,6 +84,7 @@ describe('ActsAnsRemoveSlotTest', function () { ...@@ -82,6 +84,7 @@ describe('ActsAnsRemoveSlotTest', function () {
expect(data.bypassDnd).assertEqual(false); expect(data.bypassDnd).assertEqual(false);
expect(data.lockscreenVisibility).assertEqual(2); expect(data.lockscreenVisibility).assertEqual(2);
expect(data.vibrationEnabled).assertEqual(true); expect(data.vibrationEnabled).assertEqual(true);
expect(data.sound).assertEqual(SOUNDURL);
expect(data.lightEnabled).assertEqual(false); expect(data.lightEnabled).assertEqual(false);
expect(data.lightColor).assertEqual(0); expect(data.lightColor).assertEqual(0);
console.debug("====>getSlot ActsAnsRemoveSlotTest_0200 finish====>"); console.debug("====>getSlot ActsAnsRemoveSlotTest_0200 finish====>");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册