diff --git a/settingsdata/settings_ets/entry/src/main/ets/MainAbility/test/SettingUiJsunit.test.ets b/settingsdata/settings_ets/entry/src/main/ets/MainAbility/test/SettingUiJsunit.test.ets index 18fa1c44b0bfc4bdf9864a40d648234a84f55ffe..08009ee512b9bba7291bbde1c9f0e8fe3f27fa74 100755 --- a/settingsdata/settings_ets/entry/src/main/ets/MainAbility/test/SettingUiJsunit.test.ets +++ b/settingsdata/settings_ets/entry/src/main/ets/MainAbility/test/SettingUiJsunit.test.ets @@ -1131,6 +1131,57 @@ export default function settingUiJsunit() { var str ="settings.wireless.owner_lockdown_wifi_cfg" expect(str).assertEqual(settings.wireless.OWNER_LOCKDOWN_WIFI_CFG); done(); + }); + + it('settings_get_value_111',0,async function (done) { + let uri = 'dataability:///com.ohos.settingsdata.DataAbility'; + let helper = featureAbility.acquireDataAbilityHelper(uri); + let name = 'settings.screen.brightness111';//关键字 + let value = 'brightness111'//值 + try{ + settings.setValue(helper, name, value,(data)=>{ + console.info("[settings_get_value_111] value is:" + data); + settings.getValue(helper, name).then(ret => { + console.info("[settings_get_value_111] value is:" + ret); + expect(ret).assertEqual(value); + done(); + }) + }); + }catch(err){ + console.info("[settings_get_value_111] error is:" + toString(error)); + expect(true).assertTrue(); + done(); + return; + } + }); + + it('settings_get_value_112',0,async function (done) { + let uri = 'dataability:///com.ohos.settingsdata.DataAbility'; + let helper = featureAbility.acquireDataAbilityHelper(uri); + let name = 'settings.screen.brightness112';//关键字 + let value = 'brightness112'//值 + try{ + settings.setValue(helper, name, value) + .then((data)=>{ + console.info("[settings_get_value_112] value is:" + data); + settings.getValue(helper, name).then(ret => { + console.info("[settings_get_value_112] value is:" + ret); + expect(ret).assertEqual(value); + done(); + }) + }) + .catch((err)=>{ + console.info("[settings_get_value_112] error is:" + toString(error)); + expect(true).assertTrue(); + done(); + return; + }) + }catch(err){ + console.info("[settings_get_value_111] error is:" + toString(error)); + expect(true).assertTrue(); + done(); + return; + } }); }) }