diff --git a/ace/ace_standard/src/main/config.json b/ace/ace_standard/src/main/config.json index 1f30482864cd073aa3700df24db9b6fcd6755104..8514eb7f677ecce028f44be8f5354b2d2211f728 100755 --- a/ace/ace_standard/src/main/config.json +++ b/ace/ace_standard/src/main/config.json @@ -55,103 +55,179 @@ "pages/routerReplace/index", "pages/button/router/index", "pages/chart/router/index", + "pages/chart/style/index", "pages/input/prop/index", "pages/input/router/index", "pages/input/style/index", - "pages/slider/index", + "pages/slider/router/index", + "pages/slider/style/index", "pages/text/router/index", "pages/text/prop/index", + "pages/text/style/index", "pages/divider/router/index", + "pages/divider/style/index", "pages/image/router/index", + "pages/image/style/index", "pages/label/router/index", "pages/label/prop/index", + "pages/label/style/index", "pages/rating/prop/index", "pages/rating/router/index", + "pages/rating/style/index", "pages/search/router/index", "pages/search/prop/index", - "pages/toolbar/index", + "pages/search/style/index", + "pages/toolbar/prop/index", + "pages/toolbar/router/index", + "pages/toolbarItem/prop/index", + "pages/toolbarItem/router/index", "pages/textarea/prop/index", "pages/textarea/router/index", + "pages/textarea/style/index", "pages/menu/router/index", + "pages/menu/style/index", "pages/span/router/index", "pages/switch/router/index", - "pages/toggle/index", + "pages/switch/style/index", + "pages/toggle/prop/index", + "pages/toggle/router/index", + "pages/toggle/style/index", "pages/option/router/index", "pages/option/prop/index", + "pages/option/style/index", "pages/picker/router/index", "pages/picker/prop/index", + "pages/picker/style/index", "pages/pickerView/router/index", "pages/pickerView/prop/index", + "pages/pickerView/style/index", "pages/piece/router/index", "pages/piece/prop/index", + "pages/piece/style/index", "pages/progress/router/index", "pages/progress/prop/index", - "pages/qrcode/index", + "pages/progress/style/index", + "pages/qrcode/prop/index", + "pages/qrcode/router/index", + "pages/qrcode/style/index", "pages/select/prop/index", "pages/select/router/index", + "pages/select/style/index", "pages/div/router/index", "pages/badge/router/index", "pages/badge/prop/index", + "pages/badge/style/index", "pages/dialog/router/index", "pages/dialog/prop/index", + "pages/dialog/style/index", "pages/form/router/index", "pages/form/prop/index", + "pages/form/style/index", "pages/list/router/index", "pages/list/prop/index", + "pages/list/style/index", "pages/listItem/router/index", "pages/listItem/prop/index", + "pages/listItem/style/index", "pages/listItemGroup/router/index", "pages/listItemGroup/prop/index", + "pages/listItemGroup/style/index", "pages/marquee/router/index", "pages/marquee/prop/index", + "pages/marquee/style/index", "pages/imageAnimator/prop/index", "pages/imageAnimator/router/index", + "pages/imageAnimator/style/index", "pages/panel/router/index", "pages/panel/prop/index", + "pages/panel/style/index", "pages/popup/router/index", "pages/popup/prop/index", + "pages/popup/style/index", "pages/refresh/router/index", "pages/refresh/prop/index", + "pages/refresh/style/index", "pages/stack/router/index", "pages/stack/prop/index", + "pages/stack/style/index", "pages/stepper/router/index", "pages/stepper/prop/index", + "pages/stepper/style/index", "pages/stepperItem/router/index", "pages/stepperItem/prop/index", + "pages/stepperItem/style/index", "pages/swiper/router/index", "pages/swiper/prop/index", + "pages/swiper/style/index", "pages/tabs/router/index", "pages/tabs/prop/index", + "pages/tabs/style/index", "pages/tab-bar/router/index", "pages/tab-bar/prop/index", + "pages/tab-bar/style/index", "pages/tab-content/router/index", "pages/tab-content/prop/index", - "pages/svg_text/index", + "pages/tab-content/style/index", + "pages/svg_text/prop/index", + "pages/svg_text/router/index", "pages/video/prop/index", "pages/video/router/index", "pages/gridContainer/prop/index", "pages/gridContainer/router/index", - "pages/gridRow/index", - "pages/gridCol/index", - "pages/canvas/index", - "pages/obj_CanvasRenderingContext2D/index", - "pages/obj_Image/index", - "pages/obj_CanvasGradient/index", - "pages/obj_ImageData/index", - "pages/obj_Path2D/index", - "pages/obj_ImageBitmap/index", - "pages/obj_OffscreenCanvas/index", - "pages/obj_OffscreenCanvasRenderingContext2D/index", - "pages/ellipse/index", - "pages/path/index", - "pages/line/index", - "pages/polyline/index", - "pages/polygon/index", - "pages/animate/index", - "pages/animateMotion/index", - "pages/animateTransform/index", - "pages/textPath/index", - "pages/tspan/index", + "pages/gridContainer/style/index", + "pages/gridRow/prop/index", + "pages/gridRow/router/index", + "pages/gridRow/style/index", + "pages/gridCol/prop/index", + "pages/gridCol/router/index", + "pages/gridCol/style/index", + "pages/canvas/prop/index", + "pages/canvas/router/index", + "pages/canvas/style/index", + "pages/obj_CanvasRenderingContext2D/router/index", + "pages/obj_CanvasRenderingContext2D/prop/index", + "pages/obj_CanvasRenderingContext2D/style/index", + "pages/obj_Image/router/index", + "pages/obj_Image/prop/index", + "pages/obj_Image/style/index", + "pages/obj_CanvasGradient/router/index", + "pages/obj_CanvasGradient/prop/index", + "pages/obj_CanvasGradient/style/index", + "pages/obj_ImageData/router/index", + "pages/obj_ImageData/prop/index", + "pages/obj_ImageData/style/index", + "pages/obj_Path2D/router/index", + "pages/obj_Path2D/prop/index", + "pages/obj_Path2D/style/index", + "pages/obj_ImageBitmap/router/index", + "pages/obj_ImageBitmap/prop/index", + "pages/obj_ImageBitmap/style/index", + "pages/obj_OffscreenCanvas/router/index", + "pages/obj_OffscreenCanvas/prop/index", + "pages/obj_OffscreenCanvas/style/index", + "pages/obj_OffscreenCanvasRenderingContext2D/router/index", + "pages/obj_OffscreenCanvasRenderingContext2D/prop/index", + "pages/obj_OffscreenCanvasRenderingContext2D/style/index", + "pages/ellipse/prop/index", + "pages/ellipse/router/index", + "pages/path/prop/index", + "pages/path/router/index", + "pages/line/prop/index", + "pages/line/style/index", + "pages/polyline/prop/index", + "pages/polyline/router/index", + "pages/polygon/prop/index", + "pages/polygon/router/index", + "pages/animate/prop/index", + "pages/animate/router/index", + "pages/animateMotion/prop/index", + "pages/animateMotion/router/index", + "pages/animateTransform/prop/index", + "pages/animateTransform/router/index", + "pages/textPath/prop/index", + "pages/textPath/router/index", + "pages/tspan/prop/index", + "pages/tspan/router/index", "pages/div/prop/index", "pages/div/style/index", "pages/divider/prop/index", @@ -160,6 +236,7 @@ "pages/chart/prop/index", "pages/image/prop/index", "pages/span/prop/index", + "pages/span/style/index", "pages/menu/prop/index", "pages/switch/prop/index", "pages/slider/prop/index", @@ -168,7 +245,10 @@ "pages/rect/prop/index", "pages/rect/router/index", "pages/circle/prop/index", - "pages/circle/router/index" + "pages/circle/router/index", + "pages/richtext/prop/index", + "pages/richtext/router/index", + "pages/richtext/style/index" ], "name": "default", "window": { diff --git a/ace/ace_standard/src/main/js/default/test/animateMotionProps.test.js b/ace/ace_standard/src/main/js/default/test/animateMotionProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..1254b435a038fb06f8a3a27744c9630b63b4d3ab --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/animateMotionProps.test.js @@ -0,0 +1,760 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('toolbarPropsJsTest', function () { + + var name = 'animateMotion', nameA = 'AnimateMotion', labelName = 'animateMotion'; + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('['+name+'PropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/'+name+'/prop/index' + } + try { + result = router.push(options) + console.info("push "+name+"Props page success " + JSON.stringify(result)); + } catch (err) { + console.error("push "+name+"Props page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('['+name+'PropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionIdProp + * @tc.desc ACE + */ + it('test'+nameA+'IdProp', 0, async function (done) { + console.info('test'+nameA+'IdProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionAttributeNameProp + * @tc.desc ACE + */ + it('test'+nameA+'AttributeNameProp', 0, async function (done) { + console.info('test'+nameA+'AttributeNameProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.attributeNameProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('attributeNameProp') + expect(obj.$attrs.attributename).assertEqual('x') + console.info("["+name+"Props] get attributename value is: " + JSON.stringify(obj.$attrs.attributename)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionAttributeNamePropNone + * @tc.desc ACE + */ + it('test'+nameA+'AttributeNamePropNone', 0, async function (done) { + console.info('test'+nameA+'AttributeNamePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.attributeNamePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('attributeNamePropNone') + expect(obj.$attrs.attributename).assertEqual(undefined) + console.info("["+name+"Props] get attributename value is: " + JSON.stringify(obj.$attrs.attributename)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionBeginProp + * @tc.desc ACE + */ + it('test'+nameA+'BeginProp', 0, async function (done) { + console.info('test'+nameA+'BeginProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.beginProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('beginProp') + expect(obj.$attrs.begin).assertEqual('1000') + console.info("["+name+"Props] get begin value is: " + JSON.stringify(obj.$attrs.begin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionBeginPropNone + * @tc.desc ACE + */ + it('test'+nameA+'BeginPropNone', 0, async function (done) { + console.info('test'+nameA+'BeginPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.beginPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('beginPropNone') + expect(obj.$attrs.begin).assertEqual(undefined) + console.info("["+name+"Props] get begin value is: " + JSON.stringify(obj.$attrs.begin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionDurProp + * @tc.desc ACE + */ + it('test'+nameA+'DurProp', 0, async function (done) { + console.info('test'+nameA+'DurProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.durProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('durProp') + expect(obj.$attrs.dur).assertEqual('1000') + console.info("["+name+"Props] get dur value is: " + JSON.stringify(obj.$attrs.dur)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionDurPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DurPropNone', 0, async function (done) { + console.info('test'+nameA+'DurPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.durPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('durPropNone') + expect(obj.$attrs.dur).assertEqual(undefined) + console.info("["+name+"Props] get dur value is: " + JSON.stringify(obj.$attrs.dur)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionEndProp + * @tc.desc ACE + */ + it('test'+nameA+'EndProp', 0, async function (done) { + console.info('test'+nameA+'EndProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.endProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('endProp') + expect(obj.$attrs.end).assertEqual('1000') + console.info("["+name+"Props] get end value is: " + JSON.stringify(obj.$attrs.end)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionEndPropNone + * @tc.desc ACE + */ + it('test'+nameA+'EndPropNone', 0, async function (done) { + console.info('test'+nameA+'EndPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.endPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('endPropNone') + expect(obj.$attrs.end).assertEqual(undefined) + console.info("["+name+"Props] get end value is: " + JSON.stringify(obj.$attrs.end)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionRepeatCountProp + * @tc.desc ACE + */ + it('test'+nameA+'RepeatCountProp', 0, async function (done) { + console.info('test'+nameA+'RepeatCountProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.repeatCountProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('repeatCountProp') + expect(obj.$attrs.repeatcount).assertEqual('20') + console.info("["+name+"Props] get repeatcount value is: " + JSON.stringify(obj.$attrs.repeatcount)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionRepeatCountPropNone + * @tc.desc ACE + */ + it('test'+nameA+'RepeatCountPropNone', 0, async function (done) { + console.info('test'+nameA+'RepeatCountPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.repeatCountPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('repeatCountPropNone') + expect(obj.$attrs.repeatcount).assertEqual(undefined) + console.info("["+name+"Props] get repeatcount value is: " + JSON.stringify(obj.$attrs.repeatcount)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionFillPropFreeze + * @tc.desc ACE + */ + it('test'+nameA+'FillPropFreeze', 0, async function (done) { + console.info('test'+nameA+'FillPropFreeze START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillPropFreeze); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillPropFreeze') + expect(obj.$attrs.fill).assertEqual('freeze') + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionFillPropRemove + * @tc.desc ACE + */ + it('test'+nameA+'FillPropRemove', 0, async function (done) { + console.info('test'+nameA+'FillPropRemove START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillPropRemove); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillPropRemove') + expect(obj.$attrs.fill).assertEqual('remove') + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionCalcModePropDiscrete + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropDiscrete', 0, async function (done) { + console.info('test'+nameA+'CalcModePropDiscrete START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropDiscrete); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropDiscrete') + expect(obj.$attrs.calcmode).assertEqual('discrete') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionCalcModePropLinear + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropLinear', 0, async function (done) { + console.info('test'+nameA+'CalcModePropLinear START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropLinear); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropLinear') + expect(obj.$attrs.calcmode).assertEqual('linear') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionCalcModePropPaced + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropPaced', 0, async function (done) { + console.info('test'+nameA+'CalcModePropPaced START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropPaced); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropPaced') + expect(obj.$attrs.calcmode).assertEqual('Paced') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionCalcModePropSpline + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropSpline', 0, async function (done) { + console.info('test'+nameA+'CalcModePropSpline START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropSpline); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropSpline') + expect(obj.$attrs.calcmode).assertEqual('spline') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionKeyTimesProp + * @tc.desc ACE + */ + it('test'+nameA+'KeyTimesProp', 0, async function (done) { + console.info('test'+nameA+'KeyTimesProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keyTimesProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keyTimesProp') + expect(obj.$attrs.keytimes).assertEqual('0.3;0.6;0,9') + console.info("["+name+"Props] get keytimes value is: " + JSON.stringify(obj.$attrs.keytimes)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionKeyTimesPropNone + * @tc.desc ACE + */ + it('test'+nameA+'KeyTimesPropNone', 0, async function (done) { + console.info('test'+nameA+'KeyTimesPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keyTimesPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keyTimesPropNone') + expect(obj.$attrs.keytimes).assertEqual(undefined) + console.info("["+name+"Props] get keytimes value is: " + JSON.stringify(obj.$attrs.keytimes)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionKeySplinesProp + * @tc.desc ACE + */ + it('test'+nameA+'KeySplinesProp', 0, async function (done) { + console.info('test'+nameA+'KeySplinesProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keySplinesProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keySplinesProp') + expect(obj.$attrs.keysplines).assertEqual('0.5 0 0.5 1') + console.info("["+name+"Props] get keysplines value is: " + JSON.stringify(obj.$attrs.keysplines)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionKeySplinesPropNone + * @tc.desc ACE + */ + it('test'+nameA+'KeySplinesPropNone', 0, async function (done) { + console.info('test'+nameA+'KeySplinesPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keySplinesPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keySplinesPropNone') + expect(obj.$attrs.keysplines).assertEqual(undefined) + console.info("["+name+"Props] get keysplines value is: " + JSON.stringify(obj.$attrs.keysplines)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionByProp + * @tc.desc ACE + */ + it('test'+nameA+'ByProp', 0, async function (done) { + console.info('test'+nameA+'ByProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.byProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('byProp') + expect(obj.$attrs.by).assertEqual('1') + console.info("["+name+"Props] get by value is: " + JSON.stringify(obj.$attrs.by)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionByPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ByPropNone', 0, async function (done) { + console.info('test'+nameA+'ByPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.byPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('byPropNone') + expect(obj.$attrs.by).assertEqual(undefined) + console.info("["+name+"Props] get by value is: " + JSON.stringify(obj.$attrs.by)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionFromProp + * @tc.desc ACE + */ + it('test'+nameA+'FromProp', 0, async function (done) { + console.info('test'+nameA+'FromProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fromProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fromProp') + expect(obj.$attrs.from).assertEqual('10') + console.info("["+name+"Props] get from value is: " + JSON.stringify(obj.$attrs.from)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionFromPropNone + * @tc.desc ACE + */ + it('test'+nameA+'FromPropNone', 0, async function (done) { + console.info('test'+nameA+'FromPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fromPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fromPropNone') + expect(obj.$attrs.from).assertEqual(undefined) + console.info("["+name+"Props] get from value is: " + JSON.stringify(obj.$attrs.from)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionToProp + * @tc.desc ACE + */ + it('test'+nameA+'ToProp', 0, async function (done) { + console.info('test'+nameA+'ToProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.toProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('toProp') + expect(obj.$attrs.to).assertEqual('10') + console.info("["+name+"Props] get to value is: " + JSON.stringify(obj.$attrs.to)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionToPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ToPropNone', 0, async function (done) { + console.info('test'+nameA+'ToPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.toPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('toPropNone') + expect(obj.$attrs.to).assertEqual(undefined) + console.info("["+name+"Props] get to value is: " + JSON.stringify(obj.$attrs.to)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionKeyPointsProp + * @tc.desc ACE + */ + it('test'+nameA+'KeyPointsProp', 0, async function (done) { + console.info('test'+nameA+'KeyPointsProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keyPointsProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keyPointsProp') + expect(obj.$attrs.keypoints).assertEqual('0;0.2;0.4;0.6;0.8;1') + console.info("["+name+"Props] get keypoints value is: " + JSON.stringify(obj.$attrs.keypoints)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionKeyPointsPropNone + * @tc.desc ACE + */ + it('test'+nameA+'KeyPointsPropNone', 0, async function (done) { + console.info('test'+nameA+'KeyPointsPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keyPointsPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keyPointsPropNone') + expect(obj.$attrs.keypoints).assertEqual(undefined) + console.info("["+name+"Props] get keypoints value is: " + JSON.stringify(obj.$attrs.keypoints)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionPathProp + * @tc.desc ACE + */ + it('test'+nameA+'PathProp', 0, async function (done) { + console.info('test'+nameA+'PathProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pathProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('pathProp') + expect(obj.$attrs.path).assertEqual('m40,130 c0,-100 160,100 160,0 c0,-100,-160,100 -160,0 z') + console.info("["+name+"Props] get path value is: " + JSON.stringify(obj.$attrs.path)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionPathPropNone + * @tc.desc ACE + */ + it('test'+nameA+'PathPropNone', 0, async function (done) { + console.info('test'+nameA+'PathPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pathPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('pathPropNone') + expect(obj.$attrs.path).assertEqual(undefined) + console.info("["+name+"Props] get path value is: " + JSON.stringify(obj.$attrs.path)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionRotatePropRotate + * @tc.desc ACE + */ + it('test'+nameA+'RotatePropRotate', 0, async function (done) { + console.info('test'+nameA+'RotatePropRotate START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.rotatePropRotate); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('rotatePropRotate') + expect(obj.$attrs.rotate).assertEqual('rotate') + console.info("["+name+"Props] get rotate value is: " + JSON.stringify(obj.$attrs.rotate)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionRotatePropAutoReverse + * @tc.desc ACE + */ + it('test'+nameA+'RotatePropAutoReverse', 0, async function (done) { + console.info('test'+nameA+'RotatePropAutoReverse START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.rotatePropAutoReverse); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('rotatePropAutoReverse') + expect(obj.$attrs.rotate).assertEqual('auto-reverse') + console.info("["+name+"Props] get rotate value is: " + JSON.stringify(obj.$attrs.rotate)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionRotatePropNumber + * @tc.desc ACE + */ + it('test'+nameA+'RotatePropNumber', 0, async function (done) { + console.info('test'+nameA+'RotatePropNumber START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.rotatePropNumber); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('rotatePropNumber') + expect(obj.$attrs.rotate).assertEqual('45') + console.info("["+name+"Props] get rotate value is: " + JSON.stringify(obj.$attrs.rotate)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/animateProps.test.js b/ace/ace_standard/src/main/js/default/test/animateProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..f0b98a6dbbd82a9955bce9e6d7e2c73a539fe303 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/animateProps.test.js @@ -0,0 +1,660 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('toolbarPropsJsTest', function () { + + var name = 'animate', nameA = 'Animate', labelName = 'animate'; + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('['+name+'PropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/'+name+'/prop/index' + } + try { + result = router.push(options) + console.info("push "+name+"Props page success " + JSON.stringify(result)); + } catch (err) { + console.error("push "+name+"Props page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('['+name+'PropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateIdProp + * @tc.desc ACE + */ + it('test'+nameA+'IdProp', 0, async function (done) { + console.info('test'+nameA+'IdProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateAttributeNameProp + * @tc.desc ACE + */ + it('test'+nameA+'AttributeNameProp', 0, async function (done) { + console.info('test'+nameA+'AttributeNameProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.attributeNameProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('attributeNameProp') + expect(obj.$attrs.attributename).assertEqual('x') + console.info("["+name+"Props] get attributename value is: " + JSON.stringify(obj.$attrs.attributename)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateAttributeNamePropNone + * @tc.desc ACE + */ + it('test'+nameA+'AttributeNamePropNone', 0, async function (done) { + console.info('test'+nameA+'AttributeNamePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.attributeNamePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('attributeNamePropNone') + expect(obj.$attrs.attributename).assertEqual(undefined') + console.info("["+name+"Props] get attributename value is: " + JSON.stringify(obj.$attrs.attributename)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateBeginProp + * @tc.desc ACE + */ + it('test'+nameA+'BeginProp', 0, async function (done) { + console.info('test'+nameA+'BeginProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.beginProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('beginProp') + expect(obj.$attrs.begin).assertEqual('1000') + console.info("["+name+"Props] get begin value is: " + JSON.stringify(obj.$attrs.begin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateBeginPropNone + * @tc.desc ACE + */ + it('test'+nameA+'BeginPropNone', 0, async function (done) { + console.info('test'+nameA+'BeginPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.beginPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('beginPropNone') + expect(obj.$attrs.begin).assertEqual(undefined) + console.info("["+name+"Props] get begin value is: " + JSON.stringify(obj.$attrs.begin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateDurProp + * @tc.desc ACE + */ + it('test'+nameA+'DurProp', 0, async function (done) { + console.info('test'+nameA+'DurProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.durProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('durProp') + expect(obj.$attrs.dur).assertEqual('1000') + console.info("["+name+"Props] get dur value is: " + JSON.stringify(obj.$attrs.dur)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateDurPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DurPropNone', 0, async function (done) { + console.info('test'+nameA+'DurPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.durPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('durPropNone') + expect(obj.$attrs.dur).assertEqual(undefined) + console.info("["+name+"Props] get dur value is: " + JSON.stringify(obj.$attrs.dur)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateEndProp + * @tc.desc ACE + */ + it('test'+nameA+'EndProp', 0, async function (done) { + console.info('test'+nameA+'EndProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.endProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('endProp') + expect(obj.$attrs.end).assertEqual('1000') + console.info("["+name+"Props] get end value is: " + JSON.stringify(obj.$attrs.end)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateEndPropNone + * @tc.desc ACE + */ + it('test'+nameA+'EndPropNone', 0, async function (done) { + console.info('test'+nameA+'EndPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.endPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('endPropNone') + expect(obj.$attrs.end).assertEqual(undefined) + console.info("["+name+"Props] get end value is: " + JSON.stringify(obj.$attrs.end)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateRepeatCountProp + * @tc.desc ACE + */ + it('test'+nameA+'RepeatCountProp', 0, async function (done) { + console.info('test'+nameA+'RepeatCountProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.repeatCountProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('repeatCountProp') + expect(obj.$attrs.repeatcount).assertEqual('20') + console.info("["+name+"Props] get repeatcount value is: " + JSON.stringify(obj.$attrs.repeatcount)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateRepeatCountPropNone + * @tc.desc ACE + */ + it('test'+nameA+'RepeatCountPropNone', 0, async function (done) { + console.info('test'+nameA+'RepeatCountPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.repeatCountPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('repeatCountPropNone') + expect(obj.$attrs.repeatcount).assertEqual(undefined) + console.info("["+name+"Props] get repeatcount value is: " + JSON.stringify(obj.$attrs.repeatcount)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateFillPropFreeze + * @tc.desc ACE + */ + it('test'+nameA+'FillPropFreeze', 0, async function (done) { + console.info('test'+nameA+'FillPropFreeze START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillPropFreeze); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillPropFreeze') + expect(obj.$attrs.fill).assertEqual('freeze') + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateFillPropRemove + * @tc.desc ACE + */ + it('test'+nameA+'FillPropRemove', 0, async function (done) { + console.info('test'+nameA+'FillPropRemove START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillPropRemove); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillPropRemove') + expect(obj.$attrs.fill).assertEqual('remove') + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateCalcModePropDiscrete + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropDiscrete', 0, async function (done) { + console.info('test'+nameA+'CalcModePropDiscrete START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropDiscrete); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropDiscrete') + expect(obj.$attrs.calcmode).assertEqual('discrete') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateCalcModePropLinear + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropLinear', 0, async function (done) { + console.info('test'+nameA+'CalcModePropLinear START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropLinear); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropLinear') + expect(obj.$attrs.calcmode).assertEqual('linear') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateCalcModePropPaced + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropPaced', 0, async function (done) { + console.info('test'+nameA+'CalcModePropPaced START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropPaced); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropPaced') + expect(obj.$attrs.calcmode).assertEqual('Paced') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateCalcModePropSpline + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropSpline', 0, async function (done) { + console.info('test'+nameA+'CalcModePropSpline START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropSpline); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropSpline') + expect(obj.$attrs.calcmode).assertEqual('spline') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateKeyTimesProp + * @tc.desc ACE + */ + it('test'+nameA+'KeyTimesProp', 0, async function (done) { + console.info('test'+nameA+'KeyTimesProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keyTimesProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keyTimesProp') + expect(obj.$attrs.keytimes).assertEqual('0.3;0.6;0,9') + console.info("["+name+"Props] get keytimes value is: " + JSON.stringify(obj.$attrs.keytimes)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateKeyTimesPropNone + * @tc.desc ACE + */ + it('test'+nameA+'KeyTimesPropNone', 0, async function (done) { + console.info('test'+nameA+'KeyTimesPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keyTimesPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keyTimesPropNone') + expect(obj.$attrs.keytimes).assertEqual(undefined) + console.info("["+name+"Props] get keytimes value is: " + JSON.stringify(obj.$attrs.keytimes)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateKeySplinesProp + * @tc.desc ACE + */ + it('test'+nameA+'KeySplinesProp', 0, async function (done) { + console.info('test'+nameA+'KeySplinesProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keySplinesProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keySplinesProp') + expect(obj.$attrs.keysplines).assertEqual('0.5 0 0.5 1') + console.info("["+name+"Props] get keysplines value is: " + JSON.stringify(obj.$attrs.keysplines)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateKeySplinesPropNone + * @tc.desc ACE + */ + it('test'+nameA+'KeySplinesPropNone', 0, async function (done) { + console.info('test'+nameA+'KeySplinesPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keySplinesPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keySplinesPropNone') + expect(obj.$attrs.keysplines).assertEqual(undefined) + console.info("["+name+"Props] get keysplines value is: " + JSON.stringify(obj.$attrs.keysplines)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateByProp + * @tc.desc ACE + */ + it('test'+nameA+'ByProp', 0, async function (done) { + console.info('test'+nameA+'ByProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.byProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('byProp') + expect(obj.$attrs.by).assertEqual('1') + console.info("["+name+"Props] get by value is: " + JSON.stringify(obj.$attrs.by)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateByPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ByPropNone', 0, async function (done) { + console.info('test'+nameA+'ByPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.byPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('byPropNone') + expect(obj.$attrs.by).assertEqual(undefined) + console.info("["+name+"Props] get by value is: " + JSON.stringify(obj.$attrs.by)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateFromProp + * @tc.desc ACE + */ + it('test'+nameA+'FromProp', 0, async function (done) { + console.info('test'+nameA+'FromProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fromProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fromProp') + expect(obj.$attrs.from).assertEqual('10') + console.info("["+name+"Props] get from value is: " + JSON.stringify(obj.$attrs.from)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateFromPropNone + * @tc.desc ACE + */ + it('test'+nameA+'FromPropNone', 0, async function (done) { + console.info('test'+nameA+'FromPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fromPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fromPropNone') + expect(obj.$attrs.from).assertEqual(undefined) + console.info("["+name+"Props] get from value is: " + JSON.stringify(obj.$attrs.from)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateToProp + * @tc.desc ACE + */ + it('test'+nameA+'ToProp', 0, async function (done) { + console.info('test'+nameA+'ToProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.toProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('toProp') + expect(obj.$attrs.to).assertEqual('10') + console.info("["+name+"Props] get to value is: " + JSON.stringify(obj.$attrs.to)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateToPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ToPropNone', 0, async function (done) { + console.info('test'+nameA+'ToPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.toPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('toPropNone') + expect(obj.$attrs.to).assertEqual(undefined) + console.info("["+name+"Props] get to value is: " + JSON.stringify(obj.$attrs.to)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateValuesProp + * @tc.desc ACE + */ + it('test'+nameA+'ValuesProp', 0, async function (done) { + console.info('test'+nameA+'ValuesProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.valuesProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('valuesProp') + expect(obj.$attrs.values).assertEqual('10;30') + console.info("["+name+"Props] get values value is: " + JSON.stringify(obj.$attrs.values)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateValuesPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ValuesPropNone', 0, async function (done) { + console.info('test'+nameA+'ValuesPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.valuesPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('valuesPropNone') + expect(obj.$attrs.values).assertEqual(undefined) + console.info("["+name+"Props] get values value is: " + JSON.stringify(obj.$attrs.values)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/animateTransformProps.test.js b/ace/ace_standard/src/main/js/default/test/animateTransformProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..6058284ee90de73df70bd325d7c81725e9134df9 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/animateTransformProps.test.js @@ -0,0 +1,760 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('toolbarPropsJsTest', function () { + + var name = 'animateTransform', nameA = 'AnimateTransform', labelName = 'animateTransform'; + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('['+name+'PropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/'+name+'/prop/index' + } + try { + result = router.push(options) + console.info("push "+name+"Props page success " + JSON.stringify(result)); + } catch (err) { + console.error("push "+name+"Props page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('['+name+'PropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformIdProp + * @tc.desc ACE + */ + it('test'+nameA+'IdProp', 0, async function (done) { + console.info('test'+nameA+'IdProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformAttributeNameProp + * @tc.desc ACE + */ + it('test'+nameA+'AttributeNameProp', 0, async function (done) { + console.info('test'+nameA+'AttributeNameProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.attributeNameProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('attributeNameProp') + expect(obj.$attrs.attributename).assertEqual('x') + console.info("["+name+"Props] get attributename value is: " + JSON.stringify(obj.$attrs.attributename)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformAttributeNamePropNone + * @tc.desc ACE + */ + it('test'+nameA+'AttributeNamePropNone', 0, async function (done) { + console.info('test'+nameA+'AttributeNamePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.attributeNamePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('attributeNamePropNone') + expect(obj.$attrs.attributename).assertEqual(undefined) + console.info("["+name+"Props] get attributename value is: " + JSON.stringify(obj.$attrs.attributename)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformBeginProp + * @tc.desc ACE + */ + it('test'+nameA+'BeginProp', 0, async function (done) { + console.info('test'+nameA+'BeginProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.beginProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('beginProp') + expect(obj.$attrs.begin).assertEqual('1000') + console.info("["+name+"Props] get begin value is: " + JSON.stringify(obj.$attrs.begin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformBeginPropNone + * @tc.desc ACE + */ + it('test'+nameA+'BeginPropNone', 0, async function (done) { + console.info('test'+nameA+'BeginPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.beginPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('beginPropNone') + expect(obj.$attrs.begin).assertEqual(undefined) + console.info("["+name+"Props] get begin value is: " + JSON.stringify(obj.$attrs.begin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformDurProp + * @tc.desc ACE + */ + it('test'+nameA+'DurProp', 0, async function (done) { + console.info('test'+nameA+'DurProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.durProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('durProp') + expect(obj.$attrs.dur).assertEqual('1000') + console.info("["+name+"Props] get dur value is: " + JSON.stringify(obj.$attrs.dur)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformDurPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DurPropNone', 0, async function (done) { + console.info('test'+nameA+'DurPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.durPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('durPropNone') + expect(obj.$attrs.dur).assertEqual(undefined) + console.info("["+name+"Props] get dur value is: " + JSON.stringify(obj.$attrs.dur)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformEndProp + * @tc.desc ACE + */ + it('test'+nameA+'EndProp', 0, async function (done) { + console.info('test'+nameA+'EndProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.endProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('endProp') + expect(obj.$attrs.end).assertEqual('1000') + console.info("["+name+"Props] get end value is: " + JSON.stringify(obj.$attrs.end)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformEndPropNone + * @tc.desc ACE + */ + it('test'+nameA+'EndPropNone', 0, async function (done) { + console.info('test'+nameA+'EndPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.endPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('endPropNone') + expect(obj.$attrs.end).assertEqual(undefined) + console.info("["+name+"Props] get end value is: " + JSON.stringify(obj.$attrs.end)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformRepeatCountProp + * @tc.desc ACE + */ + it('test'+nameA+'RepeatCountProp', 0, async function (done) { + console.info('test'+nameA+'RepeatCountProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.repeatCountProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('repeatCountProp') + expect(obj.$attrs.repeatcount).assertEqual('20') + console.info("["+name+"Props] get repeatcount value is: " + JSON.stringify(obj.$attrs.repeatcount)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformRepeatCountPropNone + * @tc.desc ACE + */ + it('test'+nameA+'RepeatCountPropNone', 0, async function (done) { + console.info('test'+nameA+'RepeatCountPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.repeatCountPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('repeatCountPropNone') + expect(obj.$attrs.repeatcount).assertEqual(undefined) + console.info("["+name+"Props] get repeatcount value is: " + JSON.stringify(obj.$attrs.repeatcount)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformFillPropFreeze + * @tc.desc ACE + */ + it('test'+nameA+'FillPropFreeze', 0, async function (done) { + console.info('test'+nameA+'FillPropFreeze START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillPropFreeze); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillPropFreeze') + expect(obj.$attrs.fill).assertEqual('freeze') + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformFillPropRemove + * @tc.desc ACE + */ + it('test'+nameA+'FillPropRemove', 0, async function (done) { + console.info('test'+nameA+'FillPropRemove START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillPropRemove); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillPropRemove') + expect(obj.$attrs.fill).assertEqual('remove') + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformCalcModePropDiscrete + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropDiscrete', 0, async function (done) { + console.info('test'+nameA+'CalcModePropDiscrete START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropDiscrete); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropDiscrete') + expect(obj.$attrs.calcmode).assertEqual('discrete') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformCalcModePropLinear + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropLinear', 0, async function (done) { + console.info('test'+nameA+'CalcModePropLinear START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropLinear); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropLinear') + expect(obj.$attrs.calcmode).assertEqual('linear') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformCalcModePropPaced + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropPaced', 0, async function (done) { + console.info('test'+nameA+'CalcModePropPaced START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropPaced); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropPaced') + expect(obj.$attrs.calcmode).assertEqual('Paced') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformCalcModePropSpline + * @tc.desc ACE + */ + it('test'+nameA+'CalcModePropSpline', 0, async function (done) { + console.info('test'+nameA+'CalcModePropSpline START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.calcModePropSpline); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('calcModePropSpline') + expect(obj.$attrs.calcmode).assertEqual('spline') + console.info("["+name+"Props] get calcmode value is: " + JSON.stringify(obj.$attrs.calcmode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformKeyTimesProp + * @tc.desc ACE + */ + it('test'+nameA+'KeyTimesProp', 0, async function (done) { + console.info('test'+nameA+'KeyTimesProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keyTimesProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keyTimesProp') + expect(obj.$attrs.keytimes).assertEqual('0.3;0.6;0,9') + console.info("["+name+"Props] get keytimes value is: " + JSON.stringify(obj.$attrs.keytimes)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformKeyTimesPropNone + * @tc.desc ACE + */ + it('test'+nameA+'KeyTimesPropNone', 0, async function (done) { + console.info('test'+nameA+'KeyTimesPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keyTimesPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keyTimesPropNone') + expect(obj.$attrs.keytimes).assertEqual(undefined) + console.info("["+name+"Props] get keytimes value is: " + JSON.stringify(obj.$attrs.keytimes)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformKeySplinesProp + * @tc.desc ACE + */ + it('test'+nameA+'KeySplinesProp', 0, async function (done) { + console.info('test'+nameA+'KeySplinesProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keySplinesProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keySplinesProp') + expect(obj.$attrs.keysplines).assertEqual('0.5 0 0.5 1') + console.info("["+name+"Props] get keysplines value is: " + JSON.stringify(obj.$attrs.keysplines)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformKeySplinesPropNone + * @tc.desc ACE + */ + it('test'+nameA+'KeySplinesPropNone', 0, async function (done) { + console.info('test'+nameA+'KeySplinesPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.keySplinesPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('keySplinesPropNone') + expect(obj.$attrs.keysplines).assertEqual(undefined) + console.info("["+name+"Props] get keysplines value is: " + JSON.stringify(obj.$attrs.keysplines)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformByProp + * @tc.desc ACE + */ + it('test'+nameA+'ByProp', 0, async function (done) { + console.info('test'+nameA+'ByProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.byProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('byProp') + expect(obj.$attrs.by).assertEqual('1') + console.info("["+name+"Props] get by value is: " + JSON.stringify(obj.$attrs.by)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformByPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ByPropNone', 0, async function (done) { + console.info('test'+nameA+'ByPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.byPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('byPropNone') + expect(obj.$attrs.by).assertEqual(undefined) + console.info("["+name+"Props] get by value is: " + JSON.stringify(obj.$attrs.by)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformFromProp + * @tc.desc ACE + */ + it('test'+nameA+'FromProp', 0, async function (done) { + console.info('test'+nameA+'FromProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fromProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fromProp') + expect(obj.$attrs.from).assertEqual('10') + console.info("["+name+"Props] get from value is: " + JSON.stringify(obj.$attrs.from)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformFromPropNone + * @tc.desc ACE + */ + it('test'+nameA+'FromPropNone', 0, async function (done) { + console.info('test'+nameA+'FromPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fromPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fromPropNone') + expect(obj.$attrs.from).assertEqual(undefined) + console.info("["+name+"Props] get from value is: " + JSON.stringify(obj.$attrs.from)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformToProp + * @tc.desc ACE + */ + it('test'+nameA+'ToProp', 0, async function (done) { + console.info('test'+nameA+'ToProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.toProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('toProp') + expect(obj.$attrs.to).assertEqual('10') + console.info("["+name+"Props] get to value is: " + JSON.stringify(obj.$attrs.to)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformToPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ToPropNone', 0, async function (done) { + console.info('test'+nameA+'ToPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.toPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('toPropNone') + expect(obj.$attrs.to).assertEqual(undefined) + console.info("["+name+"Props] get to value is: " + JSON.stringify(obj.$attrs.to)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformValuesProp + * @tc.desc ACE + */ + it('test'+nameA+'ValuesProp', 0, async function (done) { + console.info('test'+nameA+'ValuesProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.valuesProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('valuesProp') + expect(obj.$attrs.values).assertEqual('10;30') + console.info("["+name+"Props] get values value is: " + JSON.stringify(obj.$attrs.values)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformValuesPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ValuesPropNone', 0, async function (done) { + console.info('test'+nameA+'ValuesPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.valuesPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('valuesPropNone') + expect(obj.$attrs.values).assertEqual(undefined) + console.info("["+name+"Props] get values value is: " + JSON.stringify(obj.$attrs.values)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformTypePropTranslate + * @tc.desc ACE + */ + it('test'+nameA+'TypePropTranslate', 0, async function (done) { + console.info('test'+nameA+'TypePropTranslate START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typePropTranslate); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('typePropTranslate') + expect(obj.$attrs.type).assertEqual('translate') + console.info("["+name+"Props] get values type is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformTypePropScale + * @tc.desc ACE + */ + it('test'+nameA+'TypePropScale', 0, async function (done) { + console.info('test'+nameA+'TypePropScale START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typePropScale); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('typePropScale') + expect(obj.$attrs.type).assertEqual('scale') + console.info("["+name+"Props] get values type is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformTypePropRotate + * @tc.desc ACE + */ + it('test'+nameA+'TypePropRotate', 0, async function (done) { + console.info('test'+nameA+'TypePropRotate START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typePropRotate); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('typePropRotate') + expect(obj.$attrs.type).assertEqual('rotate') + console.info("["+name+"Props] get values type is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformTypePropSkewX + * @tc.desc ACE + */ + it('test'+nameA+'TypePropSkewX', 0, async function (done) { + console.info('test'+nameA+'TypePropSkewX START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typePropSkewX); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('typePropSkewX') + expect(obj.$attrs.type).assertEqual('skewX') + console.info("["+name+"Props] get values type is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformTypePropSkewY + * @tc.desc ACE + */ + it('test'+nameA+'TypePropSkewY', 0, async function (done) { + console.info('test'+nameA+'TypePropSkewY START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typePropSkewY); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('typePropSkewY') + expect(obj.$attrs.type).assertEqual('skewY') + console.info("["+name+"Props] get values type is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/canvasProps.test.js b/ace/ace_standard/src/main/js/default/test/canvasProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..758d0299dffdc97562c400f3b3698767d7bf23f9 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/canvasProps.test.js @@ -0,0 +1,610 @@ +/* + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('canvasPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }) + resolve() + }, 500) + }) + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear() + resolve() + }, 500) + }) + await backToIndexPromise.then(() => { + return clearPromise; + }) + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[canvasPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/canvas/prop/index' + } + try { + result = router.push(options) + console.info("push canvasProps page success " + JSON.stringify(result)) + } catch (err) { + console.error("push canvasProps page error " + JSON.stringify(result)) + } + await sleep(4000) + done() + }) + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[canvasPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasIdProp + * @tc.desc ACE + */ + it('testCanvasIdProp', 0, async function (done) { + console.info('testCanvasIdProp START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.idProp) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('idProp') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasClassProp + * @tc.desc ACE + */ + it('testCanvasClassProp', 0, async function (done) { + console.info('testCanvasClassProp START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.classProp) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasClassPropNone + * @tc.desc ACE + */ + it('testCanvasClassPropNone', 0, async function (done) { + console.info('testCanvasClassPropNone START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.classPropNone) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[canvasProps] get className value is: " + JSON.stringify(obj.$attrs.className)) + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasStyleProp + * @tc.desc ACEs + */ + // it('testCanvasStyleProp', 0, async function (done) { + // console.info('testCanvasStyleProp START') + // console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + // + // let obj = JSON.parse(globalThis.value.styleProp) + // console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + // console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + // + // expect(obj.$type).assertEqual('canvas') + // expect(obj.$attrs.id).assertEqual('styleProp') + // expect(obj.$attrs.style).assertEqual(undefined) + // console.info("[canvasProps] get style value is: " + JSON.stringify(obj.$attrs.style)) + // + // expect(obj.$styles.width).assertEqual(undefined) + // console.info("[canvasProps] get style width value is: " + JSON.stringify(obj.$styles.width)) + // expect(obj.$styles.height).assertEqual(undefined) + // console.info("[canvasProps] get style height value is: " + JSON.stringify(obj.$styles.height)) + // expect(obj.$styles.get('background-color')).assertEqual(undefined) + // done() + // }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasRefProp + * @tc.desc ACE + */ + it('testCanvasRefProp', 0, async function (done) { + console.info('testCanvasRefProp START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.refProp) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasRefPropNone + * @tc.desc ACE + */ + it('testCanvasRefPropNone', 0, async function (done) { + console.info('testCanvasRefPropNone START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.refPropNone) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("[canvasProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)) + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasDisabledPropTrue + * @tc.desc ACE + */ + it('testCanvasDisabledPropTrue', 0, async function (done) { + console.info('testCanvasDisabledPropTrue START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.disabledPropTrue) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasDisabledPropFalse + * @tc.desc ACE + */ + it('testCanvasDisabledPropFalse', 0, async function (done) { + console.info('testCanvasDisabledPropFalse START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.disabledPropFalse) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasDisabledPropNone + * @tc.desc ACE + */ + it('testCanvasDisabledPropNone', 0, async function (done) { + console.info('testCanvasDisabledPropNone START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.disabledPropNone) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasFocusablePropTrue + * @tc.desc ACE + */ + it('testCanvasFocusablePropTrue', 0, async function (done) { + console.info('testCanvasFocusablePropTrue START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.focusablePropTrue) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasFocusablePropFalse + * @tc.desc ACE + */ + it('testCanvasFocusablePropFalse', 0, async function (done) { + console.info('testCanvasFocusablePropFalse START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.focusablePropFalse) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasFocusablePropNone + * @tc.desc ACE + */ + it('testCanvasFocusablePropNone', 0, async function (done) { + console.info('testCanvasFocusablePropNone START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.focusablePropNone) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasDataProp + * @tc.desc ACE + */ + it('testCanvasDataProp', 0, async function (done) { + console.info('testCanvasDataProp START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.dataProp) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.dataCanvas).assertEqual(undefined) + console.info("[canvasProps] get dataCanvas value is: " + JSON.stringify(obj.$attrs.dataCanvas)) + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasDataPropNone + * @tc.desc ACE + */ + it('testCanvasDataPropNone', 0, async function (done) { + console.info('testCanvasDataPropNone START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.dataPropNone) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.dataCanvas).assertEqual(undefined) + console.info("[canvasProps] get dataCanvas value is: " + JSON.stringify(obj.$attrs.dataCanvas)) + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasDirPropRtl + * @tc.desc ACE + */ + it('testCanvasDirPropRtl', 0, async function (done) { + console.info('testCanvasDirPropRtl START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.dirPropRtl) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasDirPropLtr + * @tc.desc ACE + */ + it('testCanvasDirPropLtr', 0, async function (done) { + console.info('testCanvasDirPropLtr START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.dirPropLtr) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasDirPropAuto + * @tc.desc ACE + */ + it('testCanvasDirPropAuto', 0, async function (done) { + console.info('testCanvasDirPropAuto START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.dirPropAuto) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasDirPropNone + * @tc.desc ACE + */ + it('testCanvasDirPropNone', 0, async function (done) { + console.info('testCanvasDirPropNone START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.dirPropNone) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasForPropNull + * @tc.desc ACE + */ + it('testCanvasForPropNull', 0, async function (done) { + console.info('testCanvasForPropNull START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.forPropNull) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[canvasProps] get for value is: " + JSON.stringify(obj.$attrs.for)) + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasForPropOne + * @tc.desc ACE + */ + it('testCanvasForPropOne', 0, async function (done) { + console.info('testCanvasForPropOne START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.forPropOne) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[canvasProps] get for value is: " + JSON.stringify(obj.$attrs.for)) + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasForPropThree + * @tc.desc ACE + */ + it('testCanvasForPropThree', 0, async function (done) { + console.info('testCanvasForPropThree START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.forPropThree) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[canvasProps] get for value is: " + JSON.stringify(obj.$attrs.for)) + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasIfPropTrue + * @tc.desc ACE + */ + it('testCanvasIfPropTrue', 0, async function (done) { + console.info('testCanvasIfPropTrue START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.ifPropTrue) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("[canvasProps] get for value is: " + JSON.stringify(obj.$attrs.if)) + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasIfPropFalse + * @tc.desc ACE + */ + // it('testCanvasIfPropFalse', 0, async function (done) { + // console.info('testCanvasIfPropFalse START') + // console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + // + // let obj = JSON.parse(globalThis.value.ifPropFalse) + // console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + // console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + // + // expect(obj.$type).assertEqual('canvas') + // expect(obj.$attrs.id).assertEqual('ifPropFalse') + // expect(obj.$attrs.if).assertEqual(false) + // done() + // }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasIfPropNone + * @tc.desc ACE + */ + // it('testCanvasIfPropNone', 0, async function (done) { + // console.info('testCanvasIfPropNone START') + // console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + // + // let obj = JSON.parse(globalThis.value.ifPropNone) + // console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + // console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + // + // expect(obj.$type).assertEqual('canvas') + // expect(obj.$attrs.id).assertEqual('ifPropNone') + // expect(obj.$attrs.if).assertEqual(false) + // done() + // }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasShowPropTrue + * @tc.desc ACE + */ + it('testCanvasShowPropTrue', 0, async function (done) { + console.info('testCanvasShowPropTrue START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.showPropTrue) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("[canvasProps] get show value is: " + JSON.stringify(obj.$attrs.show)) + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasShowPropFalse + * @tc.desc ACE + */ + it('testCanvasShowPropFalse', 0, async function (done) { + console.info('testCanvasShowPropFalse START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.showPropFalse) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("[canvasProps] get show value is: " + JSON.stringify(obj.$attrs.show)) + done() + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testCanvasShowPropNone + * @tc.desc ACE + */ + it('testCanvasShowPropNone', 0, async function (done) { + console.info('testCanvasShowPropNone START') + console.info("[canvasProps] get globalThis.value is: " + JSON.stringify(globalThis.value)) + + let obj = JSON.parse(globalThis.value.showPropNone) + console.info("[canvasProps] get inspector value is: " + JSON.stringify(obj)) + console.info("[canvasProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)) + + expect(obj.$type).assertEqual('canvas') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual('true') + console.info("[canvasProps] get show value is: " + JSON.stringify(obj.$attrs.show)) + done() + }) +}) diff --git a/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js b/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js index 929a0df9a90e8e1e821e19aa2dbbf3218f81c48a..0886d8e87cfad6145cd882b87eaf5af58b892e7e 100644 --- a/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js +++ b/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js @@ -65,7 +65,7 @@ describe('aceJsTest', function () { it('testStepperComponent', 0, async function (done) { let result; let options = { - uri: 'pages/stepper/index' + uri: 'pages/stepper/router/index' } try { result = router.push(options) @@ -76,7 +76,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.stepper] getState" + JSON.stringify(pages)); - expect("pages/stepper/").assertEqual(pages.path); + expect("pages/stepper/router/").assertEqual(pages.path); done(); }); @@ -184,7 +184,7 @@ describe('aceJsTest', function () { it('testTextComponent', 0, async function (done) { let result; let options = { - uri: 'pages/text/index' + uri: 'pages/text/router/index' } try { result = router.push(options) @@ -193,7 +193,7 @@ describe('aceJsTest', function () { } await sleep(1000) let pages = router.getState(); - expect("pages/text/").assertEqual(pages.path); + expect("pages/text/router/").assertEqual(pages.path); done(); }); @@ -353,7 +353,7 @@ describe('aceJsTest', function () { it('testToolbarComponent', 0, async function (done) { let result; let options = { - uri: 'pages/toolbar/index' + uri: 'pages/toolbar/router/index' } try { result = router.push(options) @@ -362,7 +362,7 @@ describe('aceJsTest', function () { } await sleep(1000) let pages = router.getState(); - expect("pages/toolbar/").assertEqual(pages.path); + expect("pages/toolbar/router/").assertEqual(pages.path); done(); }); @@ -437,7 +437,7 @@ describe('aceJsTest', function () { it('testToggleComponent', 0, async function (done) { let result; let options = { - uri: 'pages/toggle/index' + uri: 'pages/toggle/router/index' } try { result = router.push(options) @@ -446,7 +446,7 @@ describe('aceJsTest', function () { } await sleep(1000) let pages = router.getState(); - expect("pages/toggle/").assertEqual(pages.path); + expect("pages/toggle/router/").assertEqual(pages.path); done(); }); @@ -521,7 +521,7 @@ describe('aceJsTest', function () { it('testPieceComponent', 0, async function (done) { let result; let options = { - uri: 'pages/piece/index' + uri: 'pages/piece/router/index' } try { result = router.push(options) @@ -530,7 +530,7 @@ describe('aceJsTest', function () { } await sleep(1000) let pages = router.getState(); - expect("pages/piece/").assertEqual(pages.path); + expect("pages/piece/router/").assertEqual(pages.path); done(); }); @@ -563,7 +563,7 @@ describe('aceJsTest', function () { it('testQrcodeComponent', 0, async function (done) { let result; let options = { - uri: 'pages/qrcode/index' + uri: 'pages/qrcode/router/index' } try { result = router.push(options) @@ -572,7 +572,7 @@ describe('aceJsTest', function () { } await sleep(1000) let pages = router.getState(); - expect("pages/qrcode/").assertEqual(pages.path); + expect("pages/qrcode/router/").assertEqual(pages.path); done(); }); @@ -605,7 +605,7 @@ describe('aceJsTest', function () { it('testBadgeComponent', 0, async function (done) { let result; let options = { - uri: 'pages/badge/index' + uri: 'pages/badge/router/index' } try { result = router.push(options) @@ -616,7 +616,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.badge] getState" + JSON.stringify(pages)); - expect("pages/badge/").assertEqual(pages.path); + expect("pages/badge/router/").assertEqual(pages.path); done(); }); @@ -628,7 +628,7 @@ describe('aceJsTest', function () { it('testDialogComponent', 0, async function (done) { let result; let options = { - uri: 'pages/dialog/index' + uri: 'pages/dialog/router/index' } try { result = router.push(options) @@ -639,7 +639,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.dialog] getState" + JSON.stringify(pages)); - expect("pages/dialog/").assertEqual(pages.path); + expect("pages/dialog/router/").assertEqual(pages.path); done(); }); @@ -674,7 +674,7 @@ describe('aceJsTest', function () { it('testFormComponent', 0, async function (done) { let result; let options = { - uri: 'pages/form/index' + uri: 'pages/form/router/index' } try { result = router.push(options) @@ -685,7 +685,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.form] getState" + JSON.stringify(pages)); - expect("pages/form/").assertEqual(pages.path); + expect("pages/form/router/").assertEqual(pages.path); done(); }); @@ -697,7 +697,7 @@ describe('aceJsTest', function () { it('testListComponent', 0, async function (done) { let result; let options = { - uri: 'pages/list/index' + uri: 'pages/list/router/index' } try { result = router.push(options) @@ -708,7 +708,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.list] getState" + JSON.stringify(pages)); - expect("pages/list/").assertEqual(pages.path); + expect("pages/list/router/").assertEqual(pages.path); done(); }); @@ -720,7 +720,7 @@ describe('aceJsTest', function () { it('testListItemComponent', 0, async function (done) { let result; let options = { - uri: 'pages/listItem/index' + uri: 'pages/listItem/router/index' } try { result = router.push(options) @@ -731,7 +731,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.listItem] getState" + JSON.stringify(pages)); - expect("pages/listItem/").assertEqual(pages.path); + expect("pages/listItem/router/").assertEqual(pages.path); done(); }); @@ -743,7 +743,7 @@ describe('aceJsTest', function () { it('testListItemGroupComponent', 0, async function (done) { let result; let options = { - uri: 'pages/listItemGroup/index' + uri: 'pages/listItemGroup/router/index' } try { result = router.push(options) @@ -754,7 +754,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.listItemGroup] getState" + JSON.stringify(pages)); - expect("pages/listItemGroup/").assertEqual(pages.path); + expect("pages/listItemGroup/router/").assertEqual(pages.path); done(); }); @@ -766,7 +766,7 @@ describe('aceJsTest', function () { it('testPanelComponent', 0, async function (done) { let result; let options = { - uri: 'pages/panel/index' + uri: 'pages/panel/router/index' } try { result = router.push(options) @@ -777,7 +777,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.panel] getState" + JSON.stringify(pages)); - expect("pages/panel/").assertEqual(pages.path); + expect("pages/panel/router/").assertEqual(pages.path); done(); }); @@ -789,7 +789,7 @@ describe('aceJsTest', function () { it('testPopupComponent', 0, async function (done) { let result; let options = { - uri: 'pages/popup/index' + uri: 'pages/popup/router/index' } try { result = router.push(options) @@ -800,7 +800,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.popup] getState" + JSON.stringify(pages)); - expect("pages/popup/").assertEqual(pages.path); + expect("pages/popup/router/").assertEqual(pages.path); done(); }); @@ -812,7 +812,7 @@ describe('aceJsTest', function () { it('testStackComponent', 0, async function (done) { let result; let options = { - uri: 'pages/stack/index' + uri: 'pages/stack/router/index' } try { result = router.push(options) @@ -823,7 +823,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.stack] getState" + JSON.stringify(pages)); - expect("pages/stack/").assertEqual(pages.path); + expect("pages/stack/router/").assertEqual(pages.path); done(); }); @@ -835,7 +835,7 @@ describe('aceJsTest', function () { it('testSwiperComponent', 0, async function (done) { let result; let options = { - uri: 'pages/swiper/index' + uri: 'pages/swiper/router/index' } try { result = router.push(options) @@ -846,7 +846,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.swiper] getState" + JSON.stringify(pages)); - expect("pages/swiper/").assertEqual(pages.path); + expect("pages/swiper/router/").assertEqual(pages.path); done(); }); @@ -881,7 +881,7 @@ describe('aceJsTest', function () { it('testRefreshComponent', 0, async function (done) { let result; let options = { - uri: 'pages/refresh/index' + uri: 'pages/refresh/router/index' } try { result = router.push(options) @@ -892,7 +892,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.refresh] getState" + JSON.stringify(pages)); - expect("pages/refresh/").assertEqual(pages.path); + expect("pages/refresh/router/").assertEqual(pages.path); done(); }); @@ -1019,7 +1019,7 @@ describe('aceJsTest', function () { it('testSvgTextComponent', 0, async function (done) { let result; let options = { - uri: 'pages/svg_text/index' + uri: 'pages/svg_text/router/index' } try { result = router.push(options) @@ -1030,7 +1030,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.svg_text] getState" + JSON.stringify(pages)); - expect("pages/svg_text/").assertEqual(pages.path); + expect("pages/svg_text/router/").assertEqual(pages.path); done(); }); @@ -1065,7 +1065,7 @@ describe('aceJsTest', function () { it('testGridRowComponent', 0, async function (done) { let result; let options = { - uri: 'pages/gridRow/index' + uri: 'pages/gridRow/router/index' } try { result = router.push(options) @@ -1076,7 +1076,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.gridRow] getState" + JSON.stringify(pages)); - expect("pages/gridRow/").assertEqual(pages.path); + expect("pages/gridRow/router/").assertEqual(pages.path); done(); }); @@ -1088,7 +1088,7 @@ describe('aceJsTest', function () { it('testGridColComponent', 0, async function (done) { let result; let options = { - uri: 'pages/gridCol/index' + uri: 'pages/gridCol/router/index' } try { result = router.push(options) @@ -1099,7 +1099,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.gridCol] getState" + JSON.stringify(pages)); - expect("pages/gridCol/").assertEqual(pages.path); + expect("pages/gridCol/router/").assertEqual(pages.path); done(); }); @@ -1111,7 +1111,7 @@ describe('aceJsTest', function () { it('testCanvasComponent', 0, async function (done) { let result; let options = { - uri: 'pages/canvas/index' + uri: 'pages/canvas/router/index' } try { result = router.push(options) @@ -1122,7 +1122,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.canvas] getState" + JSON.stringify(pages)); - expect("pages/canvas/").assertEqual(pages.path); + expect("pages/canvas/router/").assertEqual(pages.path); done(); }); @@ -1134,7 +1134,7 @@ describe('aceJsTest', function () { it('testCanvasRenderingContext2DComponent', 0, async function (done) { let result; let options = { - uri: 'pages/obj_CanvasRenderingContext2D/index' + uri: 'pages/obj_CanvasRenderingContext2D/router/index' } try { result = router.push(options) @@ -1145,7 +1145,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.obj_CanvasRenderingContext2D] getState" + JSON.stringify(pages)); - expect("pages/obj_CanvasRenderingContext2D/").assertEqual(pages.path); + expect("pages/obj_CanvasRenderingContext2D/router/").assertEqual(pages.path); done(); }); @@ -1157,7 +1157,7 @@ describe('aceJsTest', function () { it('testObjImageComponent', 0, async function (done) { let result; let options = { - uri: 'pages/obj_Image/index' + uri: 'pages/obj_Image/router/index' } try { result = router.push(options) @@ -1168,7 +1168,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.obj_Image] getState" + JSON.stringify(pages)); - expect("pages/obj_Image/").assertEqual(pages.path); + expect("pages/obj_Image/router/").assertEqual(pages.path); done(); }); @@ -1180,7 +1180,7 @@ describe('aceJsTest', function () { it('testCanvasGradientComponent', 0, async function (done) { let result; let options = { - uri: 'pages/obj_CanvasGradient/index' + uri: 'pages/obj_CanvasGradient/router/index' } try { result = router.push(options) @@ -1191,7 +1191,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.obj_CanvasGradient] getState" + JSON.stringify(pages)); - expect("pages/obj_CanvasGradient/").assertEqual(pages.path); + expect("pages/obj_CanvasGradient/router/").assertEqual(pages.path); done(); }); @@ -1203,7 +1203,7 @@ describe('aceJsTest', function () { it('testImageDataComponent', 0, async function (done) { let result; let options = { - uri: 'pages/obj_ImageData/index' + uri: 'pages/obj_ImageData/router/index' } try { result = router.push(options) @@ -1214,7 +1214,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.obj_ImageData] getState" + JSON.stringify(pages)); - expect("pages/obj_ImageData/").assertEqual(pages.path); + expect("pages/obj_ImageData/router/").assertEqual(pages.path); done(); }); @@ -1226,7 +1226,7 @@ describe('aceJsTest', function () { it('testPath2DComponent', 0, async function (done) { let result; let options = { - uri: 'pages/obj_Path2D/index' + uri: 'pages/obj_Path2D/router/index' } try { result = router.push(options) @@ -1237,7 +1237,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.obj_Path2D] getState" + JSON.stringify(pages)); - expect("pages/obj_Path2D/").assertEqual(pages.path); + expect("pages/obj_Path2D/router/").assertEqual(pages.path); done(); }); @@ -1249,7 +1249,7 @@ describe('aceJsTest', function () { it('testOffCanvasRC2DComponent', 0, async function (done) { let result; let options = { - uri: 'pages/obj_OffscreenCanvasRenderingContext2D/index' + uri: 'pages/obj_OffscreenCanvasRenderingContext2D/router/index' } try { result = router.push(options) @@ -1260,7 +1260,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.obj_OffscreenCanvasRenderingContext2D] getState" + JSON.stringify(pages)); - expect("pages/obj_OffscreenCanvasRenderingContext2D/").assertEqual(pages.path); + expect("pages/obj_OffscreenCanvasRenderingContext2D/router/").assertEqual(pages.path); done(); }); @@ -1272,7 +1272,7 @@ describe('aceJsTest', function () { it('testImageBitmapComponent', 0, async function (done) { let result; let options = { - uri: 'pages/obj_ImageBitmap/index' + uri: 'pages/obj_ImageBitmap/router/index' } try { result = router.push(options) @@ -1283,7 +1283,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.obj_ImageBitmap] getState" + JSON.stringify(pages)); - expect("pages/obj_ImageBitmap/").assertEqual(pages.path); + expect("pages/obj_ImageBitmap/router/").assertEqual(pages.path); done(); }); @@ -1295,7 +1295,7 @@ describe('aceJsTest', function () { it('testOffScreenCanvasComponent', 0, async function (done) { let result; let options = { - uri: 'pages/obj_OffscreenCanvas/index' + uri: 'pages/obj_OffscreenCanvas/router/index' } try { result = router.push(options) @@ -1306,7 +1306,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.obj_OffscreenCanvas] getState" + JSON.stringify(pages)); - expect("pages/obj_OffscreenCanvas/").assertEqual(pages.path); + expect("pages/obj_OffscreenCanvas/router/").assertEqual(pages.path); done(); }); @@ -1387,7 +1387,7 @@ describe('aceJsTest', function () { it('testEllipseComponent', 0, async function (done) { let result; let options = { - uri: 'pages/ellipse/index' + uri: 'pages/ellipse/router/index' } try { result = router.push(options) @@ -1398,7 +1398,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.ellipse] getState" + JSON.stringify(pages)); - expect("pages/ellipse/").assertEqual(pages.path); + expect("pages/ellipse/router/").assertEqual(pages.path); done(); }); @@ -1410,7 +1410,7 @@ describe('aceJsTest', function () { it('testPathComponent', 0, async function (done) { let result; let options = { - uri: 'pages/path/index' + uri: 'pages/path/router/index' } try { result = router.push(options) @@ -1421,7 +1421,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.path] getState" + JSON.stringify(pages)); - expect("pages/path/").assertEqual(pages.path); + expect("pages/path/router/").assertEqual(pages.path); done(); }); @@ -1433,7 +1433,7 @@ describe('aceJsTest', function () { it('testLineComponent', 0, async function (done) { let result; let options = { - uri: 'pages/line/index' + uri: 'pages/line/router/index' } try { result = router.push(options) @@ -1444,7 +1444,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.line] getState" + JSON.stringify(pages)); - expect("pages/line/").assertEqual(pages.path); + expect("pages/line/router/").assertEqual(pages.path); done(); }); @@ -1456,7 +1456,7 @@ describe('aceJsTest', function () { it('testPolyLineComponent', 0, async function (done) { let result; let options = { - uri: 'pages/polyline/index' + uri: 'pages/polyline/router/index' } try { result = router.push(options) @@ -1467,7 +1467,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.polyline] getState" + JSON.stringify(pages)); - expect("pages/polyline/").assertEqual(pages.path); + expect("pages/polyline/router/").assertEqual(pages.path); done(); }); @@ -1479,7 +1479,7 @@ describe('aceJsTest', function () { it('testPolygonComponent', 0, async function (done) { let result; let options = { - uri: 'pages/polygon/index' + uri: 'pages/polygon/router/index' } try { result = router.push(options) @@ -1490,7 +1490,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.polygon] getState" + JSON.stringify(pages)); - expect("pages/polygon/").assertEqual(pages.path); + expect("pages/polygon/router/").assertEqual(pages.path); done(); }); @@ -1502,7 +1502,7 @@ describe('aceJsTest', function () { it('testAnimateComponent', 0, async function (done) { let result; let options = { - uri: 'pages/animate/index' + uri: 'pages/animate/router/index' } try { result = router.push(options) @@ -1513,7 +1513,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.animate] getState" + JSON.stringify(pages)); - expect("pages/animate/").assertEqual(pages.path); + expect("pages/animate/router/").assertEqual(pages.path); done(); }); @@ -1525,7 +1525,7 @@ describe('aceJsTest', function () { it('testAnimateMotionComponent', 0, async function (done) { let result; let options = { - uri: 'pages/animateMotion/index' + uri: 'pages/animateMotion/router/index' } try { result = router.push(options) @@ -1536,7 +1536,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.animateMotion] getState" + JSON.stringify(pages)); - expect("pages/animateMotion/").assertEqual(pages.path); + expect("pages/animateMotion/router/").assertEqual(pages.path); done(); }); @@ -1548,7 +1548,7 @@ describe('aceJsTest', function () { it('testAnimateTransformComponent', 0, async function (done) { let result; let options = { - uri: 'pages/animateTransform/index' + uri: 'pages/animateTransform/router/index' } try { result = router.push(options) @@ -1559,7 +1559,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.animateTransform] getState" + JSON.stringify(pages)); - expect("pages/animateTransform/").assertEqual(pages.path); + expect("pages/animateTransform/router/").assertEqual(pages.path); done(); }); @@ -1571,7 +1571,7 @@ describe('aceJsTest', function () { it('testTextPathComponent', 0, async function (done) { let result; let options = { - uri: 'pages/textPath/index' + uri: 'pages/textPath/router/index' } try { result = router.push(options) @@ -1582,7 +1582,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.textPath] getState" + JSON.stringify(pages)); - expect("pages/textPath/").assertEqual(pages.path); + expect("pages/textPath/router/").assertEqual(pages.path); done(); }); @@ -1594,7 +1594,7 @@ describe('aceJsTest', function () { it('testTspanComponent', 0, async function (done) { let result; let options = { - uri: 'pages/tspan/index' + uri: 'pages/tspan/router/index' } try { result = router.push(options) @@ -1605,7 +1605,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.tspan] getState" + JSON.stringify(pages)); - expect("pages/tspan/").assertEqual(pages.path); + expect("pages/tspan/router/").assertEqual(pages.path); done(); }); }); diff --git a/ace/ace_standard/src/main/js/default/test/ellipseProps.test.js b/ace/ace_standard/src/main/js/default/test/ellipseProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..dbab4228041bde5e9510ceac3802cfbd8e3f91c6 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/ellipseProps.test.js @@ -0,0 +1,1106 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + import router from '@system.router'; + import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + + describe('ellipsePropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[ellipsePropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/ellipse/prop/index' + } + try { + result = router.push(options) + console.info("push ellipseProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push ellipseProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[ellipsePropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseFillProp + * @tc.desc ACE + */ + it('testEllipseFillProp', 0, async function (done) { + console.info('testEllipseFillProp START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillProp); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillProp') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('60') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[ellipseProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseFillOpacityPropOne + * @tc.desc ACE + */ + it('testEllipseFillOpacityPropOne', 0, async function (done) { + console.info('testEllipseFillOpacityPropOne START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropOne); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropOne') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[ellipseProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('0.5') + console.info("[ellipseProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseFillOpacityPropTwo + * @tc.desc ACE + */ + it('testEllipseFillOpacityPropTwo', 0, async function (done) { + console.info('testEllipseFillOpacityPropTwo START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropTwo); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropTwo') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[ellipseProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('1') + console.info("[ellipseProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseFillOpacityPropThree + * @tc.desc ACE + */ + it('testEllipseFillOpacityPropThree', 0, async function (done) { + console.info('testEllipseFillOpacityPropThree START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropThree); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropThree') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[ellipseProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('1.5') + console.info("[ellipseProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseFillRulePropOne + * @tc.desc ACE + */ + it('testEllipseFillRulePropOne', 0, async function (done) { + console.info('testEllipseFillRulePropOne START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillRulePropOne); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillRulePropOne') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[ellipseProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillRule).assertEqual('evenodd') + console.info("[ellipseProps] get inspector fill-rule value is: " + JSON.stringify(obj.$attrs.fillRule)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseFillRulePropTwo + * @tc.desc ACE + */ + it('testEllipseFillRulePropTwo', 0, async function (done) { + console.info('testEllipseFillRulePropTwo START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillRulePropTwo); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillRulePropTwo') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[ellipseProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillRule).assertEqual('nonzero') + console.info("[ellipseProps] get inspector fill-rule value is: " + JSON.stringify(obj.$attrs.fillRule)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseOpacityPropOne + * @tc.desc ACE + */ + it('testEllipseOpacityPropOne', 0, async function (done) { + console.info('testEllipseOpacityPropOne START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropOne); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropOne') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.opacity).assertEqual('0.5') + console.info("[ellipseProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseOpacityPropTwo + * @tc.desc ACE + */ + it('testEllipseOpacityPropTwo', 0, async function (done) { + console.info('testEllipseOpacityPropTwo START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropTwo); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropTwo') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.opacity).assertEqual('1') + console.info("[ellipseProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseOpacityPropThree + * @tc.desc ACE + */ + it('testEllipseOpacityPropThree', 0, async function (done) { + console.info('testEllipseOpacityPropThree START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropThree); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropThree') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.opacity).assertEqual('1.5') + console.info("[ellipseProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeProp + * @tc.desc ACE + */ + it('testEllipseStrokeProp', 0, async function (done) { + console.info('testEllipseStrokeProp START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeProp); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeProp') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('60') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeDashArrayProp + * @tc.desc ACE + */ + it('testEllipseStrokeDashArrayProp', 0, async function (done) { + console.info('testEllipseStrokeDashArrayProp START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeDashArrayProp); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeDashArrayProp') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('60') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeDasharray).assertEqual('2 3') + console.info("[ellipseProps] get inspector dasharray value is: " + JSON.stringify(obj.$attrs.strokeDasharray)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeDashOffsetProp + * @tc.desc ACE + */ + it('testEllipseStrokeDashOffsetProp', 0, async function (done) { + console.info('testEllipseStrokeDashOffsetProp START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeDashOffsetProp); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeDashOffsetProp') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('60') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeDashoffset).assertEqual('23') + console.info("[ellipseProps] get inspector dashoffset value is: " + JSON.stringify(obj.$attrs.strokeDashoffset)); + done(); + }); + + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeLineJoinPropOne + * @tc.desc ACE + */ + it('testEllipseStrokeLineJoinPropOne', 0, async function (done) { + console.info('testEllipseStrokeLineJoinPropOne START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropOne); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropOne') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('bevel') + console.info("[ellipseProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeLineJoinPropTwo + * @tc.desc ACE + */ + it('testEllipseStrokeLineJoinPropTwo', 0, async function (done) { + console.info('testEllipseStrokeLineJoinPropTwo START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropTwo); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropTwo') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('miter') + console.info("[ellipseProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeLineJoinPropThree + * @tc.desc ACE + */ + it('testEllipseStrokeLineJoinPropThree', 0, async function (done) { + console.info('testEllipseStrokeLineJoinPropThree START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropThree); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropThree') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('round') + console.info("[ellipseProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeLineJoinPropOne + * @tc.desc ACE + */ + it('testEllipseStrokeLineCapPropOne', 0, async function (done) { + console.info('testEllipseStrokeLineCapPropOne START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropOne); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropOne') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('butt') + console.info("[ellipseProps] get inspector lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeLineCapPropTwo + * @tc.desc ACE + */ + it('testEllipseStrokeLineCapPropTwo', 0, async function (done) { + console.info('testEllipseStrokeLineCapPropTwo START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropTwo); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropTwo') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('round') + console.info("[ellipseProps] get inspector lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeLineCapPropThree + * @tc.desc ACE + */ + it('testEllipseStrokeLineCapPropThree', 0, async function (done) { + console.info('testEllipseStrokeLineCapPropThree START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropThree); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropThree') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('square') + console.info("[ellipseProps] get inspector lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeMiterLimitProp + * @tc.desc ACE + */ + it('testEllipseStrokeMiterLimitProp', 0, async function (done) { + console.info('testEllipseStrokeMiterLimitProp START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeMiterLimitProp); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeMiterLimitProp') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('60') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeMiterlimit).assertEqual('10') + console.info("[ellipseProps] get inspector miterlimit value is: " + JSON.stringify(obj.$attrs.strokeMiterlimit)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeOpacityPropOne + * @tc.desc ACE + */ + it('testEllipseStrokeOpacityPropOne', 0, async function (done) { + console.info('testEllipseStrokeOpacityPropOne START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropOne); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropOne') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('0.5') + console.info("[ellipseProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeOpacityPropTwo + * @tc.desc ACE + */ + it('testEllipseStrokeOpacityPropTwo', 0, async function (done) { + console.info('testEllipseStrokeOpacityPropTwo START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropTwo); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropTwo') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('1') + console.info("[ellipseProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeOpacityPropThree + * @tc.desc ACE + */ + it('testEllipseStrokeOpacityPropThree', 0, async function (done) { + console.info('testEllipseStrokeOpacityPropThree START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropThree); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropThree') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('1.5') + console.info("[ellipseProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseStrokeWidthProp + * @tc.desc ACE + */ + it('testEllipseStrokeWidthProp', 0, async function (done) { + console.info('testEllipseStrokeWidthProp START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeWidthProp); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeWidthProp') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('60') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeWidth).assertEqual('6') + console.info("[ellipseProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseTransformProp + * @tc.desc ACE + */ + it('testEllipseTransformProp', 0, async function (done) { + console.info('testEllipseTransformProp START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.transformProp); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('transformProp') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('11') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.transform).assertEqual('translate(10,5)scale(0.5 1.3)rotate(20 40 90)skewX(10)skewY(-15)') + console.info("[ellipseProps] get inspector transform value is: " + JSON.stringify(obj.$attrs.transform)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseIdProp + * @tc.desc ACE + */ + it('testEllipseIdProp', 0, async function (done) { + console.info('testEllipseIdProp START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('idProp') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('20') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseCxPropOne + * @tc.desc ACE + */ + it('testEllipseCxPropOne', 0, async function (done) { + console.info('testEllipseCxPropOne START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.cxPropOne); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('cxPropOne') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('20') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[ellipseProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseCxPropTwo + * @tc.desc ACE + */ + it('testEllipseCxPropTwo', 0, async function (done) { + console.info('testEllipseCxPropTwo START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.cxPropTwo); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('cxPropTwo') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('50%') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('20') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.fill).assertEqual('pink') + console.info("[ellipseProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseCyPropOne + * @tc.desc ACE + */ + it('testEllipseCyPropOne', 0, async function (done) { + console.info('testEllipseCyPropOne START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.cyPropOne); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('cyPropOne') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('20') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[ellipseProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseCyPropTwo + * @tc.desc ACE + */ + it('testEllipseCyPropTwo', 0, async function (done) { + console.info('testEllipseCyPropTwo START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.cyPropTwo); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('cyPropTwo') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('80') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('50%') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.fill).assertEqual('pink') + console.info("[ellipseProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseRxPropOne + * @tc.desc ACE + */ + it('testEllipseRxPropOne', 0, async function (done) { + console.info('testEllipseRxPropOne START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.rxPropOne); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('rxPropOne') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('20') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseRxPropTwo + * @tc.desc ACE + */ + it('testEllipseRxPropTwo', 0, async function (done) { + console.info('testEllipseRxPropTwo START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.rxPropTwo); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('rxPropTwo') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('100') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('20') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25%') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('pink') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseRyPropOne + * @tc.desc ACE + */ + it('testEllipseRyPropOne', 0, async function (done) { + console.info('testEllipseRyPropOne START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ryPropOne); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('ryPropOne') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('25') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('20') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testEllipseRyPropTwo + * @tc.desc ACE + */ + it('testEllipseRyPropTwo', 0, async function (done) { + console.info('testEllipseRyPropTwo START'); + console.info("[ellipseProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ryPropTwo); + console.info("[ellipseProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[ellipseProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('ellipse') + console.info("[ellipseProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('ryPropTwo') + console.info("[ellipseProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.cx).assertEqual('100') + console.info("[ellipseProps] get inspector cx value is: " + JSON.stringify(obj.$attrs.cx)); + expect(obj.$attrs.cy).assertEqual('20') + console.info("[ellipseProps] get inspector cy value is: " + JSON.stringify(obj.$attrs.cy)); + expect(obj.$attrs.rx).assertEqual('25') + console.info("[ellipseProps] get inspector rx value is: " + JSON.stringify(obj.$attrs.rx)); + expect(obj.$attrs.ry).assertEqual('10%') + console.info("[ellipseProps] get inspector ry value is: " + JSON.stringify(obj.$attrs.ry)); + expect(obj.$attrs.stroke).assertEqual('pink') + console.info("[ellipseProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + }); + \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/test/gridColProps.test.js b/ace/ace_standard/src/main/js/default/test/gridColProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..1cc01ce559b032b18daeeb5da483bb415061a40a --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/gridColProps.test.js @@ -0,0 +1,944 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('gridColPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[gridColPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/gridCol/prop/index' + } + try { + result = router.push(options) + console.info("push gridColProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push gridColProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[gridColPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColIdProp + * @tc.desc ACE + */ + it('testgridColIdProp', 0, async function (done) { + console.info('testgridColIdProp START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColClassProp + * @tc.desc ACE + */ + it('testgridColClassProp', 0, async function (done) { + console.info('testgridColClassProp START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColClassPropNone + * @tc.desc ACE + */ + it('testgridColClassPropNone', 0, async function (done) { + console.info('testgridColClassPropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[gridColProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColRefProp + * @tc.desc ACE + */ + it('testgridColRefProp', 0, async function (done) { + console.info('testgridColRefProp START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColRefPropNone + * @tc.desc ACE + */ + it('testgridColRefPropNone', 0, async function (done) { + console.info('testgridColRefPropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("[gridColProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColDisabledPropTrue + * @tc.desc ACE + */ + it('testgridColDisabledPropTrue', 0, async function (done) { + console.info('testgridColDisabledPropTrue START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColDisabledPropFalse + * @tc.desc ACE + */ + it('testgridColDisabledPropFalse', 0, async function (done) { + console.info('testgridColDisabledPropFalse START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColDisabledPropNone + * @tc.desc ACE + */ + it('testgridColDisabledPropNone', 0, async function (done) { + console.info('testgridColDisabledPropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColFocusablePropTrue + * @tc.desc ACE + */ + it('testgridColFocusablePropTrue', 0, async function (done) { + console.info('testgridColFocusablePropTrue START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColFocusablePropFalse + * @tc.desc ACE + */ + it('testgridColFocusablePropFalse', 0, async function (done) { + console.info('testgridColFocusablePropFalse START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColFocusablePropNone + * @tc.desc ACE + */ + it('testgridColFocusablePropNone', 0, async function (done) { + console.info('testgridColFocusablePropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColDataProp + * @tc.desc ACE + */ + it('testgridColDataProp', 0, async function (done) { + console.info('testgridColDataProp START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.datagridCol).assertEqual(undefined); + console.info("[gridColProps] get datagridCol value is: " + JSON.stringify(obj.$attrs.datagridCol)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColDataPropNone + * @tc.desc ACE + */ + it('testgridColDataPropNone', 0, async function (done) { + console.info('testgridColDataPropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.datagridCol).assertEqual(undefined) + console.info("[gridColProps] get datagridCol value is: " + JSON.stringify(obj.$attrs.datagridCol)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColClickEffectPropSmall + * @tc.desc ACE + */ + it('testgridColClickEffectPropSmall', 0, async function (done) { + console.info('testgridColClickEffectPropSmall START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColClickEffectPropMedium + * @tc.desc ACE + */ + it('testgridColClickEffectPropMedium', 0, async function (done) { + console.info('testgridColClickEffectPropMedium START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColClickEffectPropLarge + * @tc.desc ACE + */ + it('testgridColClickEffectPropLarge', 0, async function (done) { + console.info('testgridColClickEffectPropLarge START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColClickEffectPropNone + * @tc.desc ACE + */ + it('testgridColClickEffectPropNone', 0, async function (done) { + console.info('testgridColClickEffectPropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("[gridColProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColDirPropRtl + * @tc.desc ACE + */ + it('testgridColDirPropRtl', 0, async function (done) { + console.info('testgridColDirPropRtl START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColDirPropLtr + * @tc.desc ACE + */ + it('testgridColDirPropLtr', 0, async function (done) { + console.info('testgridColDirPropLtr START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColDirPropAuto + * @tc.desc ACE + */ + it('testgridColDirPropAuto', 0, async function (done) { + console.info('testgridColDirPropAuto START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColDirPropNone + * @tc.desc ACE + */ + it('testgridColDirPropNone', 0, async function (done) { + console.info('testgridColDirPropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColForPropNull + * @tc.desc ACE + */ + it('testgridColForPropNull', 0, async function (done) { + console.info('testgridColForPropNull START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[gridColProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColForPropOne + * @tc.desc ACE + */ + it('testgridColForPropOne', 0, async function (done) { + console.info('testgridColForPropOne START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[gridColProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColForPropThree + * @tc.desc ACE + */ + it('testgridColForPropThree', 0, async function (done) { + console.info('testgridColForPropThree START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[gridColProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColIfPropTrue + * @tc.desc ACE + */ + it('testgridColIfPropTrue', 0, async function (done) { + console.info('testgridColIfPropTrue START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("[gridColProps] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropTrue + * @tc.desc ACE + */ + it('testgridColShowPropTrue', 0, async function (done) { + console.info('testgridColShowPropTrue START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("[gridColProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropFalse + * @tc.desc ACE + */ + it('testgridColShowPropFalse', 0, async function (done) { + console.info('testgridColShowPropFalse START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("[gridColProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColShowPropNone', 0, async function (done) { + console.info('testgridColShowPropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual("true") + console.info("[gridColProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColXsPropNone', 0, async function (done) { + console.info('testgridColXsPropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeXsNull); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeXsNull') + expect(obj.$attrs.xs).assertEqual(undefined) + console.info("[gridColProps] get xs value is: " + JSON.stringify(obj.$attrs.xs)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColXsProp1', 0, async function (done) { + console.info('testgridColXsProp1 START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeXs1); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeXs1') + expect(obj.$attrs.xs).assertEqual('1') + console.info("[gridColProps] get xs value is: " + JSON.stringify(obj.$attrs.xs)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColXsPropObject', 0, async function (done) { + console.info('testgridColXsPropObject START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeLgObject); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeLgObject') + expect(obj.$attrs.xs).assertEqual(undefined) + console.info("[gridColProps] get xs value is: " + JSON.stringify(obj.$attrs.xs)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColSmPropNone', 0, async function (done) { + console.info('testgridColSmPropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeSmNull); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeSmNull') + expect(obj.$attrs.sm).assertEqual(undefined) + console.info("[gridColProps] get sm value is: " + JSON.stringify(obj.$attrs.sm)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColSmProp1', 0, async function (done) { + console.info('testgridColSmProp1 START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeSm1); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeSm1') + expect(obj.$attrs.sm).assertEqual("1") + console.info("[gridColProps] get sm value is: " + JSON.stringify(obj.$attrs.sm)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColSmObject', 0, async function (done) { + console.info('testgridColSmProp1 START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeSmObject); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeSmObject') + expect(obj.$attrs.Sm).assertEqual(undefined) + console.info("[gridColProps] get Sm value is: " + JSON.stringify(obj.$attrs.sm)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColMdPropNone', 0, async function (done) { + console.info('testgridColSmPropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeMdNull); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeMdNull') + expect(obj.$attrs.md).assertEqual(undefined) + console.info("[gridColProps] get md value is: " + JSON.stringify(obj.$attrs.md)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColMdProp1', 0, async function (done) { + console.info('testgridColSmProp1 START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeMd1); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeMd1') + expect(obj.$attrs.md).assertEqual("1") + console.info("[gridColProps] get md value is: " + JSON.stringify(obj.$attrs.md)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColMdObject', 0, async function (done) { + console.info('testgridColSmProp1 START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeMdObject); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeMdObject') + expect(obj.$attrs.md).assertEqual(undefined) + console.info("[gridColProps] get md value is: " + JSON.stringify(obj.$attrs.md)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColLgPropNone', 0, async function (done) { + console.info('testgridColSmPropNone START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeLgNull); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeLgNull') + expect(obj.$attrs.lg).assertEqual(undefined) + console.info("[gridColProps] get lg value is: " + JSON.stringify(obj.$attrs.lg)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColLgProp1', 0, async function (done) { + console.info('testgridColSmProp1 START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeLg1); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeLg1') + expect(obj.$attrs.lg).assertEqual("1") + console.info("[gridColProps] get lg value is: " + JSON.stringify(obj.$attrs.lg)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColLgObject', 0, async function (done) { + console.info('testgridColSmProp1 START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeLgObject); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeLgObject') + expect(obj.$attrs.lg).assertEqual(undefined) + console.info("[gridColProps] get lg value is: " + JSON.stringify(obj.$attrs.lg)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColSpanProp1', 0, async function (done) { + console.info('testgridColSmProp1 START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeSpan1); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeSpan1') + expect(obj.$attrs.span).assertEqual("1") + console.info("[gridColProps] get span value is: " + JSON.stringify(obj.$attrs.span)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColSpanProp3', 0, async function (done) { + console.info('testgridColSmProp1 START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeSpan3); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeSpan3') + expect(obj.$attrs.span).assertEqual("3") + console.info("[gridColProps] get span value is: " + JSON.stringify(obj.$attrs.span)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColOffsetProp1', 0, async function (done) { + console.info('testgridColSmProp1 START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeOffset1); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeOffset1') + expect(obj.$attrs.offset).assertEqual("1") + console.info("[gridColProps] get offset value is: " + JSON.stringify(obj.$attrs.offset)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridColShowPropNone + * @tc.desc ACE + */ + it('testgridColOffsetProp3', 0, async function (done) { + console.info('testgridColSmProp1 START'); + console.info("[gridColProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeOffset3); + console.info("[gridColProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridColProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-col') + expect(obj.$attrs.id).assertEqual('typeOffset3') + expect(obj.$attrs.offset).assertEqual("3") + console.info("[gridColProps] get offset value is: " + JSON.stringify(obj.$attrs.offset)); + done(); + }); + +}); diff --git a/ace/ace_standard/src/main/js/default/test/gridRowProps.test.js b/ace/ace_standard/src/main/js/default/test/gridRowProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..cd201e1cf071daa28248fb3af8a6f0dbe28bc94c --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/gridRowProps.test.js @@ -0,0 +1,625 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('gridRowPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[gridRowPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/gridRow/prop/index' + } + try { + result = router.push(options) + console.info("push gridRowProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push gridRowProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[gridRowPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowIdProp + * @tc.desc ACE + */ + it('testgridRowIdProp', 0, async function (done) { + console.info('testgridRowIdProp START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowClassProp + * @tc.desc ACE + */ + it('testgridRowClassProp', 0, async function (done) { + console.info('testgridRowClassProp START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowClassPropNone + * @tc.desc ACE + */ + it('testgridRowClassPropNone', 0, async function (done) { + console.info('testgridRowClassPropNone START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[gridRowProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowRefProp + * @tc.desc ACE + */ + it('testgridRowRefProp', 0, async function (done) { + console.info('testgridRowRefProp START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowRefPropNone + * @tc.desc ACE + */ + it('testgridRowRefPropNone', 0, async function (done) { + console.info('testgridRowRefPropNone START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("[gridRowProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowDisabledPropTrue + * @tc.desc ACE + */ + it('testgridRowDisabledPropTrue', 0, async function (done) { + console.info('testgridRowDisabledPropTrue START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowDisabledPropFalse + * @tc.desc ACE + */ + it('testgridRowDisabledPropFalse', 0, async function (done) { + console.info('testgridRowDisabledPropFalse START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowDisabledPropNone + * @tc.desc ACE + */ + it('testgridRowDisabledPropNone', 0, async function (done) { + console.info('testgridRowDisabledPropNone START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowFocusablePropTrue + * @tc.desc ACE + */ + it('testgridRowFocusablePropTrue', 0, async function (done) { + console.info('testgridRowFocusablePropTrue START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowFocusablePropFalse + * @tc.desc ACE + */ + it('testgridRowFocusablePropFalse', 0, async function (done) { + console.info('testgridRowFocusablePropFalse START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowFocusablePropNone + * @tc.desc ACE + */ + it('testgridRowFocusablePropNone', 0, async function (done) { + console.info('testgridRowFocusablePropNone START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowDataProp + * @tc.desc ACE + */ + it('testgridRowDataProp', 0, async function (done) { + console.info('testgridRowDataProp START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.datagridRow).assertEqual(undefined); + console.info("[gridRowProps] get datagridRow value is: " + JSON.stringify(obj.$attrs.datagridRow)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowDataPropNone + * @tc.desc ACE + */ + it('testgridRowDataPropNone', 0, async function (done) { + console.info('testgridRowDataPropNone START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.datagridRow).assertEqual(undefined) + console.info("[gridRowProps] get datagridRow value is: " + JSON.stringify(obj.$attrs.datagridRow)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowClickEffectPropSmall + * @tc.desc ACE + */ + it('testgridRowClickEffectPropSmall', 0, async function (done) { + console.info('testgridRowClickEffectPropSmall START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowClickEffectPropMedium + * @tc.desc ACE + */ + it('testgridRowClickEffectPropMedium', 0, async function (done) { + console.info('testgridRowClickEffectPropMedium START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowClickEffectPropLarge + * @tc.desc ACE + */ + it('testgridRowClickEffectPropLarge', 0, async function (done) { + console.info('testgridRowClickEffectPropLarge START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowClickEffectPropNone + * @tc.desc ACE + */ + it('testgridRowClickEffectPropNone', 0, async function (done) { + console.info('testgridRowClickEffectPropNone START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("[gridRowProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowDirPropRtl + * @tc.desc ACE + */ + it('testgridRowDirPropRtl', 0, async function (done) { + console.info('testgridRowDirPropRtl START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowDirPropLtr + * @tc.desc ACE + */ + it('testgridRowDirPropLtr', 0, async function (done) { + console.info('testgridRowDirPropLtr START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowDirPropAuto + * @tc.desc ACE + */ + it('testgridRowDirPropAuto', 0, async function (done) { + console.info('testgridRowDirPropAuto START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowDirPropNone + * @tc.desc ACE + */ + it('testgridRowDirPropNone', 0, async function (done) { + console.info('testgridRowDirPropNone START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowForPropNull + * @tc.desc ACE + */ + it('testgridRowForPropNull', 0, async function (done) { + console.info('testgridRowForPropNull START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[gridRowProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowForPropOne + * @tc.desc ACE + */ + it('testgridRowForPropOne', 0, async function (done) { + console.info('testgridRowForPropOne START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[gridRowProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowForPropThree + * @tc.desc ACE + */ + it('testgridRowForPropThree', 0, async function (done) { + console.info('testgridRowForPropThree START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[gridRowProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowIfPropTrue + * @tc.desc ACE + */ + it('testgridRowIfPropTrue', 0, async function (done) { + console.info('testgridRowIfPropTrue START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("[gridRowProps] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowShowPropTrue + * @tc.desc ACE + */ + it('testgridRowShowPropTrue', 0, async function (done) { + console.info('testgridRowShowPropTrue START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("[gridRowProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowShowPropFalse + * @tc.desc ACE + */ + it('testgridRowShowPropFalse', 0, async function (done) { + console.info('testgridRowShowPropFalse START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("[gridRowProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testgridRowShowPropNone + * @tc.desc ACE + */ + it('testgridRowShowPropNone', 0, async function (done) { + console.info('testgridRowShowPropNone START'); + console.info("[gridRowProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("[gridRowProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[gridRowProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('grid-row') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual("true") + console.info("[gridRowProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + +}); diff --git a/ace/ace_standard/src/main/js/default/test/lineProps.test.js b/ace/ace_standard/src/main/js/default/test/lineProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..46c4eee554804130b71f8c864a544db619659276 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/lineProps.test.js @@ -0,0 +1,820 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + import router from '@system.router'; + import { describe, beforeAll, afterAll, it, expect } from 'deccjsunit/index'; + + + describe('linePropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[linePropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/line/prop/index' + } + try { + result = router.push(options) + console.info("push lineProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push lineProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[linePropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineOpacityPropOne + * @tc.desc ACE + */ + it('testLineOpacityPropOne', 0, async function (done) { + console.info('testLineOpacityPropOne START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropOne); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropOne') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.opacity).assertEqual('0.5') + console.info("[lineProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineOpacityPropTwo + * @tc.desc ACE + */ + it('testLineOpacityPropTwo', 0, async function (done) { + console.info('testLineOpacityPropTwo START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropTwo); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropTwo') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.opacity).assertEqual('1') + console.info("[lineProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineOpacityPropThree + * @tc.desc ACE + */ + it('testLineOpacityPropThree', 0, async function (done) { + console.info('testLineOpacityPropThree START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropThree); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropThree') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.opacity).assertEqual('1.5') + console.info("[lineProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeProp + * @tc.desc ACE + */ + it('testLineStrokeProp', 0, async function (done) { + console.info('testLineStrokeProp START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeProp); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeProp') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeDashArrayProp + * @tc.desc ACE + */ + it('testLineStrokeDashArrayProp', 0, async function (done) { + console.info('testLineStrokeDashArrayProp START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeDashArrayProp); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeDashArrayProp') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeDasharray).assertEqual('2 3') + console.info("[lineProps] get inspector stroke-dasharray value is: " + JSON.stringify(obj.$attrs.strokeDasharray)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeDashOffsetProp + * @tc.desc ACE + */ + it('testLineStrokeDashOffsetProp', 0, async function (done) { + console.info('testLineStrokeDashOffsetProp START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeDashOffsetProp); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeDashOffsetProp') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeDashoffset).assertEqual('23') + console.info("[lineProps] get inspector stroke-dashoffset value is: " + JSON.stringify(obj.$attrs.strokeDashoffset)); + done(); + }); + + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeLineJoinPropOne + * @tc.desc ACE + */ + it('testLineStrokeLineJoinPropOne', 0, async function (done) { + console.info('testLineStrokeLineJoinPropOne START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropOne); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropOne') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('bevel') + console.info("[lineProps] get inspector stroke-linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeLineJoinPropTwo + * @tc.desc ACE + */ + it('testLineStrokeLineJoinPropTwo', 0, async function (done) { + console.info('testLineStrokeLineJoinPropTwo START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropTwo); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropTwo') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('miter') + console.info("[lineProps] get inspector stroke-linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeLineJoinPropThree + * @tc.desc ACE + */ + it('testLineStrokeLineJoinPropThree', 0, async function (done) { + console.info('testLineStrokeLineJoinPropThree START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropThree); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropThree') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('round') + console.info("[lineProps] get inspector stroke-linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeLineJoinPropOne + * @tc.desc ACE + */ + it('testLineStrokeLineCapPropOne', 0, async function (done) { + console.info('testLineStrokeLineCapPropOne START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropOne); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropOne') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('butt') + console.info("[lineProps] get inspector stroke-lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeLineCapPropTwo + * @tc.desc ACE + */ + it('testLineStrokeLineCapPropTwo', 0, async function (done) { + console.info('testLineStrokeLineCapPropTwo START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropTwo); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropTwo') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('round') + console.info("[lineProps] get inspector stroke-lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeLineCapPropThree + * @tc.desc ACE + */ + it('testLineStrokeLineCapPropThree', 0, async function (done) { + console.info('testLineStrokeLineCapPropThree START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropThree); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropThree') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('square') + console.info("[lineProps] get inspector stroke-lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeMiterLimitProp + * @tc.desc ACE + */ + it('testLineStrokeMiterLimitProp', 0, async function (done) { + console.info('testLineStrokeMiterLimitProp START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeMiterLimitProp); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeMiterLimitProp') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeMiterlimit).assertEqual('10') + console.info("[lineProps] get inspector stroke-miterlimit value is: " + JSON.stringify(obj.$attrs.strokeMiterlimit)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeOpacityPropOne + * @tc.desc ACE + */ + it('testLineStrokeOpacityPropOne', 0, async function (done) { + console.info('testLineStrokeOpacityPropOne START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropOne); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropOne') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('0.5') + console.info("[lineProps] get inspector stroke-opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeOpacityPropTwo + * @tc.desc ACE + */ + it('testLineStrokeOpacityPropTwo', 0, async function (done) { + console.info('testLineStrokeOpacityPropTwo START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropTwo); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropTwo') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('1') + console.info("[lineProps] get inspector stroke-opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeOpacityPropThree + * @tc.desc ACE + */ + it('testLineStrokeOpacityPropThree', 0, async function (done) { + console.info('testLineStrokeOpacityPropThree START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropThree); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropThree') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('1.5') + console.info("[lineProps] get inspector stroke-opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineStrokeWidthProp + * @tc.desc ACE + */ + it('testLineStrokeWidthProp', 0, async function (done) { + console.info('testLineStrokeWidthProp START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeWidthProp); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeWidthProp') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeWidth).assertEqual('6') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineTransformProp + * @tc.desc ACE + */ + it('testLineTransformProp', 0, async function (done) { + console.info('testLineTransformProp START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.transformProp); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('transformProp') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('50') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('50') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.transform).assertEqual('translate(10,5) scale(0.5 1.3) rotate(20 40 90) skewX(10) skewY(-15)') + console.info("[lineProps] get inspector transform value is: " + JSON.stringify(obj.$attrs.transform)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineIdProp + * @tc.desc ACE + */ + it('testLineIdProp', 0, async function (done) { + console.info('testLineIdProp START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('idProp') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.x2).assertEqual('50') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineX1Prop + * @tc.desc ACE + */ + it('testLineX1Prop', 0, async function (done) { + console.info('testLineX1Prop START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.x1Prop); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('x1Prop') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x1).assertEqual('10') + console.info("[lineProps] get inspector x1 value is: " + JSON.stringify(obj.$attrs.x1)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineX2Prop + * @tc.desc ACE + */ + it('testLineX1Prop', 0, async function (done) { + console.info('testLineX1Prop START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.x2Prop); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('x2Prop') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.x2).assertEqual('100') + console.info("[lineProps] get inspector x2 value is: " + JSON.stringify(obj.$attrs.x2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineY1Prop + * @tc.desc ACE + */ + it('testLineY1Prop', 0, async function (done) { + console.info('testLineY1Prop START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.y1Prop); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('y1Prop') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.y1).assertEqual('10') + console.info("[lineProps] get inspector y1 value is: " + JSON.stringify(obj.$attrs.y1)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testLineY2Prop + * @tc.desc ACE + */ + it('testLineY2Prop', 0, async function (done) { + console.info('testLineY2Prop START'); + console.info("[lineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.y2Prop); + console.info("[lineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[lineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('line') + console.info("[lineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('y2Prop') + console.info("[lineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.y2).assertEqual('10') + console.info("[lineProps] get inspector y2 value is: " + JSON.stringify(obj.$attrs.y2)); + expect(obj.$attrs.strokeWidth).assertEqual('4') + console.info("[lineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[lineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + }); + \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/test/pathProps.test.js b/ace/ace_standard/src/main/js/default/test/pathProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..844ff2bcc264630de0575ccbbe45c690be84cd57 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/pathProps.test.js @@ -0,0 +1,744 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + import router from '@system.router'; + import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + + describe('pathPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[pathPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/path/prop/index' + } + try { + result = router.push(options) + console.info("push pathProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push pathProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[pathPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathFillProp + * @tc.desc ACE + */ + it('testPathFillProp', 0, async function (done) { + console.info('testPathFillProp START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillProp); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillProp') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[pathProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathFillOpacityPropOne + * @tc.desc ACE + */ + it('testPathFillOpacityPropOne', 0, async function (done) { + console.info('testPathFillOpacityPropOne START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropOne); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropOne') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[pathProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('0.5') + console.info("[pathProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathFillOpacityPropTwo + * @tc.desc ACE + */ + it('testPathFillOpacityPropTwo', 0, async function (done) { + console.info('testPathFillOpacityPropTwo START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropTwo); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropTwo') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[pathProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('1') + console.info("[pathProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathFillOpacityPropThree + * @tc.desc ACE + */ + it('testPathFillOpacityPropThree', 0, async function (done) { + console.info('testPathFillOpacityPropThree START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropThree); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropThree') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[pathProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('1.5') + console.info("[pathProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathFillRulePropOne + * @tc.desc ACE + */ + it('testPathFillRulePropOne', 0, async function (done) { + console.info('testPathFillRulePropOne START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillRulePropOne); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillRulePropOne') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[pathProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillRule).assertEqual('evenodd') + console.info("[pathProps] get inspector fill-rule value is: " + JSON.stringify(obj.$attrs.fillRule)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathFillRulePropTwo + * @tc.desc ACE + */ + it('testPathFillRulePropTwo', 0, async function (done) { + console.info('testPathFillRulePropTwo START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillRulePropTwo); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillRulePropTwo') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[pathProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillRule).assertEqual('nonzero') + console.info("[pathProps] get inspector fill-rule value is: " + JSON.stringify(obj.$attrs.fillRule)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathOpacityPropOne + * @tc.desc ACE + */ + it('testPathOpacityPropOne', 0, async function (done) { + console.info('testPathOpacityPropOne START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropOne); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropOne') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[pathProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.opacity).assertEqual('0.5') + console.info("[pathProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathOpacityPropTwo + * @tc.desc ACE + */ + it('testPathOpacityPropTwo', 0, async function (done) { + console.info('testPathOpacityPropTwo START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropTwo); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropTwo') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[pathProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.opacity).assertEqual('1') + console.info("[pathProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathOpacityPropThree + * @tc.desc ACE + */ + it('testPathOpacityPropThree', 0, async function (done) { + console.info('testPathOpacityPropThree START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropThree); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropThree') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[pathProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.opacity).assertEqual('1.5') + console.info("[pathProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeProp + * @tc.desc ACE + */ + it('testPathStrokeProp', 0, async function (done) { + console.info('testPathStrokeProp START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeProp); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeProp') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeDashArrayProp + * @tc.desc ACE + */ + it('testPathStrokeDashArrayProp', 0, async function (done) { + console.info('testPathStrokeDashArrayProp START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeDashArrayProp); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeDashArrayProp') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeDasharray).assertEqual('2 3') + console.info("[pathProps] get inspector dasharray value is: " + JSON.stringify(obj.$attrs.strokeDasharray)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeDashOffsetProp + * @tc.desc ACE + */ + it('testPathStrokeDashOffsetProp', 0, async function (done) { + console.info('testPathStrokeDashOffsetProp START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeDashOffsetProp); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeDashOffsetProp') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeDashoffset).assertEqual('23') + console.info("[pathProps] get inspector dashoffset value is: " + JSON.stringify(obj.$attrs.strokeDashoffset)); + done(); + }); + + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeLineJoinPropOne + * @tc.desc ACE + */ + it('testPathStrokeLineJoinPropOne', 0, async function (done) { + console.info('testPathStrokeLineJoinPropOne START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropOne); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropOne') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('bevel') + console.info("[pathProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeLineJoinPropTwo + * @tc.desc ACE + */ + it('testPathStrokeLineJoinPropTwo', 0, async function (done) { + console.info('testPathStrokeLineJoinPropTwo START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropTwo); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropTwo') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('miter') + console.info("[pathProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeLineJoinPropThree + * @tc.desc ACE + */ + it('testPathStrokeLineJoinPropThree', 0, async function (done) { + console.info('testPathStrokeLineJoinPropThree START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropThree); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropThree') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('round') + console.info("[pathProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeLineJoinPropOne + * @tc.desc ACE + */ + it('testPathStrokeLineCapPropOne', 0, async function (done) { + console.info('testPathStrokeLineCapPropOne START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropOne); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropOne') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('butt') + console.info("[pathProps] get inspector lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeLineCapPropTwo + * @tc.desc ACE + */ + it('testPathStrokeLineCapPropTwo', 0, async function (done) { + console.info('testPathStrokeLineCapPropTwo START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropTwo); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropTwo') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('round') + console.info("[pathProps] get inspector lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeLineCapPropThree + * @tc.desc ACE + */ + it('testPathStrokeLineCapPropThree', 0, async function (done) { + console.info('testPathStrokeLineCapPropThree START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropThree); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropThree') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('square') + console.info("[pathProps] get inspector stroke-lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeMiterLimitProp + * @tc.desc ACE + */ + it('testPathStrokeMiterLimitProp', 0, async function (done) { + console.info('testPathStrokeMiterLimitProp START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeMiterLimitProp); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeMiterLimitProp') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeMiterlimit).assertEqual('10') + console.info("[pathProps] get inspector miterlimit value is: " + JSON.stringify(obj.$attrs.strokeMiterlimit)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeOpacityPropOne + * @tc.desc ACE + */ + it('testPathStrokeOpacityPropOne', 0, async function (done) { + console.info('testPathStrokeOpacityPropOne START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropOne); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropOne') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('0.5') + console.info("[pathProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeOpacityPropTwo + * @tc.desc ACE + */ + it('testPathStrokeOpacityPropTwo', 0, async function (done) { + console.info('testPathStrokeOpacityPropTwo START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropTwo); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropTwo') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('1') + console.info("[pathProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeOpacityPropThree + * @tc.desc ACE + */ + it('testPathStrokeOpacityPropThree', 0, async function (done) { + console.info('testPathStrokeOpacityPropThree START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropThree); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropThree') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('1.5') + console.info("[pathProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathStrokeWidthProp + * @tc.desc ACE + */ + it('testPathStrokeWidthProp', 0, async function (done) { + console.info('testPathStrokeWidthProp START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeWidthProp); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeWidthProp') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,12 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[pathProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeWidth).assertEqual('6') + console.info("[pathProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathTransformProp + * @tc.desc ACE + */ + it('testPathTransformProp', 0, async function (done) { + console.info('testPathTransformProp START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.transformProp); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('transformProp') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,35 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + expect(obj.$attrs.transform).assertEqual('translate(10,5)scale(0.5 1.3)rotate(20 40 90)skewX(10)skewY(-15)') + console.info("[pathProps] get inspector transform value is: " + JSON.stringify(obj.$attrs.transform)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathIdProp + * @tc.desc ACE + */ + it('testPathIdProp', 0, async function (done) { + console.info('testPathIdProp START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('idProp') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,35 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPathdProp + * @tc.desc ACE + */ + it('testPathdProp', 0, async function (done) { + console.info('testPathdProp START'); + console.info("[pathProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dProp); + console.info("[pathProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pathProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('path') + console.info("[pathProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('dProp') + console.info("[pathProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.d).assertEqual('m10,35 c0,-40 40,40 40,0 c0,-40 -40,40 -40,0 z') + console.info("[pathProps] get inspector d value is: " + JSON.stringify(obj.$attrs.d)); + done(); + }); + }); + \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/test/pickerViewProps.test.js b/ace/ace_standard/src/main/js/default/test/pickerViewProps.test.js index e3bb45b22974d999af84f4a74357ec4a311e7abc..0e644e39184e92b5e41ed0552265a43c95150160 100644 --- a/ace/ace_standard/src/main/js/default/test/pickerViewProps.test.js +++ b/ace/ace_standard/src/main/js/default/test/pickerViewProps.test.js @@ -13,775 +13,776 @@ * limitations under the License. */ -import router from '@system.router'; -import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; - - -describe('pickerViewPropsJsTest', function () { - - async function sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve() - }, time) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - async function backToIndex() { - let backToIndexPromise = new Promise((resolve, reject) => { - setTimeout(() => { - router.back({ - uri: 'pages/index/index' - }); - resolve(); - }, 500); - }) - let clearPromise = new Promise((resolve, reject) => { - setTimeout(() => { - router.clear(); - resolve(); - }, 500); - }) - await backToIndexPromise.then(() => { - return clearPromise; - }) - } - - /** - * run before testcase - */ - beforeAll(async function (done) { - console.info('[pickerViewPropsJsTest] before each called') - - let result; - let options = { - uri: 'pages/pickerView/prop/index' - } - try { - result = router.push(options) - console.info("push pickerViewProps page success " + JSON.stringify(result)); - } catch (err) { - console.error("push pickerViewProps page error " + JSON.stringify(result)); - } - await sleep(4000) - done() - }) - - /** - * run after testcase - */ - afterAll(async function () { - console.info('[pickerViewPropsJsTest] after each called') - await backToIndex() - await sleep(1000) - }) - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewIdProp - * @tc.desc ACE - */ - it('testPickerViewIdProp', 0, async function (done) { - console.info('testPickerViewIdProp START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.idProp); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('idProp') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewClassProp - * @tc.desc ACE - */ - it('testPickerViewClassProp', 0, async function (done) { - console.info('testPickerViewClassProp START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.classProp); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('classProp') - expect(obj.$attrs.className).assertEqual('classProp') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewClassPropNone - * @tc.desc ACE - */ - it('testPickerViewClassPropNone', 0, async function (done) { - console.info('testPickerViewClassPropNone START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.classPropNone); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('classPropNone') - expect(obj.$attrs.className).assertEqual(undefined) - console.info("[pickerViewProps] get className value is: " + JSON.stringify(obj.$attrs.className)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewStyleProp - * @tc.desc ACEs - */ - // it('testPickerViewStyleProp', 0, async function (done) { - // console.info('testPickerViewStyleProp START'); - // console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - // - // let obj = JSON.parse(globalThis.value.styleProp); - // console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - // console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - // - // expect(obj.$type).assertEqual('pickerView') - // expect(obj.$attrs.id).assertEqual('styleProp') - // expect(obj.$attrs.style).assertEqual(undefined) - // console.info("[pickerViewProps] get style value is: " + JSON.stringify(obj.$attrs.style)); - // - // expect(obj.$styles.width).assertEqual(undefined); - // console.info("[pickerViewProps] get style width value is: " + JSON.stringify(obj.$styles.width)); - // expect(obj.$styles.height).assertEqual(undefined); - // console.info("[pickerViewProps] get style height value is: " + JSON.stringify(obj.$styles.height)); - // expect(obj.$styles.get('background-color')).assertEqual(undefined); - // done(); - // }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewRefProp - * @tc.desc ACE - */ - it('testPickerViewRefProp', 0, async function (done) { - console.info('testPickerViewRefProp START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.refProp); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('refProp') - expect(obj.$attrs.ref).assertEqual('refProp') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewRefPropNone - * @tc.desc ACE - */ - it('testPickerViewRefPropNone', 0, async function (done) { - console.info('testPickerViewRefPropNone START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.refPropNone); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('refPropNone') - expect(obj.$attrs.ref).assertEqual(undefined) - console.info("[pickerViewProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewDisabledPropTrue - * @tc.desc ACE - */ - it('testPickerViewDisabledPropTrue', 0, async function (done) { - console.info('testPickerViewDisabledPropTrue START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.disabledPropTrue); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('disabledPropTrue') - expect(obj.$attrs.disabled).assertEqual('true') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewDisabledPropFalse - * @tc.desc ACE - */ - it('testPickerViewDisabledPropFalse', 0, async function (done) { - console.info('testPickerViewDisabledPropFalse START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.disabledPropFalse); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('disabledPropFalse') - expect(obj.$attrs.disabled).assertEqual('false') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewDisabledPropNone - * @tc.desc ACE - */ - it('testPickerViewDisabledPropNone', 0, async function (done) { - console.info('testPickerViewDisabledPropNone START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.disabledPropNone); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('disabledPropNone') - expect(obj.$attrs.disabled).assertEqual('false') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewFocusablePropTrue - * @tc.desc ACE - */ - it('testPickerViewFocusablePropTrue', 0, async function (done) { - console.info('testPickerViewFocusablePropTrue START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.focusablePropTrue); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('focusablePropTrue') - expect(obj.$attrs.focusable).assertEqual('true') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewFocusablePropFalse - * @tc.desc ACE - */ - it('testPickerViewFocusablePropFalse', 0, async function (done) { - console.info('testPickerViewFocusablePropFalse START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.focusablePropFalse); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('focusablePropFalse') - expect(obj.$attrs.focusable).assertEqual('false') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewFocusablePropNone - * @tc.desc ACE - */ - it('testPickerViewFocusablePropNone', 0, async function (done) { - console.info('testPickerViewFocusablePropNone START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.focusablePropNone); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('focusablePropNone') - expect(obj.$attrs.focusable).assertEqual('false') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewDataProp - * @tc.desc ACE - */ - it('testPickerViewDataProp', 0, async function (done) { - console.info('testPickerViewDataProp START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.dataProp); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('dataProp') - expect(obj.$attrs.datapickerView).assertEqual(undefined); - console.info("[pickerViewProps] get datapickerView value is: " + JSON.stringify(obj.$attrs.datapickerView)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewDataPropNone - * @tc.desc ACE - */ - it('testPickerViewDataPropNone', 0, async function (done) { - console.info('testPickerViewDataPropNone START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.dataPropNone); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('dataPropNone') - expect(obj.$attrs.datapickerView).assertEqual(undefined) - console.info("[pickerViewProps] get datapickerView value is: " + JSON.stringify(obj.$attrs.datapickerView)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewClickEffectPropSmall - * @tc.desc ACE - */ - it('testPickerViewClickEffectPropSmall', 0, async function (done) { - console.info('testPickerViewClickEffectPropSmall START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.clickEffectPropSmall); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') - expect(obj.$attrs.clickEffect).assertEqual('spring-small') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewClickEffectPropMedium - * @tc.desc ACE - */ - it('testPickerViewClickEffectPropMedium', 0, async function (done) { - console.info('testPickerViewClickEffectPropMedium START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.clickEffectPropMedium); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') - expect(obj.$attrs.clickEffect).assertEqual('spring-medium') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewClickEffectPropLarge - * @tc.desc ACE - */ - it('testPickerViewClickEffectPropLarge', 0, async function (done) { - console.info('testPickerViewClickEffectPropLarge START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.clickEffectPropLarge); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') - expect(obj.$attrs.clickEffect).assertEqual('spring-large') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewClickEffectPropNone - * @tc.desc ACE - */ - it('testPickerViewClickEffectPropNone', 0, async function (done) { - console.info('testPickerViewClickEffectPropNone START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.clickEffectPropNone); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('clickEffectPropNone') - expect(obj.$attrs.clickEffect).assertEqual(undefined) - console.info("[pickerViewProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewDirPropRtl - * @tc.desc ACE - */ - it('testPickerViewDirPropRtl', 0, async function (done) { - console.info('testPickerViewDirPropRtl START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.dirPropRtl); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('dirPropRtl') - expect(obj.$attrs.dir).assertEqual('rtl') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewDirPropLtr - * @tc.desc ACE - */ - it('testPickerViewDirPropLtr', 0, async function (done) { - console.info('testPickerViewDirPropLtr START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.dirPropLtr); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('dirPropLtr') - expect(obj.$attrs.dir).assertEqual('ltr') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewDirPropAuto - * @tc.desc ACE - */ - it('testPickerViewDirPropAuto', 0, async function (done) { - console.info('testPickerViewDirPropAuto START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.dirPropAuto); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('dirPropAuto') - expect(obj.$attrs.dir).assertEqual('auto') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewDirPropNone - * @tc.desc ACE - */ - it('testPickerViewDirPropNone', 0, async function (done) { - console.info('testPickerViewDirPropNone START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.dirPropNone); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('dirPropNone') - expect(obj.$attrs.dir).assertEqual('auto') - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewForPropNull - * @tc.desc ACE - */ - it('testPickerViewForPropNull', 0, async function (done) { - console.info('testPickerViewForPropNull START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.forPropNull); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('forPropNull') - expect(obj.$attrs.for).assertEqual(undefined) - console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.for)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewForPropOne - * @tc.desc ACE - */ - it('testPickerViewForPropOne', 0, async function (done) { - console.info('testPickerViewForPropOne START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.forPropOne); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('forPropOne') - expect(obj.$attrs.for).assertEqual(undefined) - console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.for)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewForPropThree - * @tc.desc ACE - */ - it('testPickerViewForPropThree', 0, async function (done) { - console.info('testPickerViewForPropThree START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.forPropThree); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('forPropThree') - expect(obj.$attrs.for).assertEqual(undefined) - console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.for)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewIfPropTrue - * @tc.desc ACE - */ - it('testPickerViewIfPropTrue', 0, async function (done) { - console.info('testPickerViewIfPropTrue START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.ifPropTrue); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('ifPropTrue') - expect(obj.$attrs.if).assertEqual(undefined) - console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.if)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewIfPropFalse - * @tc.desc ACE - */ - // it('testPickerViewIfPropFalse', 0, async function (done) { - // console.info('testPickerViewIfPropFalse START'); - // console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - // - // let obj = JSON.parse(globalThis.value.ifPropFalse); - // console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - // console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - // - // expect(obj.$type).assertEqual('pickerView') - // expect(obj.$attrs.id).assertEqual('ifPropFalse') - // expect(obj.$attrs.if).assertEqual(false) - // done(); - // }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewIfPropNone - * @tc.desc ACE - */ - // it('testPickerViewIfPropNone', 0, async function (done) { - // console.info('testPickerViewIfPropNone START'); - // console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - // - // let obj = JSON.parse(globalThis.value.ifPropNone); - // console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - // console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - // - // expect(obj.$type).assertEqual('pickerView') - // expect(obj.$attrs.id).assertEqual('ifPropNone') - // expect(obj.$attrs.if).assertEqual(false) - // done(); - // }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewShowPropTrue - * @tc.desc ACE - */ - it('testPickerViewShowPropTrue', 0, async function (done) { - console.info('testPickerViewShowPropTrue START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.showPropTrue); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('showPropTrue') - expect(obj.$attrs.show).assertEqual('true') - console.info("[pickerViewProps] get show value is: " + JSON.stringify(obj.$attrs.show)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewShowPropFalse - * @tc.desc ACE - */ - it('testPickerViewShowPropFalse', 0, async function (done) { - console.info('testPickerViewShowPropFalse START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.showPropFalse); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('showPropFalse') - expect(obj.$attrs.show).assertEqual('false') - console.info("[pickerViewProps] get show value is: " + JSON.stringify(obj.$attrs.show)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewShowPropNone - * @tc.desc ACE - */ - it('testPickerViewShowPropNone', 0, async function (done) { - console.info('testPickerViewShowPropNone START'); - console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); - - let obj = JSON.parse(globalThis.value.showPropNone); - console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); - console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); - - expect(obj.$type).assertEqual('picker-view') - expect(obj.$attrs.id).assertEqual('showPropNone') - expect(obj.$attrs.show).assertEqual('true') - console.info("[pickerViewProps] get show value is: " + JSON.stringify(obj.$attrs.show)); - done(); - }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewPickerViewText - * @tc.desc ACE - */ -// it('testPickerViewPickerViewText', 0, async function (done) { -// console.info('testPickerViewPickerViewText START'); -// console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); -// -// let obj = JSON.parse(globalThis.value.pickerViewText); -// console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); -// console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); -// -// expect(obj.$type).assertEqual('pickerView') -// expect(obj.$attrs.id).assertEqual('pickerViewText') -// expect(obj.$attrs.type).assertEqual('text') -// console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); -// done(); -// }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewPickerViewTime - * @tc.desc ACE - */ -// it('testPickerViewPickerViewTime', 0, async function (done) { -// console.info('testPickerViewPickerViewTime START'); -// console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); -// -// let obj = JSON.parse(globalThis.value.pickerViewTime); -// console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); -// console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); -// -// expect(obj.$type).assertEqual('pickerView') -// expect(obj.$attrs.id).assertEqual('pickerViewTime') -// expect(obj.$attrs.type).assertEqual('time') -// console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); -// done(); -// }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewPickerViewDate - * @tc.desc ACE - */ -// it('testPickerViewPickerViewDate', 0, async function (done) { -// console.info('testPickerViewPickerViewDate START'); -// console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); -// -// let obj = JSON.parse(globalThis.value.pickerViewDate); -// console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); -// console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); -// -// expect(obj.$type).assertEqual('pickerView') -// expect(obj.$attrs.id).assertEqual('pickerViewDate') -// expect(obj.$attrs.type).assertEqual('date') -// console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); -// done(); -// }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewPickerViewDatetime - * @tc.desc ACE - */ -// it('testPickerViewPickerViewDatetime', 0, async function (done) { -// console.info('testPickerViewPickerViewDatetime START'); -// console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); -// -// let obj = JSON.parse(globalThis.value.pickerViewDatetime); -// console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); -// console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); -// -// expect(obj.$type).assertEqual('pickerView') -// expect(obj.$attrs.id).assertEqual('pickerViewDatetime') -// expect(obj.$attrs.type).assertEqual('datetime') -// console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); -// done(); -// }); - - /** - * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPickerViewPickerViewMultiText - * @tc.desc ACE - */ -// it('testPickerViewPickerViewMultiText', 0, async function (done) { -// console.info('testPickerViewPickerViewMultiText START'); -// console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); -// -// let obj = JSON.parse(globalThis.value.pickerViewMultiText); -// console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); -// console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); -// -// expect(obj.$type).assertEqual('pickerView') -// expect(obj.$attrs.id).assertEqual('pickerViewMultiText') -// expect(obj.$attrs.type).assertEqual('multi-text') -// console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); -// done(); -// }); -}); + import router from '@system.router'; + import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + + describe('pickerViewPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }) + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }) + await backToIndexPromise.then(() => { + return clearPromise; + }) + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[pickerViewPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/pickerView/prop/index' + } + try { + result = router.push(options) + console.info("push pickerViewProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push pickerViewProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }) + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[pickerViewPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }) + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewIdProp + * @tc.desc ACE + */ + it('testPickerViewIdProp', 0, async function (done) { + console.info('testPickerViewIdProp START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClassProp + * @tc.desc ACE + */ + it('testPickerViewClassProp', 0, async function (done) { + console.info('testPickerViewClassProp START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClassPropNone + * @tc.desc ACE + */ + it('testPickerViewClassPropNone', 0, async function (done) { + console.info('testPickerViewClassPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[pickerViewProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewStyleProp + * @tc.desc ACEs + */ + it('testPickerViewStyleProp', 0, async function (done) { + console.info('testPickerViewStyleProp START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.styleProp); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('styleProp') + expect(obj.$attrs.style).assertEqual(undefined) + console.info("[pickerViewProps] get style value is: " + JSON.stringify(obj.$attrs.style)); + + expect(obj.$styles.width).assertEqual(undefined); + console.info("[pickerViewProps] get style width value is: " + JSON.stringify(obj.$styles.width)); + expect(obj.$styles.height).assertEqual(undefined); + console.info("[pickerViewProps] get style height value is: " + JSON.stringify(obj.$styles.height)); + expect(obj.$styles.get('background-color')).assertEqual(undefined); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewRefProp + * @tc.desc ACE + */ + it('testPickerViewRefProp', 0, async function (done) { + console.info('testPickerViewRefProp START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewRefPropNone + * @tc.desc ACE + */ + it('testPickerViewRefPropNone', 0, async function (done) { + console.info('testPickerViewRefPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("[pickerViewProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDisabledPropTrue + * @tc.desc ACE + */ + it('testPickerViewDisabledPropTrue', 0, async function (done) { + console.info('testPickerViewDisabledPropTrue START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDisabledPropFalse + * @tc.desc ACE + */ + it('testPickerViewDisabledPropFalse', 0, async function (done) { + console.info('testPickerViewDisabledPropFalse START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDisabledPropNone + * @tc.desc ACE + */ + it('testPickerViewDisabledPropNone', 0, async function (done) { + console.info('testPickerViewDisabledPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewFocusablePropTrue + * @tc.desc ACE + */ + it('testPickerViewFocusablePropTrue', 0, async function (done) { + console.info('testPickerViewFocusablePropTrue START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewFocusablePropFalse + * @tc.desc ACE + */ + it('testPickerViewFocusablePropFalse', 0, async function (done) { + console.info('testPickerViewFocusablePropFalse START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewFocusablePropNone + * @tc.desc ACE + */ + it('testPickerViewFocusablePropNone', 0, async function (done) { + console.info('testPickerViewFocusablePropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDataProp + * @tc.desc ACE + */ + it('testPickerViewDataProp', 0, async function (done) { + console.info('testPickerViewDataProp START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.datapickerView).assertEqual(undefined); + console.info("[pickerViewProps] get datapickerView value is: " + JSON.stringify(obj.$attrs.datapickerView)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDataPropNone + * @tc.desc ACE + */ + it('testPickerViewDataPropNone', 0, async function (done) { + console.info('testPickerViewDataPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.datapickerView).assertEqual(undefined) + console.info("[pickerViewProps] get datapickerView value is: " + JSON.stringify(obj.$attrs.datapickerView)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClickEffectPropSmall + * @tc.desc ACE + */ + it('testPickerViewClickEffectPropSmall', 0, async function (done) { + console.info('testPickerViewClickEffectPropSmall START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClickEffectPropMedium + * @tc.desc ACE + */ + it('testPickerViewClickEffectPropMedium', 0, async function (done) { + console.info('testPickerViewClickEffectPropMedium START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClickEffectPropLarge + * @tc.desc ACE + */ + it('testPickerViewClickEffectPropLarge', 0, async function (done) { + console.info('testPickerViewClickEffectPropLarge START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClickEffectPropNone + * @tc.desc ACE + */ + it('testPickerViewClickEffectPropNone', 0, async function (done) { + console.info('testPickerViewClickEffectPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("[pickerViewProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDirPropRtl + * @tc.desc ACE + */ + it('testPickerViewDirPropRtl', 0, async function (done) { + console.info('testPickerViewDirPropRtl START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDirPropLtr + * @tc.desc ACE + */ + it('testPickerViewDirPropLtr', 0, async function (done) { + console.info('testPickerViewDirPropLtr START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDirPropAuto + * @tc.desc ACE + */ + it('testPickerViewDirPropAuto', 0, async function (done) { + console.info('testPickerViewDirPropAuto START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDirPropNone + * @tc.desc ACE + */ + it('testPickerViewDirPropNone', 0, async function (done) { + console.info('testPickerViewDirPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewForPropNull + * @tc.desc ACE + */ + it('testPickerViewForPropNull', 0, async function (done) { + console.info('testPickerViewForPropNull START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewForPropOne + * @tc.desc ACE + */ + it('testPickerViewForPropOne', 0, async function (done) { + console.info('testPickerViewForPropOne START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewForPropThree + * @tc.desc ACE + */ + it('testPickerViewForPropThree', 0, async function (done) { + console.info('testPickerViewForPropThree START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewIfPropTrue + * @tc.desc ACE + */ + it('testPickerViewIfPropTrue', 0, async function (done) { + console.info('testPickerViewIfPropTrue START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewIfPropFalse + * @tc.desc ACE + */ + it('testPickerViewIfPropFalse', 0, async function (done) { + console.info('testPickerViewIfPropFalse START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropFalse); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('ifPropFalse') + expect(obj.$attrs.if).assertEqual(false) + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewIfPropNone + * @tc.desc ACE + */ + it('testPickerViewIfPropNone', 0, async function (done) { + console.info('testPickerViewIfPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('ifPropNone') + expect(obj.$attrs.if).assertEqual(false) + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewShowPropTrue + * @tc.desc ACE + */ + it('testPickerViewShowPropTrue', 0, async function (done) { + console.info('testPickerViewShowPropTrue START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("[pickerViewProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewShowPropFalse + * @tc.desc ACE + */ + it('testPickerViewShowPropFalse', 0, async function (done) { + console.info('testPickerViewShowPropFalse START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("[pickerViewProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewShowPropNone + * @tc.desc ACE + */ + it('testPickerViewShowPropNone', 0, async function (done) { + console.info('testPickerViewShowPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual('true') + console.info("[pickerViewProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewPickerViewText + * @tc.desc ACE + */ + it('testPickerViewPickerViewText', 0, async function (done) { + console.info('testPickerViewPickerViewText START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerViewText); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('pickerViewText') + expect(obj.$attrs.type).assertEqual('text') + console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewPickerViewTime + * @tc.desc ACE + */ + it('testPickerViewPickerViewTime', 0, async function (done) { + console.info('testPickerViewPickerViewTime START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerViewTime); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('pickerViewTime') + expect(obj.$attrs.type).assertEqual('time') + console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewPickerViewDate + * @tc.desc ACE + */ + it('testPickerViewPickerViewDate', 0, async function (done) { + console.info('testPickerViewPickerViewDate START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerViewDate); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('pickerViewDate') + expect(obj.$attrs.type).assertEqual('date') + console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewPickerViewDatetime + * @tc.desc ACE + */ + it('testPickerViewPickerViewDatetime', 0, async function (done) { + console.info('testPickerViewPickerViewDatetime START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerViewDatetime); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('pickerViewDatetime') + expect(obj.$attrs.type).assertEqual('datetime') + console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewPickerViewMultiText + * @tc.desc ACE + */ + it('testPickerViewPickerViewMultiText', 0, async function (done) { + console.info('testPickerViewPickerViewMultiText START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerViewMultiText); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker-view') + expect(obj.$attrs.id).assertEqual('pickerViewMultiText') + expect(obj.$attrs.type).assertEqual('multi-text') + console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + }); + \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/test/polygonProps.test.js b/ace/ace_standard/src/main/js/default/test/polygonProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..c03555f69cdcbfec8dd4e57dd0148969f7f2902a --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/polygonProps.test.js @@ -0,0 +1,749 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import { describe, beforeAll, afterAll, it, expect } from 'deccjsunit/index'; + + +describe('polygonPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[polygonPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/polygon/prop/index' + } + try { + result = router.push(options) + console.info("push polygonProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push polygonProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[polygonPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonFillProp + * @tc.desc ACE + */ + it('testPolygonFillProp', 0, async function (done) { + console.info('testPolygonFillProp START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillProp); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillProp') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polygonProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonFillOpacityPropOne + * @tc.desc ACE + */ + it('testPolygonFillOpacityPropOne', 0, async function (done) { + console.info('testPolygonFillOpacityPropOne START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropOne); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropOne') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polygonProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('0.5') + console.info("[polygonProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonFillOpacityPropTwo + * @tc.desc ACE + */ + it('testPolygonFillOpacityPropTwo', 0, async function (done) { + console.info('testPolygonFillOpacityPropTwo START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropTwo); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropTwo') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polygonProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('1') + console.info("[polygonProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonFillOpacityPropThree + * @tc.desc ACE + */ + it('testPolygonFillOpacityPropThree', 0, async function (done) { + console.info('testPolygonFillOpacityPropThree START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropThree); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropThree') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polygonProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('1.5') + console.info("[polygonProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonFillRulePropOne + * @tc.desc ACE + */ + it('testPolygonFillRulePropOne', 0, async function (done) { + console.info('testPolygonFillRulePropOne START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillRulePropOne); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillRulePropOne') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polygonProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillRule).assertEqual('evenodd') + console.info("[polygonProps] get inspector fill-rule value is: " + JSON.stringify(obj.$attrs.fillRule)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonFillRulePropTwo + * @tc.desc ACE + */ + it('testPolygonFillRulePropTwo', 0, async function (done) { + console.info('testPolygonFillRulePropTwo START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillRulePropTwo); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillRulePropTwo') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polygonProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillRule).assertEqual('nonzero') + console.info("[polygonProps] get inspector fill-rule value is: " + JSON.stringify(obj.$attrs.fillRule)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonOpacityPropOne + * @tc.desc ACE + */ + it('testPolygonOpacityPropOne', 0, async function (done) { + console.info('testPolygonOpacityPropOne START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropOne); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropOne') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polygonProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.opacity).assertEqual('0.5') + console.info("[polygonProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonOpacityPropTwo + * @tc.desc ACE + */ + it('testPolygonOpacityPropTwo', 0, async function (done) { + console.info('testPolygonOpacityPropTwo START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropTwo); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropTwo') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polygonProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.opacity).assertEqual('1') + console.info("[polygonProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonOpacityPropThree + * @tc.desc ACE + */ + it('testPolygonOpacityPropThree', 0, async function (done) { + console.info('testPolygonOpacityPropThree START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropThree); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropThree') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polygonProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.opacity).assertEqual('1.5') + console.info("[polygonProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeProp + * @tc.desc ACE + */ + it('testPolygonStrokeProp', 0, async function (done) { + console.info('testPolygonStrokeProp START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeProp); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeProp') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeDashArrayProp + * @tc.desc ACE + */ + it('testPolygonStrokeDashArrayProp', 0, async function (done) { + console.info('testPolygonStrokeDashArrayProp START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeDashArrayProp); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeDashArrayProp') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeDasharray).assertEqual('2 3') + console.info("[polygonProps] get inspector dasharray value is: " + JSON.stringify(obj.$attrs.strokeDasharray)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeDashOffsetProp + * @tc.desc ACE + */ + it('testPolygonStrokeDashOffsetProp', 0, async function (done) { + console.info('testPolygonStrokeDashOffsetProp START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeDashOffsetProp); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeDashOffsetProp') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeDashoffset).assertEqual('23') + console.info("[polygonProps] get inspector dashoffset value is: " + JSON.stringify(obj.$attrs.strokeDashoffset)); + done(); + }); + + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeLineJoinPropOne + * @tc.desc ACE + */ + it('testPolygonStrokeLineJoinPropOne', 0, async function (done) { + console.info('testPolygonStrokeLineJoinPropOne START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropOne); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropOne') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('bevel') + console.info("[polygonProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeLineJoinPropTwo + * @tc.desc ACE + */ + it('testPolygonStrokeLineJoinPropTwo', 0, async function (done) { + console.info('testPolygonStrokeLineJoinPropTwo START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropTwo); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropTwo') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('miter') + console.info("[polygonProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeLineJoinPropThree + * @tc.desc ACE + */ + it('testPolygonStrokeLineJoinPropThree', 0, async function (done) { + console.info('testPolygonStrokeLineJoinPropThree START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropThree); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropThree') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('round') + console.info("[polygonProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeLineJoinPropOne + * @tc.desc ACE + */ + it('testPolygonStrokeLineCapPropOne', 0, async function (done) { + console.info('testPolygonStrokeLineCapPropOne START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropOne); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropOne') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('butt') + console.info("[polygonProps] get inspector lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeLineCapPropTwo + * @tc.desc ACE + */ + it('testPolygonStrokeLineCapPropTwo', 0, async function (done) { + console.info('testPolygonStrokeLineCapPropTwo START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropTwo); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropTwo') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('round') + console.info("[polygonProps] get inspector lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeLineCapPropThree + * @tc.desc ACE + */ + it('testPolygonStrokeLineCapPropThree', 0, async function (done) { + console.info('testPolygonStrokeLineCapPropThree START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropThree); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropThree') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('square') + console.info("[polygonProps] get inspector lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeMiterLimitProp + * @tc.desc ACE + */ + it('testPolygonStrokeMiterLimitProp', 0, async function (done) { + console.info('testPolygonStrokeMiterLimitProp START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeMiterLimitProp); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeMiterLimitProp') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeMiterlimit).assertEqual('10') + console.info("[polygonProps] get inspector miterlimit value is: " + JSON.stringify(obj.$attrs.strokeMiterlimit)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeOpacityPropOne + * @tc.desc ACE + */ + it('testPolygonStrokeOpacityPropOne', 0, async function (done) { + console.info('testPolygonStrokeOpacityPropOne START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropOne); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropOne') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('0.5') + console.info("[polygonProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeOpacityPropTwo + * @tc.desc ACE + */ + it('testPolygonStrokeOpacityPropTwo', 0, async function (done) { + console.info('testPolygonStrokeOpacityPropTwo START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropTwo); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropTwo') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('1') + console.info("[polygonProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeOpacityPropThree + * @tc.desc ACE + */ + it('testPolygonStrokeOpacityPropThree', 0, async function (done) { + console.info('testPolygonStrokeOpacityPropThree START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropThree); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropThree') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('1.5') + console.info("[polygonProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonStrokeWidthProp + * @tc.desc ACE + */ + it('testPolygonStrokeWidthProp', 0, async function (done) { + console.info('testPolygonStrokeWidthProp START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeWidthProp); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeWidthProp') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeWidth).assertEqual('6') + console.info("[polygonProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonTransformProp + * @tc.desc ACE + */ + it('testPolygonTransformProp', 0, async function (done) { + console.info('testPolygonTransformProp START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.transformProp); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('transformProp') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.transform).assertEqual('translate(10,5)scale(0.5 1.3)rotate(20 40 90)skewX(10)skewY(-15)') + console.info("[polygonProps] get inspector transform value is: " + JSON.stringify(obj.$attrs.transform)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonIdProp + * @tc.desc ACE + */ + it('testPolygonIdProp', 0, async function (done) { + console.info('testPolygonIdProp START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('idProp') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polygonProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolygonPointProp + * @tc.desc ACE + */ + it('testPolygonPointProp', 0, async function (done) { + console.info('testPolygonPointProp START'); + console.info("[polygonProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pointProp); + console.info("[polygonProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polygonProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polygon') + console.info("[polygonProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('pointProp') + console.info("[polygonProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polygonProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polygonProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.stroke).assertEqual('blue') + console.info("[polygonProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/polylineProps.test.js b/ace/ace_standard/src/main/js/default/test/polylineProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..21780c0e17fa155a84dfc6b8daba1749de4d02c8 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/polylineProps.test.js @@ -0,0 +1,750 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + import router from '@system.router'; + import { describe, beforeAll, afterAll, it, expect } from 'deccjsunit/index'; + + + describe('polylinePropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[polylinePropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/polyline/prop/index' + } + try { + result = router.push(options) + console.info("push polylineProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push polylineProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[polylinePropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineFillProp + * @tc.desc ACE + */ + it('testPolylineFillProp', 0, async function (done) { + console.info('testPolylineFillProp START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillProp); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillProp') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polylineProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineFillOpacityPropOne + * @tc.desc ACE + */ + it('testPolylineFillOpacityPropOne', 0, async function (done) { + console.info('testPolylineFillOpacityPropOne START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropOne); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropOne') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polylineProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('0.5') + console.info("[polylineProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineFillOpacityPropTwo + * @tc.desc ACE + */ + it('testPolylineFillOpacityPropTwo', 0, async function (done) { + console.info('testPolylineFillOpacityPropTwo START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropTwo); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropTwo') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polylineProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('1') + console.info("[polylineProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineFillOpacityPropThree + * @tc.desc ACE + */ + it('testPolylineFillOpacityPropThree', 0, async function (done) { + console.info('testPolylineFillOpacityPropThree START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropThree); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillOpacityPropThree') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polylineProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillOpacity).assertEqual('1.5') + console.info("[polylineProps] get inspector fill-opacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineFillRulePropOne + * @tc.desc ACE + */ + it('testPolylineFillRulePropOne', 0, async function (done) { + console.info('testPolylineFillRulePropOne START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillRulePropOne); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillRulePropOne') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polylineProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillRule).assertEqual('evenodd') + console.info("[polylineProps] get inspector fill-rule value is: " + JSON.stringify(obj.$attrs.fillRule)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineFillRulePropTwo + * @tc.desc ACE + */ + it('testPolylineFillRulePropTwo', 0, async function (done) { + console.info('testPolylineFillRulePropTwo START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillRulePropTwo); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('fillRulePropTwo') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polylineProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.fillRule).assertEqual('nonzero') + console.info("[polylineProps] get inspector fill-rule value is: " + JSON.stringify(obj.$attrs.fillRule)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineOpacityPropOne + * @tc.desc ACE + */ + it('testPolylineOpacityPropOne', 0, async function (done) { + console.info('testPolylineOpacityPropOne START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropOne); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropOne') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polylineProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.opacity).assertEqual('0.5') + console.info("[polylineProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineOpacityPropTwo + * @tc.desc ACE + */ + it('testPolylineOpacityPropTwo', 0, async function (done) { + console.info('testPolylineOpacityPropTwo START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropTwo); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropTwo') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polylineProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.opacity).assertEqual('1') + console.info("[polylineProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineOpacityPropThree + * @tc.desc ACE + */ + it('testPolylineOpacityPropThree', 0, async function (done) { + console.info('testPolylineOpacityPropThree START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropThree); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('opacityPropThree') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polylineProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.opacity).assertEqual('1.5') + console.info("[polylineProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeProp + * @tc.desc ACE + */ + it('testPolylineStrokeProp', 0, async function (done) { + console.info('testPolylineStrokeProp START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeProp); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeProp') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeDashArrayProp + * @tc.desc ACE + */ + it('testPolylineStrokeDashArrayProp', 0, async function (done) { + console.info('testPolylineStrokeDashArrayProp START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeDashArrayProp); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeDashArrayProp') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeDasharray).assertEqual('2 3') + console.info("[polylineProps] get inspector dasharray value is: " + JSON.stringify(obj.$attrs.strokeDasharray)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeDashOffsetProp + * @tc.desc ACE + */ + it('testPolylineStrokeDashOffsetProp', 0, async function (done) { + console.info('testPolylineStrokeDashOffsetProp START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeDashOffsetProp); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeDashOffsetProp') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeDashoffset).assertEqual('23') + console.info("[polylineProps] get inspector dashoffset value is: " + JSON.stringify(obj.$attrs.strokeDashoffset)); + done(); + }); + + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeLineJoinPropOne + * @tc.desc ACE + */ + it('testPolylineStrokeLineJoinPropOne', 0, async function (done) { + console.info('testPolylineStrokeLineJoinPropOne START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropOne); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropOne') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('bevel') + console.info("[polylineProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeLineJoinPropTwo + * @tc.desc ACE + */ + it('testPolylineStrokeLineJoinPropTwo', 0, async function (done) { + console.info('testPolylineStrokeLineJoinPropTwo START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropTwo); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropTwo') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('miter') + console.info("[polylineProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeLineJoinPropThree + * @tc.desc ACE + */ + it('testPolylineStrokeLineJoinPropThree', 0, async function (done) { + console.info('testPolylineStrokeLineJoinPropThree START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineJoinPropThree); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineJoinPropThree') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLinejoin).assertEqual('round') + console.info("[polylineProps] get inspector linejoin value is: " + JSON.stringify(obj.$attrs.strokeLinejoin)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeLineJoinPropOne + * @tc.desc ACE + */ + it('testPolylineStrokeLineCapPropOne', 0, async function (done) { + console.info('testPolylineStrokeLineCapPropOne START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropOne); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropOne') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('butt') + console.info("[polylineProps] get inspector lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeLineCapPropTwo + * @tc.desc ACE + */ + it('testPolylineStrokeLineCapPropTwo', 0, async function (done) { + console.info('testPolylineStrokeLineCapPropTwo START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropTwo); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropTwo') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('round') + console.info("[polylineProps] get inspector lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeLineCapPropThree + * @tc.desc ACE + */ + it('testPolylineStrokeLineCapPropThree', 0, async function (done) { + console.info('testPolylineStrokeLineCapPropThree START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeLineCapPropThree); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeLineCapPropThree') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeLineCap).assertEqual('square') + console.info("[polylineProps] get inspector lineCap value is: " + JSON.stringify(obj.$attrs.strokeLineCap)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeMiterLimitProp + * @tc.desc ACE + */ + it('testPolylineStrokeMiterLimitProp', 0, async function (done) { + console.info('testPolylineStrokeMiterLimitProp START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeMiterLimitProp); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeMiterLimitProp') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeMiterlimit).assertEqual('10') + console.info("[polylineProps] get inspector miterlimit value is: " + JSON.stringify(obj.$attrs.strokeMiterlimit)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeOpacityPropOne + * @tc.desc ACE + */ + it('testPolylineStrokeOpacityPropOne', 0, async function (done) { + console.info('testPolylineStrokeOpacityPropOne START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropOne); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropOne') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('0.5') + console.info("[polylineProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeOpacityPropTwo + * @tc.desc ACE + */ + it('testPolylineStrokeOpacityPropTwo', 0, async function (done) { + console.info('testPolylineStrokeOpacityPropTwo START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropTwo); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropTwo') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('1') + console.info("[polylineProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeOpacityPropThree + * @tc.desc ACE + */ + it('testPolylineStrokeOpacityPropThree', 0, async function (done) { + console.info('testPolylineStrokeOpacityPropThree START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropThree); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeOpacityPropThree') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeOpacity).assertEqual('1.5') + console.info("[polylineProps] get inspector opacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineStrokeWidthProp + * @tc.desc ACE + */ + it('testPolylineStrokeWidthProp', 0, async function (done) { + console.info('testPolylineStrokeWidthProp START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeWidthProp); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('strokeWidthProp') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.stroke).assertEqual('red') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + expect(obj.$attrs.strokeWidth).assertEqual('6') + console.info("[polylineProps] get inspector stroke-width value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineTransformProp + * @tc.desc ACE + */ + it('testPolylineTransformProp', 0, async function (done) { + console.info('testPolylineTransformProp START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.transformProp); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('transformProp') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.transform).assertEqual('translate(10,5)scale(0.5 1.3)rotate(20 40 90)skewX(10)skewY(-15)') + console.info("[polylineProps] get inspector transform value is: " + JSON.stringify(obj.$attrs.transform)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylineIdProp + * @tc.desc ACE + */ + it('testPolylineIdProp', 0, async function (done) { + console.info('testPolylineIdProp START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('idProp') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polylineProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPolylinePointProp + * @tc.desc ACE + */ + it('testPolylinePointProp', 0, async function (done) { + console.info('testPolylinePointProp START'); + console.info("[polylineProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pointProp); + console.info("[polylineProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[polylineProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('polyline') + console.info("[polylineProps] get inspector $type value is: " + JSON.stringify(obj.$attrs.$type)); + expect(obj.$attrs.id).assertEqual('pointProp') + console.info("[polylineProps] get inspector id value is: " + JSON.stringify(obj.$attrs.id)); + expect(obj.$attrs.points).assertEqual('10,30 20,0 30,30 40,0') + console.info("[polylineProps] get inspector points value is: " + JSON.stringify(obj.$attrs.points)); + expect(obj.$attrs.fill).assertEqual('red') + console.info("[polylineProps] get inspector fill value is: " + JSON.stringify(obj.$attrs.fill)); + expect(obj.$attrs.stroke).assertEqual('blue') + console.info("[polylineProps] get inspector stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + }); + \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/test/qrcodeProps.test.js b/ace/ace_standard/src/main/js/default/test/qrcodeProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..18dfc2671a6eeecd8a948586c7215d2ec868e829 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/qrcodeProps.test.js @@ -0,0 +1,820 @@ +/* + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + +describe('qrcodePropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[qrcodePropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/qrcode/prop/index' + } + try { + result = router.push(options) + console.info("push qrcodeProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push qrcodeProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[qrcodePropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testqrcodeIdProp + * @tc.desc ACE + */ + it('testQrcodeIdProp', 0, async function (done) { + console.info('testQrcodeIdProp START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('idProp') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeClassProp + * @tc.desc ACE + */ + it('testQrcodeClassProp', 0, async function (done) { + console.info('testQrcodeClassProp START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeClassPropNone + * @tc.desc ACE + */ + it('testQrcodeClassPropNone', 0, async function (done) { + console.info('testQrcodeClassPropNone START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeStyleProp + * @tc.desc ACEs + */ +// it('testQrcodeStyleProp', 0, async function (done) { +// console.info('testQrcodeStyleProp START'); +// console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); +// +// let obj = JSON.parse(globalThis.value.styleProp); +// console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); +// console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); +// +// expect(obj.$type).assertEqual('qrcode') +// expect(obj.$attrs.id).assertEqual('styleProp') +// expect(obj.$attrs.style).assertEqual(undefined) +// console.info("[qrcodeProps] get style value is: " + JSON.stringify(obj.$attrs.style)); +// +// expect(obj.$styles.width).assertEqual(undefined); +// console.info("[qrcodeProps] get style width value is: " + JSON.stringify(obj.$styles.width)); +// expect(obj.$styles.height).assertEqual(undefined); +// console.info("[qrcodeProps] get style height value is: " + JSON.stringify(obj.$styles.height)); +// expect(obj.$styles.get('background-color')).assertEqual(undefined); + // expect(obj.$attrs.value).assertEqual('value') +// done(); +// }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeRefProp + * @tc.desc ACE + */ + it('testQrcodeRefProp', 0, async function (done) { + console.info('testQrcodeRefProp START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeRefPropNone + * @tc.desc ACE + */ + it('testQrcodeRefPropNone', 0, async function (done) { + console.info('testQrcodeRefPropNone START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeDisabledPropTrue + * @tc.desc ACE + */ + it('testQrcodeDisabledPropTrue', 0, async function (done) { + console.info('testQrcodeDisabledPropTrue START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeDisabledPropFalse + * @tc.desc ACE + */ + it('testQrcodeDisabledPropFalse', 0, async function (done) { + console.info('testQrcodeDisabledPropFalse START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeDisabledPropNone + * @tc.desc ACE + */ + it('testQrcodeDisabledPropNone', 0, async function (done) { + console.info('testQrcodeDisabledPropNone START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeFocusablePropTrue + * @tc.desc ACE + */ + it('testQrcodeFocusablePropTrue', 0, async function (done) { + console.info('testQrcodeFocusablePropTrue START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeFocusablePropFalse + * @tc.desc ACE + */ + it('testQrcodeFocusablePropFalse', 0, async function (done) { + console.info('testQrcodeFocusablePropFalse START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeFocusablePropNone + * @tc.desc ACE + */ + it('testQrcodeFocusablePropNone', 0, async function (done) { + console.info('testQrcodeFocusablePropNone START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeDataProp + * @tc.desc ACE + */ + it('testQrcodeDataProp', 0, async function (done) { + console.info('testQrcodeDataProp START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.dataQrcode).assertEqual(undefined); + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get dataQrcode value is: " + JSON.stringify(obj.$attrs.dataQrcode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeDataPropNone + * @tc.desc ACE + */ + it('testQrcodeDataPropNone', 0, async function (done) { + console.info('testQrcodeDataPropNone START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.dataQrcode).assertEqual(undefined) + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get dataQrcode value is: " + JSON.stringify(obj.$attrs.dataQrcode)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeClickEffectPropSmall + * @tc.desc ACE + */ + it('testQrcodeClickEffectPropSmall', 0, async function (done) { + console.info('testQrcodeClickEffectPropSmall START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeClickEffectPropMedium + * @tc.desc ACE + */ + it('testQrcodeClickEffectPropMedium', 0, async function (done) { + console.info('testQrcodeClickEffectPropMedium START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeClickEffectPropLarge + * @tc.desc ACE + */ + it('testQrcodeClickEffectPropLarge', 0, async function (done) { + console.info('testQrcodeClickEffectPropLarge START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeClickEffectPropNone + * @tc.desc ACE + */ + it('testQrcodeClickEffectPropNone', 0, async function (done) { + console.info('testQrcodeClickEffectPropNone START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeDirPropRtl + * @tc.desc ACE + */ + it('testQrcodeDirPropRtl', 0, async function (done) { + console.info('testQrcodeDirPropRtl START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeDirPropLtr + * @tc.desc ACE + */ + it('testQrcodeDirPropLtr', 0, async function (done) { + console.info('testQrcodeDirPropLtr START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeDirPropAuto + * @tc.desc ACE + */ + it('testQrcodeDirPropAuto', 0, async function (done) { + console.info('testQrcodeDirPropAuto START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeDirPropNone + * @tc.desc ACE + */ + it('testQrcodeDirPropNone', 0, async function (done) { + console.info('testQrcodeDirPropNone START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + expect(obj.$attrs.value).assertEqual('value') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeForPropNull + * @tc.desc ACE + */ + it('testQrcodeForPropNull', 0, async function (done) { + console.info('testQrcodeForPropNull START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeForPropOne + * @tc.desc ACE + */ + it('testQrcodeForPropOne', 0, async function (done) { + console.info('testQrcodeForPropOne START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeForPropThree + * @tc.desc ACE + */ + it('testQrcodeForPropThree', 0, async function (done) { + console.info('testQrcodeForPropThree START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeIfPropTrue + * @tc.desc ACE + */ + it('testQrcodeIfPropTrue', 0, async function (done) { + console.info('testQrcodeIfPropTrue START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeIfPropFalse + * @tc.desc ACE + */ + // it('testQrcodeIfPropFalse', 0, async function (done) { + // console.info('testQrcodeIfPropFalse START'); + // console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropFalse); + // console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('qrcode') + // expect(obj.$attrs.id).assertEqual('ifPropFalse') + // expect(obj.$attrs.if).assertEqual(false) + // expect(obj.$attrs.value).assertEqual('value') + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeIfPropNone + * @tc.desc ACE + */ + // it('testQrcodeIfPropNone', 0, async function (done) { + // console.info('testQrcodeIfPropNone START'); + // console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropNone); + // console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('qrcode') + // expect(obj.$attrs.id).assertEqual('ifPropNone') + // expect(obj.$attrs.if).assertEqual(false) + // expect(obj.$attrs.value).assertEqual('value') + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeShowPropTrue + * @tc.desc ACE + */ + it('testQrcodeShowPropTrue', 0, async function (done) { + console.info('testQrcodeShowPropTrue START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeShowPropFalse + * @tc.desc ACE + */ + it('testQrcodeShowPropFalse', 0, async function (done) { + console.info('testQrcodeShowPropFalse START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeShowPropNone + * @tc.desc ACE + */ + it('testQrcodeShowPropNone', 0, async function (done) { + console.info('testQrcodeShowPropNone START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual('true') + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeQrcodeTypeValue + * @tc.desc ACE + */ + it('testQrcodeQrcodeTypeValue', 0, async function (done) { + console.info('testQrcodeQrcodeTypeValue START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.qrcodeTypeValue); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('qrcodeTypeValue') + expect(obj.$attrs.value).assertEqual('value') + console.info("[qrcodeProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeQrcodeTypeValueNone + * @tc.desc ACE + */ + it('testQrcodeQrcodeTypeValueNone', 0, async function (done) { + console.info('testQrcodeQrcodeTypeValueNone START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.qrcodeTypeValueNone); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('qrcodeTypeValueNone') + expect(obj.$attrs.value).assertEqual(undefined) + console.info("[qrcodeProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeQrcodeTypeRect + * @tc.desc ACE + */ + it('testQrcodeQrcodeTypeRect', 0, async function (done) { + console.info('testQrcodeQrcodeTypeRect START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.qrcodeTypeRect); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('qrcodeTypeRect') + expect(obj.$attrs.value).assertEqual('value') + expect(obj.$attrs.type).assertEqual('rect') + console.info("[qrcodeProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeQrcodeTypeCircle + * @tc.desc ACE + */ + it('testQrcodeQrcodeTypeCircle', 0, async function (done) { + console.info('testQrcodeQrcodeTypeCircle START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.qrcodeTypeCircle); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('qrcodeTypeCircle') + expect(obj.$attrs.value).assertEqual('value') + expect(obj.$attrs.type).assertEqual('circle') + console.info("[qrcodeProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeQrcodeTypeNone + * @tc.desc ACE + */ + it('testQrcodeQrcodeTypeNone', 0, async function (done) { + console.info('testQrcodeQrcodeTypeNone START'); + console.info("[qrcodeProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.qrcodeTypeNone); + console.info("[qrcodeProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[qrcodeProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('qrcode') + expect(obj.$attrs.id).assertEqual('qrcodeTypeNone') + expect(obj.$attrs.value).assertEqual('value') + expect(obj.$attrs.type).assertEqual(undefined) + console.info("[qrcodeProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/richtextProps.test.js b/ace/ace_standard/src/main/js/default/test/richtextProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..4447daeab0052754d50a9e4f5dd6e8462e4a618e --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/richtextProps.test.js @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + +describe('richtextPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[richtextPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/richtext/prop/index' + } + try { + result = router.push(options) + console.info("push richtextProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push richtextProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[richtextPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testRichtextIdProp + * @tc.desc ACE + */ + it('testRichtextIdProp', 0, async function (done) { + console.info('testRichtextIdProp START'); + console.info("[richtextProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[richtextProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[richtextProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('richtext') + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testRichtextClassProp + * @tc.desc ACE + */ + it('testRichtextClassProp', 0, async function (done) { + console.info('testRichtextClassProp START'); + console.info("[richtextProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[richtextProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[richtextProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('richtext') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testRichtextClassPropNone + * @tc.desc ACE + */ + it('testRichtextClassPropNone', 0, async function (done) { + console.info('testRichtextClassPropNone START'); + console.info("[richtextProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[richtextProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[richtextProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('richtext') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[richtextProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testRichtextStyleProp + * @tc.desc ACE + */ + it('testRichtextStyleProp', 0, async function (done) { + console.info('testRichtextStyleProp START'); + console.info("[richtextProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.styleProp); + console.info("[richtextProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[richtextProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('richtext') + expect(obj.$attrs.id).assertEqual('styleProp') + expect(obj.$attrs.style).assertEqual('visibility: visible;') + console.info("[richtextProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/svgTextProps.test.js b/ace/ace_standard/src/main/js/default/test/svgTextProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..a242a8324690db9344330e30f708131f5e470904 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/svgTextProps.test.js @@ -0,0 +1,660 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('toolbarPropsJsTest', function () { + + var name = 'svgText', nameA = 'Toolbar', labelName = 'text'; + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('['+name+'PropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/svg_text/prop/index' + } + try { + result = router.push(options) + console.info("push "+name+"Props page success " + JSON.stringify(result)); + } catch (err) { + console.error("push "+name+"Props page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('['+name+'PropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextIdProp + * @tc.desc ACE + */ + it('test'+nameA+'IdProp', 0, async function (done) { + console.info('test'+nameA+'IdProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextXPropLength + * @tc.desc ACE + */ + it('test'+nameA+'XPropLength', 0, async function (done) { + console.info('test'+nameA+'XPropLength START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.xPropLength); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('xPropLength') + expect(obj.$attrs.x).assertEqual('30') + console.info("["+name+"Props] get x value is: " + JSON.stringify(obj.$attrs.x)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextXPropPercentage + * @tc.desc ACE + */ + it('test'+nameA+'XPropPercentage', 0, async function (done) { + console.info('test'+nameA+'XPropPercentage START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.xPropPercentage); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('xPropPercentage') + expect(obj.$attrs.x).assertEqual('60%') + console.info("["+name+"Props] get x value is: " + JSON.stringify(obj.$attrs.x)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextXPropNone + * @tc.desc ACE + */ + it('test'+nameA+'XPropNone', 0, async function (done) { + console.info('test'+nameA+'XPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.xPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('xPropNone') + expect(obj.$attrs.x).assertEqual(undefined) + console.info("["+name+"Props] get x value is: " + JSON.stringify(obj.$attrs.x)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextYPropLength + * @tc.desc ACE + */ + it('test'+nameA+'YPropLength', 0, async function (done) { + console.info('test'+nameA+'YPropLength START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.yPropLength); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('yPropLength') + expect(obj.$attrs.y).assertEqual('10') + console.info("["+name+"Props] get y value is: " + JSON.stringify(obj.$attrs.y)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextYPropPercentage + * @tc.desc ACE + */ + it('test'+nameA+'YPropPercentage', 0, async function (done) { + console.info('test'+nameA+'YPropPercentage START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.yPropPercentage); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('yPropPercentage') + expect(obj.$attrs.y).assertEqual('100%') + console.info("["+name+"Props] get y value is: " + JSON.stringify(obj.$attrs.y)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextYPropNone + * @tc.desc ACE + */ + it('test'+nameA+'YPropNone', 0, async function (done) { + console.info('test'+nameA+'YPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.yPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('yPropNone') + expect(obj.$attrs.y).assertEqual(undefined) + console.info("["+name+"Props] get y value is: " + JSON.stringify(obj.$attrs.y)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextDxPropLength + * @tc.desc ACE + */ + it('test'+nameA+'DxPropLength', 0, async function (done) { + console.info('test'+nameA+'DxPropLength START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dxPropLength); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dxPropLength') + expect(obj.$attrs.dx).assertEqual('30') + console.info("["+name+"Props] get dx value is: " + JSON.stringify(obj.$attrs.dx)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextDxPropPercentage + * @tc.desc ACE + */ + it('test'+nameA+'DxPropPercentage', 0, async function (done) { + console.info('test'+nameA+'DxPropPercentage START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dxPropPercentage); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dxPropPercentage') + expect(obj.$attrs.dx).assertEqual('60%') + console.info("["+name+"Props] get dx value is: " + JSON.stringify(obj.$attrs.dx)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextDxPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DxPropNone', 0, async function (done) { + console.info('test'+nameA+'DxPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dxPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dxPropNone') + expect(obj.$attrs.dx).assertEqual(undefined) + console.info("["+name+"Props] get dx value is: " + JSON.stringify(obj.$attrs.dx)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextDyPropLength + * @tc.desc ACE + */ + it('test'+nameA+'DyPropLength', 0, async function (done) { + console.info('test'+nameA+'DyPropLength START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dyPropLength); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dyPropLength') + expect(obj.$attrs.dy).assertEqual('10') + console.info("["+name+"Props] get dy value is: " + JSON.stringify(obj.$attrs.dy)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextDyPropPercentage + * @tc.desc ACE + */ + it('test'+nameA+'DyPropPercentage', 0, async function (done) { + console.info('test'+nameA+'DyPropPercentage START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dyPropPercentage); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dyPropPercentage') + expect(obj.$attrs.dy).assertEqual('100%') + console.info("["+name+"Props] get dy value is: " + JSON.stringify(obj.$attrs.dy)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextDyPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DyPropNone', 0, async function (done) { + console.info('test'+nameA+'DyPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dyPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dyPropNone') + expect(obj.$attrs.dy).assertEqual(undefined) + console.info("["+name+"Props] get dy value is: " + JSON.stringify(obj.$attrs.dy)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextRotateProp + * @tc.desc ACE + */ + it('test'+nameA+'RotateProp', 0, async function (done) { + console.info('test'+nameA+'RotateProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.rotateProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('rotateProp') + expect(obj.$attrs.rotate).assertEqual('30') + console.info("["+name+"Props] get rotate value is: " + JSON.stringify(obj.$attrs.rotate)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextRotatePropNone + * @tc.desc ACE + */ + it('test'+nameA+'RotatePropNone', 0, async function (done) { + console.info('test'+nameA+'RotatePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.rotatePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('rotatePropNone') + expect(obj.$attrs.rotate).assertEqual(undefined) + console.info("["+name+"Props] get rotate value is: " + JSON.stringify(obj.$attrs.rotate)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextFontSizeProp + * @tc.desc ACE + */ + it('test'+nameA+'FontSizeProp', 0, async function (done) { + console.info('test'+nameA+'FontSizeProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fontSizeProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fontSizeProp') + expect(obj.$attrs.fontSize).assertEqual('20') + console.info("["+name+"Props] get fontSize value is: " + JSON.stringify(obj.$attrs.fontSize)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextFontSizePropNone + * @tc.desc ACE + */ + it('test'+nameA+'FontSizePropNone', 0, async function (done) { + console.info('test'+nameA+'FontSizePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fontSizePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fontSizePropNone') + expect(obj.$attrs.fontSize).assertEqual(undefined) + console.info("["+name+"Props] get fontSize value is: " + JSON.stringify(obj.$attrs.fontSize)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextFillProp + * @tc.desc ACE + */ + it('test'+nameA+'FillProp', 0, async function (done) { + console.info('test'+nameA+'FillProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillProp') + expect(obj.$attrs.fill).assertEqual('red') + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextFillPropNone + * @tc.desc ACE + */ + it('test'+nameA+'FillPropNone', 0, async function (done) { + console.info('test'+nameA+'FillPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillPropNone') + expect(obj.$attrs.fill).assertEqual(undefined) + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextFillOpacityProp + * @tc.desc ACE + */ + it('test'+nameA+'FillOpacityProp', 0, async function (done) { + console.info('test'+nameA+'FillOpacityProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillOpacityProp') + expect(obj.$attrs.fillOpacity).assertEqual('0.5') + console.info("["+name+"Props] get fillOpacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextFillOpacityPropNone + * @tc.desc ACE + */ + it('test'+nameA+'FillOpacityPropNone', 0, async function (done) { + console.info('test'+nameA+'FillOpacityPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillOpacityPropNone') + expect(obj.$attrs.fillOpacity).assertEqual(undefined) + console.info("["+name+"Props] get fillOpacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextOpacityProp + * @tc.desc ACE + */ + it('test'+nameA+'OpacityProp', 0, async function (done) { + console.info('test'+nameA+'OpacityProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('opacityProp') + expect(obj.$attrs.opacity).assertEqual('0.8') + console.info("["+name+"Props] get opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextOpacityPropNone + * @tc.desc ACE + */ + it('test'+nameA+'OpacityPropNone', 0, async function (done) { + console.info('test'+nameA+'OpacityPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('opacityPropNone') + expect(obj.$attrs.opacity).assertEqual(undefined) + console.info("["+name+"Props] get opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextStrokeProp + * @tc.desc ACE + */ + it('test'+nameA+'StrokeProp', 0, async function (done) { + console.info('test'+nameA+'StrokeProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeProp') + expect(obj.$attrs.stroke).assertEqual('#ff00ff') + console.info("["+name+"Props] get stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextStrokePropNone + * @tc.desc ACE + */ + it('test'+nameA+'StrokePropNone', 0, async function (done) { + console.info('test'+nameA+'StrokePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokePropNone') + expect(obj.$attrs.stroke).assertEqual(undefined) + console.info("["+name+"Props] get stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextStrokeWidthProp + * @tc.desc ACE + */ + it('test'+nameA+'StrokeWidthProp', 0, async function (done) { + console.info('test'+nameA+'StrokeWidthProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeWidthProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeWidthProp') + expect(obj.$attrs.strokeWidth).assertEqual('2') + console.info("["+name+"Props] get strokeWidth value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextStrokeWidthPropNone + * @tc.desc ACE + */ + it('test'+nameA+'StrokeWidthPropNone', 0, async function (done) { + console.info('test'+nameA+'StrokeWidthPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeWidthPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeWidthPropNone') + expect(obj.$attrs.strokeWidth).assertEqual(undefined) + console.info("["+name+"Props] get strokeWidth value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextStrokeOpacityProp + * @tc.desc ACE + */ + it('test'+nameA+'StrokeOpacityProp', 0, async function (done) { + console.info('test'+nameA+'StrokeOpacityProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeOpacityProp') + expect(obj.$attrs.strokeOpacity).assertEqual('0.4') + console.info("["+name+"Props] get strokeOpacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTextStrokeOpacityPropNone + * @tc.desc ACE + */ + it('test'+nameA+'StrokeOpacityPropNone', 0, async function (done) { + console.info('test'+nameA+'StrokeOpacityPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeOpacityPropNone') + expect(obj.$attrs.strokeOpacity).assertEqual(undefined) + console.info("["+name+"Props] get strokeOpacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/textPathProps.test.js b/ace/ace_standard/src/main/js/default/test/textPathProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..afc79b193dc943a09c5f99a7ba35a958a3bd6f10 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/textPathProps.test.js @@ -0,0 +1,520 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('toolbarPropsJsTest', function () { + + var name = 'textPath', nameA = 'TextPath', labelName = 'textPath'; + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('['+name+'PropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/'+name+'/prop/index' + } + try { + result = router.push(options) + console.info("push "+name+"Props page success " + JSON.stringify(result)); + } catch (err) { + console.error("push "+name+"Props page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('['+name+'PropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanIdProp + * @tc.desc ACE + */ + it('test'+nameA+'IdProp', 0, async function (done) { + console.info('test'+nameA+'IdProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathPathProp + * @tc.desc ACE + */ + it('test'+nameA+'PathProp', 0, async function (done) { + console.info('test'+nameA+'PathProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pathProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('pathProp') + expect(obj.$attrs.path).assertEqual('M0,20 Q50,20 100,20') + console.info("["+name+"Props] get path value is: " + JSON.stringify(obj.$attrs.path)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathPathPropNone + * @tc.desc ACE + */ + it('test'+nameA+'PathPropNone', 0, async function (done) { + console.info('test'+nameA+'PathPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pathPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('pathPropNone') + expect(obj.$attrs.path).assertEqual(undefined) + console.info("["+name+"Props] get path value is: " + JSON.stringify(obj.$attrs.path)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathStartOffsetPropLength + * @tc.desc ACE + */ + it('test'+nameA+'StartOffsetPropLength', 0, async function (done) { + console.info('test'+nameA+'StartOffsetPropLength START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.startOffsetPropLength); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('startOffsetPropLength') + expect(obj.$attrs.startoffset).assertEqual('30px') + console.info("["+name+"Props] get x startOffset is: " + JSON.stringify(obj.$attrs.startoffset)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathStartOffsetPropPercentage + * @tc.desc ACE + */ + it('test'+nameA+'StartOffsetPropPercentage', 0, async function (done) { + console.info('test'+nameA+'StartOffsetPropPercentage START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.startOffsetPropPercentage); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('startOffsetPropPercentage') + expect(obj.$attrs.x).startoffset('60%') + console.info("["+name+"Props] get startOffset value is: " + JSON.stringify(obj.$attrs.startoffset)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathStartOffsetPropNone + * @tc.desc ACE + */ + it('test'+nameA+'StartOffsetPropNone', 0, async function (done) { + console.info('test'+nameA+'StartOffsetPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.startOffsetPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('startOffsetPropNone') + expect(obj.$attrs.startoffset).assertEqual(undefined) + console.info("["+name+"Props] get startOffset value is: " + JSON.stringify(obj.$attrs.startoffset)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathByProp + * @tc.desc ACE + */ + it('test'+nameA+'ByProp', 0, async function (done) { + console.info('test'+nameA+'ByProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.byProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('byProp') + expect(obj.$attrs.by).assertEqual('1') + console.info("["+name+"Props] get by value is: " + JSON.stringify(obj.$attrs.by)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextByPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ByPropNone', 0, async function (done) { + console.info('test'+nameA+'ByPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.byPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('byPropNone') + expect(obj.$attrs.by).assertEqual(undefined) + console.info("["+name+"Props] get by value is: " + JSON.stringify(obj.$attrs.by)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathFontSizeProp + * @tc.desc ACE + */ + it('test'+nameA+'FontSizeProp', 0, async function (done) { + console.info('test'+nameA+'FontSizeProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fontSizeProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fontSizeProp') + expect(obj.$attrs.fontSize).assertEqual('20') + console.info("["+name+"Props] get fontSize value is: " + JSON.stringify(obj.$attrs.fontSize)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathFontSizePropNone + * @tc.desc ACE + */ + it('test'+nameA+'FontSizePropNone', 0, async function (done) { + console.info('test'+nameA+'FontSizePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fontSizePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fontSizePropNone') + expect(obj.$attrs.fontSize).assertEqual(undefined) + console.info("["+name+"Props] get fontSize value is: " + JSON.stringify(obj.$attrs.fontSize)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathFillProp + * @tc.desc ACE + */ + it('test'+nameA+'FillProp', 0, async function (done) { + console.info('test'+nameA+'FillProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillProp') + expect(obj.$attrs.fill).assertEqual('red') + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathFillPropNone + * @tc.desc ACE + */ + it('test'+nameA+'FillPropNone', 0, async function (done) { + console.info('test'+nameA+'FillPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillPropNone') + expect(obj.$attrs.fill).assertEqual(undefined) + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathFillOpacityProp + * @tc.desc ACE + */ + it('test'+nameA+'FillOpacityProp', 0, async function (done) { + console.info('test'+nameA+'FillOpacityProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillOpacityProp') + expect(obj.$attrs.fillOpacity).assertEqual('0.5') + console.info("["+name+"Props] get fillOpacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathFillOpacityPropNone + * @tc.desc ACE + */ + it('test'+nameA+'FillOpacityPropNone', 0, async function (done) { + console.info('test'+nameA+'FillOpacityPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillOpacityPropNone') + expect(obj.$attrs.fillOpacity).assertEqual(undefined) + console.info("["+name+"Props] get fillOpacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathOpacityProp + * @tc.desc ACE + */ + it('test'+nameA+'OpacityProp', 0, async function (done) { + console.info('test'+nameA+'OpacityProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('opacityProp') + expect(obj.$attrs.opacity).assertEqual('0.5') + console.info("["+name+"Props] get opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathOpacityPropNone + * @tc.desc ACE + */ + it('test'+nameA+'OpacityPropNone', 0, async function (done) { + console.info('test'+nameA+'OpacityPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('opacityPropNone') + expect(obj.$attrs.opacity).assertEqual(undefined) + console.info("["+name+"Props] get opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathStrokeProp + * @tc.desc ACE + */ + it('test'+nameA+'StrokeProp', 0, async function (done) { + console.info('test'+nameA+'StrokeProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeProp') + expect(obj.$attrs.stroke).assertEqual('#ff00ff') + console.info("["+name+"Props] get stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathStrokePropNone + * @tc.desc ACE + */ + it('test'+nameA+'StrokePropNone', 0, async function (done) { + console.info('test'+nameA+'StrokePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokePropNone') + expect(obj.$attrs.stroke).assertEqual(undefined) + console.info("["+name+"Props] get stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathStrokeWidthProp + * @tc.desc ACE + */ + it('test'+nameA+'StrokeWidthProp', 0, async function (done) { + console.info('test'+nameA+'StrokeWidthProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeWidthProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeWidthProp') + expect(obj.$attrs.strokeWidth).assertEqual('2') + console.info("["+name+"Props] get strokeWidth value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathStrokeWidthPropNone + * @tc.desc ACE + */ + it('test'+nameA+'StrokeWidthPropNone', 0, async function (done) { + console.info('test'+nameA+'StrokeWidthPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeWidthPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeWidthPropNone') + expect(obj.$attrs.strokeWidth).assertEqual(undefined) + console.info("["+name+"Props] get strokeWidth value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathStrokeOpacityProp + * @tc.desc ACE + */ + it('test'+nameA+'StrokeOpacityProp', 0, async function (done) { + console.info('test'+nameA+'StrokeOpacityProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeOpacityProp') + expect(obj.$attrs.strokeOpacity).assertEqual('0.4') + console.info("["+name+"Props] get strokeOpacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathStrokeOpacityPropNone + * @tc.desc ACE + */ + it('test'+nameA+'StrokeOpacityPropNone', 0, async function (done) { + console.info('test'+nameA+'StrokeOpacityPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeOpacityPropNone') + expect(obj.$attrs.strokeOpacity).assertEqual(undefined) + console.info("["+name+"Props] get strokeOpacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/toggleProps.test.js b/ace/ace_standard/src/main/js/default/test/toggleProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..842d2b85c6415b8f0659c407eeddaf14b8140c61 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/toggleProps.test.js @@ -0,0 +1,753 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('togglePropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[togglePropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/toggle/prop/index' + } + try { + result = router.push(options) + console.info("push toggleProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push toggleProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[togglePropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleIdProp + * @tc.desc ACE + */ + it('testtoggleIdProp', 0, async function (done) { + console.info('testtoggleIdProp START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleClassProp + * @tc.desc ACE + */ + it('testtoggleClassProp', 0, async function (done) { + console.info('testtoggleClassProp START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleClassPropNone + * @tc.desc ACE + */ + it('testtoggleClassPropNone', 0, async function (done) { + console.info('testtoggleClassPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[toggleProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleStyleProp + * @tc.desc ACEs + */ + // it('testtoggleStyleProp', 0, async function (done) { + // console.info('testtoggleStyleProp START'); + // console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.styleProp); + // console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('toggle') + // expect(obj.$attrs.id).assertEqual('styleProp') + // expect(obj.$attrs.style).assertEqual(undefined) + // console.info("[toggleProps] get style value is: " + JSON.stringify(obj.$attrs.style)); + // + // expect(obj.$styles.width).assertEqual(undefined); + // console.info("[toggleProps] get style width value is: " + JSON.stringify(obj.$styles.width)); + // expect(obj.$styles.height).assertEqual(undefined); + // console.info("[toggleProps] get style height value is: " + JSON.stringify(obj.$styles.height)); + // expect(obj.$styles.get('background-color')).assertEqual(undefined); + // console.info("[toggleProps] get style background-color value is: " + JSON.stringify(obj.$styles.get('background-color'))); + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleRefProp + * @tc.desc ACE + */ + it('testtoggleRefProp', 0, async function (done) { + console.info('testtoggleRefProp START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleRefPropNone + * @tc.desc ACE + */ + it('testtoggleRefPropNone', 0, async function (done) { + console.info('testtoggleRefPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("[toggleProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleDisabledPropTrue + * @tc.desc ACE + */ + it('testtoggleDisabledPropTrue', 0, async function (done) { + console.info('testtoggleDisabledPropTrue START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleDisabledPropFalse + * @tc.desc ACE + */ + it('testtoggleDisabledPropFalse', 0, async function (done) { + console.info('testtoggleDisabledPropFalse START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleDisabledPropNone + * @tc.desc ACE + */ + it('testtoggleDisabledPropNone', 0, async function (done) { + console.info('testtoggleDisabledPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleFocusablePropTrue + * @tc.desc ACE + */ + it('testtoggleFocusablePropTrue', 0, async function (done) { + console.info('testtoggleFocusablePropTrue START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleFocusablePropFalse + * @tc.desc ACE + */ + it('testtoggleFocusablePropFalse', 0, async function (done) { + console.info('testtoggleFocusablePropFalse START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleFocusablePropNone + * @tc.desc ACE + */ + it('testtoggleFocusablePropNone', 0, async function (done) { + console.info('testtoggleFocusablePropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleDataProp + * @tc.desc ACE + */ + it('testtoggleDataProp', 0, async function (done) { + console.info('testtoggleDataProp START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.datatoggle).assertEqual(undefined); + console.info("[toggleProps] get datatoggle value is: " + JSON.stringify(obj.$attrs.datatoggle)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleDataPropNone + * @tc.desc ACE + */ + it('testtoggleDataPropNone', 0, async function (done) { + console.info('testtoggleDataPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.datatoggle).assertEqual(undefined) + console.info("[toggleProps] get datatoggle value is: " + JSON.stringify(obj.$attrs.datatoggle)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleClickEffectPropSmall + * @tc.desc ACE + */ + it('testtoggleClickEffectPropSmall', 0, async function (done) { + console.info('testtoggleClickEffectPropSmall START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleClickEffectPropMedium + * @tc.desc ACE + */ + it('testtoggleClickEffectPropMedium', 0, async function (done) { + console.info('testtoggleClickEffectPropMedium START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleClickEffectPropLarge + * @tc.desc ACE + */ + it('testtoggleClickEffectPropLarge', 0, async function (done) { + console.info('testtoggleClickEffectPropLarge START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleClickEffectPropNone + * @tc.desc ACE + */ + it('testtoggleClickEffectPropNone', 0, async function (done) { + console.info('testtoggleClickEffectPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("[toggleProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleDirPropRtl + * @tc.desc ACE + */ + it('testtoggleDirPropRtl', 0, async function (done) { + console.info('testtoggleDirPropRtl START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleDirPropLtr + * @tc.desc ACE + */ + it('testtoggleDirPropLtr', 0, async function (done) { + console.info('testtoggleDirPropLtr START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleDirPropAuto + * @tc.desc ACE + */ + it('testtoggleDirPropAuto', 0, async function (done) { + console.info('testtoggleDirPropAuto START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleDirPropNone + * @tc.desc ACE + */ + it('testtoggleDirPropNone', 0, async function (done) { + console.info('testtoggleDirPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleForPropNull + * @tc.desc ACE + */ + it('testtoggleForPropNull', 0, async function (done) { + console.info('testtoggleForPropNull START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[toggleProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleForPropOne + * @tc.desc ACE + */ + it('testtoggleForPropOne', 0, async function (done) { + console.info('testtoggleForPropOne START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[toggleProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleForPropThree + * @tc.desc ACE + */ + it('testtoggleForPropThree', 0, async function (done) { + console.info('testtoggleForPropThree START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[toggleProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleIfPropTrue + * @tc.desc ACE + */ + it('testtoggleIfPropTrue', 0, async function (done) { + console.info('testtoggleIfPropTrue START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("[toggleProps] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleShowPropTrue + * @tc.desc ACE + */ + it('testtoggleShowPropTrue', 0, async function (done) { + console.info('testtoggleShowPropTrue START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("[toggleProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleShowPropFalse + * @tc.desc ACE + */ + it('testtoggleShowPropFalse', 0, async function (done) { + console.info('testtoggleShowPropFalse START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("[toggleProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleShowPropNone + * @tc.desc ACE + */ + it('testtoggleShowPropNone', 0, async function (done) { + console.info('testtoggleShowPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual("true") + console.info("[toggleProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleShowPropNone + * @tc.desc ACE + */ + it('testtoggleValuePropNone', 0, async function (done) { + console.info('testtoggleXsPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.valueNone); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('valueNone') + expect(obj.$attrs.value).assertEqual(undefined) + console.info("[toggleProps] get value value is: " + JSON.stringify(obj.$attrs.value)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleShowPropNone + * @tc.desc ACE + */ + it('testtoggleValueProp', 0, async function (done) { + console.info('testtoggleXsPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.value); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('value') + expect(obj.$attrs.value).assertEqual('please--input') + console.info("[toggleProps] get value value is: " + JSON.stringify(obj.$attrs.value)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleShowPropNone + * @tc.desc ACE + */ + it('testtoggleCheckedPropNone', 0, async function (done) { + console.info('testtoggleXsPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.checkedNone); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('checkedNone') + expect(obj.$attrs.checked).assertEqual(undefined) + console.info("[toggleProps] get checked value is: " + JSON.stringify(obj.$attrs.checked)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleShowPropNone + * @tc.desc ACE + */ + it('testtoggleCheckedPropTrue', 0, async function (done) { + console.info('testtoggleXsPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.checkedTrue); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('checkedTrue') + expect(obj.$attrs.checked).assertEqual('true') + console.info("[toggleProps] get checked value is: " + JSON.stringify(obj.$attrs.checked)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testtoggleShowPropNone + * @tc.desc ACE + */ + it('testtoggleCheckedPropFalse', 0, async function (done) { + console.info('testtoggleXsPropNone START'); + console.info("[toggleProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.checkedFalse); + console.info("[toggleProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[toggleProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('toggle') + expect(obj.$attrs.id).assertEqual('checkedFalse') + expect(obj.$attrs.checked).assertEqual('false') + console.info("[toggleProps] get checked value is: " + JSON.stringify(obj.$attrs.checked)); + done(); + }); +}); + + + diff --git a/ace/ace_standard/src/main/js/default/test/toolbarItemProps.test.js b/ace/ace_standard/src/main/js/default/test/toolbarItemProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..f3950053d164e4e0e1b22aa27679abc9a6039be3 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/toolbarItemProps.test.js @@ -0,0 +1,769 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('toolbarPropsJsTest', function () { + + var name = 'toolbarItem', nameA = 'ToolbarItem', labelName = "toolbar-item"; + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('['+name+'PropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/'+name+'/prop/index' + } + try { + result = router.push(options) + console.info("push "+name+"Props page success " + JSON.stringify(result)); + } catch (err) { + console.error("push "+name+"Props page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('['+name+'PropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarIdProp + * @tc.desc ACE + */ + it('test'+nameA+'IdProp', 0, async function (done) { + console.info('test'+nameA+'IdProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClassProp + * @tc.desc ACE + */ + it('test'+nameA+'ClassProp', 0, async function (done) { + console.info('test'+nameA+'ClassProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClassPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ClassPropNone', 0, async function (done) { + console.info('test'+nameA+'ClassPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("["+name+"Props] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivStyleProp + * @tc.desc ACEs + */ +// it('testDivStyleProp', 0, async function (done) { +// console.info('testDivStyleProp START'); +// console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); +// +// let obj = JSON.parse(globalThis.value.styleProp); +// console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); +// console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); +// +// expect(obj.$type).assertEqual('div') +// expect(obj.$attrs.id).assertEqual('styleProp') +// expect(obj.$attrs.style).assertEqual(undefined) +// console.info("[divProps] get style value is: " + JSON.stringify(obj.$attrs.style)); +// +// expect(obj.$styles.width).assertEqual(undefined); +// console.info("[divProps] get style width value is: " + JSON.stringify(obj.$styles.width)); +// expect(obj.$styles.height).assertEqual(undefined); +// console.info("[divProps] get style height value is: " + JSON.stringify(obj.$styles.height)); +// expect(obj.$styles.get('background-color')).assertEqual(undefined); +// done(); +// }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarRefProp + * @tc.desc ACE + */ + it('test'+nameA+'RefProp', 0, async function (done) { + console.info('test'+nameA+'RefProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarRefPropNone + * @tc.desc ACE + */ + it('test'+nameA+'RefPropNone', 0, async function (done) { + console.info('test'+nameA+'RefPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("["+name+"Props] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDisabledPropTrue + * @tc.desc ACE + */ + it('test'+nameA+'DisabledPropTrue', 0, async function (done) { + console.info('test'+nameA+'DisabledPropTrue START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDisabledPropFalse + * @tc.desc ACE + */ + it('test'+nameA+'DisabledPropFalse', 0, async function (done) { + console.info('test'+nameA+'DisabledPropFalse START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDisabledPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DisabledPropNone', 0, async function (done) { + console.info('test'+nameA+'DisabledPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarFocusablePropTrue + * @tc.desc ACE + */ + it('test'+nameA+'FocusablePropTrue', 0, async function (done) { + console.info('test'+nameA+'FocusablePropTrue START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarFocusablePropFalse + * @tc.desc ACE + */ + it('test'+nameA+'FocusablePropFalse', 0, async function (done) { + console.info('test'+nameA+'FocusablePropFalse START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarFocusablePropNone + * @tc.desc ACE + */ + it('test'+nameA+'FocusablePropNone', 0, async function (done) { + console.info('test'+nameA+'FocusablePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDataProp + * @tc.desc ACE + */ + it('test'+nameA+'DataProp', 0, async function (done) { + console.info('test'+nameA+'DataProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.dataDiv).assertEqual(undefined); + console.info("["+name+"Props] get dataDiv value is: " + JSON.stringify(obj.$attrs.dataDiv)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDataPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DataPropNone', 0, async function (done) { + console.info('test'+nameA+'DataPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.dataDiv).assertEqual(undefined) + console.info("["+name+"Props] get dataDiv value is: " + JSON.stringify(obj.$attrs.dataDiv)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClickEffectPropSmall + * @tc.desc ACE + */ + it('test'+nameA+'ClickEffectPropSmall', 0, async function (done) { + console.info('test'+nameA+'ClickEffectPropSmall START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClickEffectPropMedium + * @tc.desc ACE + */ + it('test'+nameA+'ClickEffectPropMedium', 0, async function (done) { + console.info('test'+nameA+'ClickEffectPropMedium START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClickEffectPropLarge + * @tc.desc ACE + */ + it('test'+nameA+'ClickEffectPropLarge', 0, async function (done) { + console.info('test'+nameA+'ClickEffectPropLarge START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClickEffectPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ClickEffectPropNone', 0, async function (done) { + console.info('test'+nameA+'ClickEffectPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("["+name+"Props] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDirPropRtl + * @tc.desc ACE + */ + it('test'+nameA+'DirPropRtl', 0, async function (done) { + console.info('test'+nameA+'DirPropRtl START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDirPropLtr + * @tc.desc ACE + */ + it('test'+nameA+'DirPropLtr', 0, async function (done) { + console.info('test'+nameA+'DirPropLtr START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDirPropAuto + * @tc.desc ACE + */ + it('test'+nameA+'DirPropAuto', 0, async function (done) { + console.info('test'+nameA+'DirPropAuto START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDirPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DirPropNone', 0, async function (done) { + console.info('test'+nameA+'DirPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarForPropNull + * @tc.desc ACE + */ + it('test'+nameA+'ForPropNull', 0, async function (done) { + console.info('test'+nameA+'ForPropNull START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("["+name+"Props] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarForPropOne + * @tc.desc ACE + */ + it('test'+nameA+'ForPropOne', 0, async function (done) { + console.info('test'+nameA+'ForPropOne START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("["+name+"Props] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarForPropThree + * @tc.desc ACE + */ + it('test'+nameA+'ForPropThree', 0, async function (done) { + console.info('test'+nameA+'ForPropThree START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("["+name+"Props] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarIfPropTrue + * @tc.desc ACE + */ + it('test'+nameA+'IfPropTrue', 0, async function (done) { + console.info('test'+nameA+'IfPropTrue START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("["+name+"Props] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivIfPropFalse + * @tc.desc ACE + */ + // it('testDivIfPropFalse', 0, async function (done) { + // console.info('testDivIfPropFalse START'); + // console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropFalse); + // console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('div') + // expect(obj.$attrs.id).assertEqual('ifPropFalse') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivIfPropNone + * @tc.desc ACE + */ + // it('testDivIfPropNone', 0, async function (done) { + // console.info('testDivIfPropNone START'); + // console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropNone); + // console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('div') + // expect(obj.$attrs.id).assertEqual('ifPropNone') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarShowPropTrue + * @tc.desc ACE + */ + it('test'+nameA+'ShowPropTrue', 0, async function (done) { + console.info('test'+nameA+'ShowPropTrue START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("["+name+"Props] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarShowPropFalse + * @tc.desc ACE + */ + it('test'+nameA+'ShowPropFalse', 0, async function (done) { + console.info('test'+nameA+'ShowPropFalse START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("["+name+"Props] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarShowPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ShowPropNone', 0, async function (done) { + console.info('test'+nameA+'ShowPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual('true') + console.info("["+name+"Props] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarItemValueProp + * @tc.desc ACE + */ + it('test'+nameA+'ValuePropNone', 0, async function (done) { + console.info('test'+nameA+'ShowPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.valueProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('valueProp') + expect(obj.$attrs.value).assertEqual('text') + console.info("["+name+"Props] get value value is: " + JSON.stringify(obj.$attrs.value)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarItemValuePropNone + * @tc.desc ACE + */ + it('test'+nameA+'ValuePropNone', 0, async function (done) { + console.info('test'+nameA+'ShowPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.valuePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('valuePropNone') + expect(obj.$attrs.value).assertEqual(undefined) + console.info("["+name+"Props] get value value is: " + JSON.stringify(obj.$attrs.value)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarItemIconProp + * @tc.desc ACE + */ + it('test'+nameA+'ValuePropNone', 0, async function (done) { + console.info('test'+nameA+'ShowPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.iconProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('iconProp') + expect(obj.$attrs.icon).assertEqual('common/images/icon.png') + console.info("["+name+"Props] get icon value is: " + JSON.stringify(obj.$attrs.icon)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarItemIconPropNone + * @tc.desc ACE + */ + it('test'+nameA+'IconPropNone', 0, async function (done) { + console.info('test'+nameA+'ShowPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.iconPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('iconPropNone') + expect(obj.$attrs.icon).assertEqual(undefined) + console.info("["+name+"Props] get icon value is: " + JSON.stringify(obj.$attrs.icon)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/toolbarProps.test.js b/ace/ace_standard/src/main/js/default/test/toolbarProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..55108137fc6d5e6dedd873b067f54200d620c5e6 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/toolbarProps.test.js @@ -0,0 +1,663 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('toolbarPropsJsTest', function () { + + var name = 'toolbar', nameA = 'Toolbar'; + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('['+name+'PropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/'+name+'/prop/index' + } + try { + result = router.push(options) + console.info("push "+name+"Props page success " + JSON.stringify(result)); + } catch (err) { + console.error("push "+name+"Props page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('['+name+'PropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarIdProp + * @tc.desc ACE + */ + it('test'+nameA+'IdProp', 0, async function (done) { + console.info('test'+nameA+'IdProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClassProp + * @tc.desc ACE + */ + it('test'+nameA+'ClassProp', 0, async function (done) { + console.info('test'+nameA+'ClassProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClassPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ClassPropNone', 0, async function (done) { + console.info('test'+nameA+'ClassPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("["+name+"Props] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarRefProp + * @tc.desc ACE + */ + it('test'+nameA+'RefProp', 0, async function (done) { + console.info('test'+nameA+'RefProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarRefPropNone + * @tc.desc ACE + */ + it('test'+nameA+'RefPropNone', 0, async function (done) { + console.info('test'+nameA+'RefPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("["+name+"Props] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDisabledPropTrue + * @tc.desc ACE + */ + it('test'+nameA+'DisabledPropTrue', 0, async function (done) { + console.info('test'+nameA+'DisabledPropTrue START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDisabledPropFalse + * @tc.desc ACE + */ + it('test'+nameA+'DisabledPropFalse', 0, async function (done) { + console.info('test'+nameA+'DisabledPropFalse START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDisabledPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DisabledPropNone', 0, async function (done) { + console.info('test'+nameA+'DisabledPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarFocusablePropTrue + * @tc.desc ACE + */ + it('test'+nameA+'FocusablePropTrue', 0, async function (done) { + console.info('test'+nameA+'FocusablePropTrue START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarFocusablePropFalse + * @tc.desc ACE + */ + it('test'+nameA+'FocusablePropFalse', 0, async function (done) { + console.info('test'+nameA+'FocusablePropFalse START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarFocusablePropNone + * @tc.desc ACE + */ + it('test'+nameA+'FocusablePropNone', 0, async function (done) { + console.info('test'+nameA+'FocusablePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDataProp + * @tc.desc ACE + */ + it('test'+nameA+'DataProp', 0, async function (done) { + console.info('test'+nameA+'DataProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.dataDiv).assertEqual(undefined); + console.info("["+name+"Props] get dataDiv value is: " + JSON.stringify(obj.$attrs.dataDiv)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDataPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DataPropNone', 0, async function (done) { + console.info('test'+nameA+'DataPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.dataDiv).assertEqual(undefined) + console.info("["+name+"Props] get dataDiv value is: " + JSON.stringify(obj.$attrs.dataDiv)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClickEffectPropSmall + * @tc.desc ACE + */ + it('test'+nameA+'ClickEffectPropSmall', 0, async function (done) { + console.info('test'+nameA+'ClickEffectPropSmall START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClickEffectPropMedium + * @tc.desc ACE + */ + it('test'+nameA+'ClickEffectPropMedium', 0, async function (done) { + console.info('test'+nameA+'ClickEffectPropMedium START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClickEffectPropLarge + * @tc.desc ACE + */ + it('test'+nameA+'ClickEffectPropLarge', 0, async function (done) { + console.info('test'+nameA+'ClickEffectPropLarge START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarClickEffectPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ClickEffectPropNone', 0, async function (done) { + console.info('test'+nameA+'ClickEffectPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("["+name+"Props] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDirPropRtl + * @tc.desc ACE + */ + it('test'+nameA+'DirPropRtl', 0, async function (done) { + console.info('test'+nameA+'DirPropRtl START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDirPropLtr + * @tc.desc ACE + */ + it('test'+nameA+'DirPropLtr', 0, async function (done) { + console.info('test'+nameA+'DirPropLtr START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDirPropAuto + * @tc.desc ACE + */ + it('test'+nameA+'DirPropAuto', 0, async function (done) { + console.info('test'+nameA+'DirPropAuto START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarDirPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DirPropNone', 0, async function (done) { + console.info('test'+nameA+'DirPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarForPropNull + * @tc.desc ACE + */ + it('test'+nameA+'ForPropNull', 0, async function (done) { + console.info('test'+nameA+'ForPropNull START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("["+name+"Props] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarForPropOne + * @tc.desc ACE + */ + it('test'+nameA+'ForPropOne', 0, async function (done) { + console.info('test'+nameA+'ForPropOne START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("["+name+"Props] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarForPropThree + * @tc.desc ACE + */ + it('test'+nameA+'ForPropThree', 0, async function (done) { + console.info('test'+nameA+'ForPropThree START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("["+name+"Props] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarIfPropTrue + * @tc.desc ACE + */ + it('test'+nameA+'IfPropTrue', 0, async function (done) { + console.info('test'+nameA+'IfPropTrue START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("["+name+"Props] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivIfPropFalse + * @tc.desc ACE + */ + // it('testDivIfPropFalse', 0, async function (done) { + // console.info('testDivIfPropFalse START'); + // console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropFalse); + // console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('div') + // expect(obj.$attrs.id).assertEqual('ifPropFalse') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivIfPropNone + * @tc.desc ACE + */ + // it('testDivIfPropNone', 0, async function (done) { + // console.info('testDivIfPropNone START'); + // console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropNone); + // console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('div') + // expect(obj.$attrs.id).assertEqual('ifPropNone') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarShowPropTrue + * @tc.desc ACE + */ + it('test'+nameA+'ShowPropTrue', 0, async function (done) { + console.info('test'+nameA+'ShowPropTrue START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("["+name+"Props] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarShowPropFalse + * @tc.desc ACE + */ + it('test'+nameA+'ShowPropFalse', 0, async function (done) { + console.info('test'+nameA+'ShowPropFalse START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("["+name+"Props] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToolbarShowPropNone + * @tc.desc ACE + */ + it('test'+nameA+'ShowPropNone', 0, async function (done) { + console.info('test'+nameA+'ShowPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(name) + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual('true') + console.info("["+name+"Props] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/tspanProps.test.js b/ace/ace_standard/src/main/js/default/test/tspanProps.test.js new file mode 100644 index 0000000000000000000000000000000000000000..80268bc768081fb709ae8c3adf408af7e5e6eef5 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/tspanProps.test.js @@ -0,0 +1,660 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('toolbarPropsJsTest', function () { + + var name = 'tspan', nameA = 'Tspan', labelName = 'tspan'; + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('['+name+'PropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/'+name+'/prop/index' + } + try { + result = router.push(options) + console.info("push "+name+"Props page success " + JSON.stringify(result)); + } catch (err) { + console.error("push "+name+"Props page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('['+name+'PropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanIdProp + * @tc.desc ACE + */ + it('test'+nameA+'IdProp', 0, async function (done) { + console.info('test'+nameA+'IdProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanXPropLength + * @tc.desc ACE + */ + it('test'+nameA+'XPropLength', 0, async function (done) { + console.info('test'+nameA+'XPropLength START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.xPropLength); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('xPropLength') + expect(obj.$attrs.x).assertEqual('30') + console.info("["+name+"Props] get x value is: " + JSON.stringify(obj.$attrs.x)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSvgTspanXPropPercentage + * @tc.desc ACE + */ + it('test'+nameA+'XPropPercentage', 0, async function (done) { + console.info('test'+nameA+'XPropPercentage START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.xPropPercentage); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('xPropPercentage') + expect(obj.$attrs.x).assertEqual('60%') + console.info("["+name+"Props] get x value is: " + JSON.stringify(obj.$attrs.x)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanXPropNone + * @tc.desc ACE + */ + it('test'+nameA+'XPropNone', 0, async function (done) { + console.info('test'+nameA+'XPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.xPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('xPropNone') + expect(obj.$attrs.x).assertEqual(undefined) + console.info("["+name+"Props] get x value is: " + JSON.stringify(obj.$attrs.x)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanYPropLength + * @tc.desc ACE + */ + it('test'+nameA+'YPropLength', 0, async function (done) { + console.info('test'+nameA+'YPropLength START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.yPropLength); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('yPropLength') + expect(obj.$attrs.y).assertEqual('10') + console.info("["+name+"Props] get y value is: " + JSON.stringify(obj.$attrs.y)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanYPropPercentage + * @tc.desc ACE + */ + it('test'+nameA+'YPropPercentage', 0, async function (done) { + console.info('test'+nameA+'YPropPercentage START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.yPropPercentage); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('yPropPercentage') + expect(obj.$attrs.y).assertEqual('100%') + console.info("["+name+"Props] get y value is: " + JSON.stringify(obj.$attrs.y)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanYPropNone + * @tc.desc ACE + */ + it('test'+nameA+'YPropNone', 0, async function (done) { + console.info('test'+nameA+'YPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.yPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('yPropNone') + expect(obj.$attrs.y).assertEqual(undefined) + console.info("["+name+"Props] get y value is: " + JSON.stringify(obj.$attrs.y)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanDxPropLength + * @tc.desc ACE + */ + it('test'+nameA+'DxPropLength', 0, async function (done) { + console.info('test'+nameA+'DxPropLength START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dxPropLength); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dxPropLength') + expect(obj.$attrs.dx).assertEqual('30') + console.info("["+name+"Props] get dx value is: " + JSON.stringify(obj.$attrs.dx)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanDxPropPercentage + * @tc.desc ACE + */ + it('test'+nameA+'DxPropPercentage', 0, async function (done) { + console.info('test'+nameA+'DxPropPercentage START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dxPropPercentage); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dxPropPercentage') + expect(obj.$attrs.dx).assertEqual('60%') + console.info("["+name+"Props] get dx value is: " + JSON.stringify(obj.$attrs.dx)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanDxPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DxPropNone', 0, async function (done) { + console.info('test'+nameA+'DxPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dxPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dxPropNone') + expect(obj.$attrs.dx).assertEqual(undefined) + console.info("["+name+"Props] get dx value is: " + JSON.stringify(obj.$attrs.dx)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanDyPropLength + * @tc.desc ACE + */ + it('test'+nameA+'DyPropLength', 0, async function (done) { + console.info('test'+nameA+'DyPropLength START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dyPropLength); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dyPropLength') + expect(obj.$attrs.dy).assertEqual('10') + console.info("["+name+"Props] get dy value is: " + JSON.stringify(obj.$attrs.dy)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanDyPropPercentage + * @tc.desc ACE + */ + it('test'+nameA+'DyPropPercentage', 0, async function (done) { + console.info('test'+nameA+'DyPropPercentage START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dyPropPercentage); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dyPropPercentage') + expect(obj.$attrs.dy).assertEqual('100%') + console.info("["+name+"Props] get dy value is: " + JSON.stringify(obj.$attrs.dy)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanDyPropNone + * @tc.desc ACE + */ + it('test'+nameA+'DyPropNone', 0, async function (done) { + console.info('test'+nameA+'DyPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dyPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('dyPropNone') + expect(obj.$attrs.dy).assertEqual(undefined) + console.info("["+name+"Props] get dy value is: " + JSON.stringify(obj.$attrs.dy)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanRotateProp + * @tc.desc ACE + */ + it('test'+nameA+'RotateProp', 0, async function (done) { + console.info('test'+nameA+'RotateProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.rotateProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('rotateProp') + expect(obj.$attrs.rotate).assertEqual('30') + console.info("["+name+"Props] get rotate value is: " + JSON.stringify(obj.$attrs.rotate)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanRotatePropNone + * @tc.desc ACE + */ + it('test'+nameA+'RotatePropNone', 0, async function (done) { + console.info('test'+nameA+'RotatePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.rotatePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('rotatePropNone') + expect(obj.$attrs.rotate).assertEqual(undefined) + console.info("["+name+"Props] get rotate value is: " + JSON.stringify(obj.$attrs.rotate)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanFontSizeProp + * @tc.desc ACE + */ + it('test'+nameA+'FontSizeProp', 0, async function (done) { + console.info('test'+nameA+'FontSizeProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fontSizeProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fontSizeProp') + expect(obj.$attrs.fontSize).assertEqual('20') + console.info("["+name+"Props] get fontSize value is: " + JSON.stringify(obj.$attrs.fontSize)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanFontSizePropNone + * @tc.desc ACE + */ + it('test'+nameA+'FontSizePropNone', 0, async function (done) { + console.info('test'+nameA+'FontSizePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fontSizePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fontSizePropNone') + expect(obj.$attrs.fontSize).assertEqual(undefined) + console.info("["+name+"Props] get fontSize value is: " + JSON.stringify(obj.$attrs.fontSize)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanFillProp + * @tc.desc ACE + */ + it('test'+nameA+'FillProp', 0, async function (done) { + console.info('test'+nameA+'FillProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillProp') + expect(obj.$attrs.fill).assertEqual('red') + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanFillPropNone + * @tc.desc ACE + */ + it('test'+nameA+'FillPropNone', 0, async function (done) { + console.info('test'+nameA+'FillPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillPropNone') + expect(obj.$attrs.fill).assertEqual(undefined) + console.info("["+name+"Props] get fill value is: " + JSON.stringify(obj.$attrs.fill)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanFillOpacityProp + * @tc.desc ACE + */ + it('test'+nameA+'FillOpacityProp', 0, async function (done) { + console.info('test'+nameA+'FillOpacityProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillOpacityProp') + expect(obj.$attrs.fillOpacity).assertEqual('0.5') + console.info("["+name+"Props] get fillOpacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanFillOpacityPropNone + * @tc.desc ACE + */ + it('test'+nameA+'FillOpacityPropNone', 0, async function (done) { + console.info('test'+nameA+'FillOpacityPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.fillOpacityPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('fillOpacityPropNone') + expect(obj.$attrs.fillOpacity).assertEqual(undefined) + console.info("["+name+"Props] get fillOpacity value is: " + JSON.stringify(obj.$attrs.fillOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanOpacityProp + * @tc.desc ACE + */ + it('test'+nameA+'OpacityProp', 0, async function (done) { + console.info('test'+nameA+'OpacityProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('opacityProp') + expect(obj.$attrs.opacity).assertEqual('0.8') + console.info("["+name+"Props] get opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanOpacityPropNone + * @tc.desc ACE + */ + it('test'+nameA+'OpacityPropNone', 0, async function (done) { + console.info('test'+nameA+'OpacityPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.opacityPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('opacityPropNone') + expect(obj.$attrs.opacity).assertEqual(undefined) + console.info("["+name+"Props] get opacity value is: " + JSON.stringify(obj.$attrs.opacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanStrokeProp + * @tc.desc ACE + */ + it('test'+nameA+'StrokeProp', 0, async function (done) { + console.info('test'+nameA+'StrokeProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeProp') + expect(obj.$attrs.stroke).assertEqual('#ff00ff') + console.info("["+name+"Props] get stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanStrokePropNone + * @tc.desc ACE + */ + it('test'+nameA+'StrokePropNone', 0, async function (done) { + console.info('test'+nameA+'StrokePropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokePropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokePropNone') + expect(obj.$attrs.stroke).assertEqual(undefined) + console.info("["+name+"Props] get stroke value is: " + JSON.stringify(obj.$attrs.stroke)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanStrokeWidthProp + * @tc.desc ACE + */ + it('test'+nameA+'StrokeWidthProp', 0, async function (done) { + console.info('test'+nameA+'StrokeWidthProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeWidthProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeWidthProp') + expect(obj.$attrs.strokeWidth).assertEqual('2') + console.info("["+name+"Props] get strokeWidth value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanStrokeWidthPropNone + * @tc.desc ACE + */ + it('test'+nameA+'StrokeWidthPropNone', 0, async function (done) { + console.info('test'+nameA+'StrokeWidthPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeWidthPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeWidthPropNone') + expect(obj.$attrs.strokeWidth).assertEqual(undefined) + console.info("["+name+"Props] get strokeWidth value is: " + JSON.stringify(obj.$attrs.strokeWidth)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanStrokeOpacityProp + * @tc.desc ACE + */ + it('test'+nameA+'StrokeOpacityProp', 0, async function (done) { + console.info('test'+nameA+'StrokeOpacityProp START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityProp); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeOpacityProp') + expect(obj.$attrs.strokeOpacity).assertEqual('0.4') + console.info("["+name+"Props] get strokeOpacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanStrokeOpacityPropNone + * @tc.desc ACE + */ + it('test'+nameA+'StrokeOpacityPropNone', 0, async function (done) { + console.info('test'+nameA+'StrokeOpacityPropNone START'); + console.info("["+name+"Props] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.strokeOpacityPropNone); + console.info("["+name+"Props] get inspector value is: " + JSON.stringify(obj)); + console.info("["+name+"Props] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual(labelName) + expect(obj.$attrs.id).assertEqual('strokeOpacityPropNone') + expect(obj.$attrs.strokeOpacity).assertEqual(undefined) + console.info("["+name+"Props] get strokeOpacity value is: " + JSON.stringify(obj.$attrs.strokeOpacity)); + done(); + }); +});