diff --git a/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_button/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_checkbox/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_datapanel/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_radio/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_select/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_select/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_select/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_select/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_sidebar/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_sidebar/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_sidebar/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_sidebar/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_swiper/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_tabs/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_tabs/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_tabs/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_tabs/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100755 --- a/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_text/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_textinput/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_textpicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index d6c662824093f9339085214d247c6247faa86ae9..a46d1e1e841c63300a04e5ad1a914b9d5948a596 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_components_ux/ace_ets_component_timepicker/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -24,14 +24,14 @@ function translateParamsToString(parameters) { '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', '-s dryRun' - ]) + ]); let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` + targetParams = `${targetParams} ${key} ${parameters[key]}`; } } - return targetParams.trim() + return targetParams.trim(); } async function onAbilityCreateCallback() { @@ -39,7 +39,7 @@ async function onAbilityCreateCallback() { hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } -async function addAbilityMonitorCallback(err: any) { +async function addAbilityMonitorCallback(err): Promise { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } @@ -56,30 +56,29 @@ export default class OpenHarmonyTestRunner implements TestRunner { async onRun() { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'; let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName; + cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters); + let debug = abilityDelegatorArguments.parameters['-D']; + if (debug == 'true') { + cmd += ' -D'; } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { + (err, d) => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) + }); hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file