Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5b7e2855
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
5b7e2855
编写于
4月 03, 2023
作者:
O
openharmony_ci
提交者:
Gitee
4月 03, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8330 修改UI和Layout测试用例
Merge pull request !8330 from 王旭鹏/master
上级
cddd9f3d
1b251275
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
266 addition
and
286 deletion
+266
-286
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/TextInputPage.ets
...ui/entry/src/main/ets/MainAbility/pages/TextInputPage.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageAnimator.ets
...ui/entry/src/main/ets/MainAbility/pages/imageAnimator.ets
+2
-14
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageThree.ets
...nt_ui/entry/src/main/ets/MainAbility/pages/imageThree.ets
+21
-16
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/slider.ets
...ponent_ui/entry/src/main/ets/MainAbility/pages/slider.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/textArea.ets
...nent_ui/entry/src/main/ets/MainAbility/pages/textArea.ets
+0
-3
arkui/ace_ets_component_ui/entry/src/main/ets/test/BlankJsunit.test.ets
...component_ui/entry/src/main/ets/test/BlankJsunit.test.ets
+3
-3
arkui/ace_ets_component_ui/entry/src/main/ets/test/CheckBoxJsunit.test.ets
...ponent_ui/entry/src/main/ets/test/CheckBoxJsunit.test.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/GridRowJsunit.test.ets
+6
-14
arkui/ace_ets_component_ui/entry/src/main/ets/test/ListJsunit.test.ets
..._component_ui/entry/src/main/ets/test/ListJsunit.test.ets
+16
-16
arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/RatingJsunit.test.ets
+2
-0
arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/SearchJsunit.test.ets
+22
-22
arkui/ace_ets_component_ui/entry/src/main/ets/test/SelectJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/SelectJsunit.test.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextClockJsunit.test.ets
...onent_ui/entry/src/main/ets/test/TextClockJsunit.test.ets
+17
-30
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextInputJsunit.test.ets
...onent_ui/entry/src/main/ets/test/TextInputJsunit.test.ets
+13
-9
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageOneJsunit.test.ets
...ponent_ui/entry/src/main/ets/test/imageOneJsunit.test.ets
+19
-17
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageThreeJsunit.test.ets
...nent_ui/entry/src/main/ets/test/imageThreeJsunit.test.ets
+29
-32
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageTwoJsunit.test.ets
...ponent_ui/entry/src/main/ets/test/imageTwoJsunit.test.ets
+10
-9
arkui/ace_ets_component_ui/entry/src/main/ets/test/marqueeJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/marqueeJsunit.test.ets
+35
-35
arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/sliderJsunit.test.ets
+5
-5
arkui/ace_ets_component_ui/entry/src/main/ets/test/stepperJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/stepperJsunit.test.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/test/textAreaJsunit.test.ets
...ponent_ui/entry/src/main/ets/test/textAreaJsunit.test.ets
+6
-7
arkui/ace_ets_component_ui/entry/src/main/ets/test/textTwoJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/textTwoJsunit.test.ets
+28
-22
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets
...x/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets
+5
-5
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneMargin.test.ets
...x/justifyContent/Center/AlignCenter_AddOneMargin.test.ets
+5
-5
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets
...st/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets
+5
-5
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneMargin.test.ets
...ontent/SpaceEvenly/AlignSpaceEvenly_AddOneMargin.test.ets
+4
-4
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets
...lex/justifyContent/Start/AlignStart_AddOneMargin.test.ets
+5
-5
未找到文件。
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/TextInputPage.ets
浏览文件 @
5b7e2855
...
...
@@ -26,7 +26,7 @@ struct TextInputPage {
@State maxLength: number = 10
@State copyOption: CopyOptions = CopyOptions.None
@State showPasswordIcon: boolean = false
@State style: TextInputStyle = TextInputStyle.
Inline
@State style: TextInputStyle = TextInputStyle.
Default
@State textAlign: TextAlign = TextAlign.Center
@State text: string = 'onChange'
@State onSubmit: string = ''
...
...
@@ -163,7 +163,7 @@ struct TextInputPage {
.style(TextInputStyle.Inline)
Text('onSubmit:' + this.onSubmit).fontSize(20).margin(10).key('submit')
Text('onEditChange:' + this.onEditChange).fontSize(20).margin(10).key('editChange')
Text('onCopy:' + this.onCopy).fontSize(20).margin(10).
id
('copy')
Text('onCopy:' + this.onCopy).fontSize(20).margin(10).
key
('copy')
Text('onCut:' + this.onCut).fontSize(20).margin(10).key('cut')
Text('onPaste:' + this.onPaste).fontSize(20).margin(10).key('paste')
}.width('100%')
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageAnimator.ets
浏览文件 @
5b7e2855
...
...
@@ -56,24 +56,12 @@ struct ImageAnimatorExample {
if (message.name == 'fixedSize') {
this.fixedSize = message.value
}
if (message.
fillMod
e == 'fillMode') {
if (message.
nam
e == 'fillMode') {
this.fillMode = message.value
}
if (message.
duration
== 'duration') {
if (message.
name
== 'duration') {
this.duration = message.value
}
if (message.widthT == 'widthT') {
this.widthT = message.value
}
if (message.heightT == 'heighT') {
this.heightT = message.value
}
if (message.top == 'top') {
this.top = message.value
}
if (message.left == 'left') {
this.left = message.value
}
}
this.messageManager.registerCallback(callback)
}
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageThree.ets
浏览文件 @
5b7e2855
...
...
@@ -24,9 +24,11 @@ struct ImageExample3 {
private on2off: Resource = $rawfile('bm.jpg')
private off2on: Resource = $rawfile('test3.png')
@State src: Resource = this.on
@State m1:string = "xx"
@State m2:string = "x"
@State name:string = "tt3.png"
@State m1:string = "init"
@State m2:string = "init"
@State m3:string = "init"
@State m4:string = "init"
@State imageName:string = "img1.png"
messageManager:MessageManager = new MessageManager()
...
...
@@ -37,8 +39,8 @@ struct ImageExample3 {
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value)
if (message.name == '
n
ame') {
this.
n
ame = message.value
if (message.name == '
imageN
ame') {
this.
imageN
ame = message.value
}
}
this.messageManager.registerCallback(callback)
...
...
@@ -49,9 +51,9 @@ struct ImageExample3 {
Column() {
Row({ space: 20 }) {
Column() {
Image($rawfile(this.
n
ame))
Image($rawfile(this.
imageN
ame))
.alt($rawfile('img2.png'))
.key('image
2
')
.key('image
1
')
.sourceSize({
width: 900,
height: 900
...
...
@@ -66,37 +68,40 @@ struct ImageExample3 {
})
.onError(() => {
console.log('load image fail')
this.m
1
= "error"
this.m
2
= "error"
})
.overlay('\nwidth: ' + String(this.widthValue) + ' height: ' + String(this.heightValue), {
align: Alignment.Bottom,
offset: { x: 0, y: 20 }
})
Text(this.m1).margin({top:40}).key('text1')
Text(this.m2).margin({top:40}).key('text2')
}
Text(this.m1).margin({top:40}).key('complete')
Text(this.m2).margin({top:40}).key('error')
Text(this.m3).margin({top:40}).key('click')
Text(this.m4).margin({top:40}).key('Finish')
// 为图片添加点击事件,点击完成后加载特定图片。
Image(this.src)
.width(120).height(120)
.onClick(() => {
if (this.src == this.on || this.src == this.off2on) {
this.src = this.on2off
this.m
1
= "click"
this.m
3
= "click"
} else {
this.src = this.off2on
this.m
1
= "click"
this.m
3
= "click"
}
}).key('i
gc
')
}).key('i
mage2
')
.onFinish(() => {
if (this.src == this.off2on) {
this.src = this.on
this.m
2
= "Finish"
this.m
4
= "Finish"
} else {
this.src = this.off
this.m
2
= "Finish"
this.m
4
= "Finish"
}
})
}
}
}.width('100%')
}
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/slider.ets
浏览文件 @
5b7e2855
...
...
@@ -48,8 +48,8 @@ struct SliderExample {
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value)
if (message.name == '
out
SetValueOne') {
this.
out
SetValueOne = message.value
if (message.name == '
vIn
SetValueOne') {
this.
vIn
SetValueOne = message.value
}
if (message.name == 'style') {
this.style = message.value
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/textArea.ets
浏览文件 @
5b7e2855
...
...
@@ -106,9 +106,6 @@ struct TextAreaExample {
.textAlign(this.textAlign)
.caretColor(this.caretColor)
.backgroundColor('#FFFFFF')
.inputFilter("shang",err => {
console.info("te")
})
.copyOption(this.copyOption)
.onChange((value: string) => {
this.message1 = value
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/BlankJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -67,13 +67,13 @@ export default function blankJsunit() {
console.info('blankJsunitUITest_0200 START');
await CommonFunc.sleep(1000);
// 动态修改Blank组件的minwidth
globalThis.value.message.notify({name:'minWith',value:
80
})
await CommonFunc.sleep(
2
000);
globalThis.value.message.notify({name:'minWith',value:
'80'
})
await CommonFunc.sleep(
3
000);
// 获取动态修改后的组件的minwidth
let strJson = getInspectorByKey('bl2');
let obj = JSON.parse(strJson);
console.info("[blankJsunit_0200'] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.min).assertEqual('80.00
px
');
expect(obj.$attrs.min).assertEqual('80.00
vp
');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/CheckBoxJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -109,7 +109,7 @@ export default function checkBoxJsunit() {
let strJson = getInspectorByKey('chek1');
let obj = JSON.parse(strJson);
console.info("[blankJsunit_0400'] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.selectedColor).assertEqual('#FF
000000
');
expect(obj.$attrs.selectedColor).assertEqual('#FF
FFFF21
');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -65,15 +65,13 @@ export default function GridRowJsunit() {
it('GridRowJsunit_0200', 0, async function (done) {
// Modify the properties of component GridRow
console.info('[GridRowJsunit_0200] START');
globalThis.value.message.notify({name:'columns',value:
'12'
})
globalThis.value.message.notify({name:'columns',value:
12
})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'gutter',value:
'x: 7.5, y: 15'
})
globalThis.value.message.notify({name:'gutter',value:
{ x: 12, y: 27}
})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'breakpoints',value:
'12'
})
globalThis.value.message.notify({name:'breakpoints',value:
{ value: ["200vp", "400vp", "600vp"], reference: BreakpointsReference.ComponentSize }
})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'grDirection',value:'12'})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'currentBp',value:'sm'})
globalThis.value.message.notify({name:'grDirection',value:GridRowDirection.RowReverse })
await CommonFunc.sleep(2000);
// Get the propoties value of the GridRow component
...
...
@@ -85,7 +83,7 @@ export default function GridRowJsunit() {
console.info("[GridRowJsunit_0200] direction: " + JSON.stringify(obj.$attrs.direction));
console.info("[GridRowJsunit_0200] gutter: " + JSON.stringify(obj.$attrs.gutter));
expect(obj.$attrs.columns).assertEqual('12');
expect(obj.$attrs.gutter).assertEqual('<
7.500000, 15.0
00000');
expect(obj.$attrs.gutter).assertEqual('<
18.000000, 40.5
00000');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
console.info('[GridRowJsunit_0200] END');
...
...
@@ -115,7 +113,7 @@ export default function GridRowJsunit() {
console.info("[GridRowJsunit_0300] direction: " + JSON.stringify(obj.$attrs.direction));
console.info("[GridRowJsunit_0300] gutter: " + JSON.stringify(obj.$attrs.gutter));
expect(obj.$attrs.columns).assertEqual('12');
expect(obj.$attrs.gutter).assertEqual('<
7.500000, 15.0
00000');
expect(obj.$attrs.gutter).assertEqual('<
18.000000, 40.5
00000');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
console.info('[GridRowJsunit_0300] END');
...
...
@@ -128,14 +126,8 @@ export default function GridRowJsunit() {
let strJson = getInspectorByKey('gridRow_default');
let obj = JSON.parse(strJson);
console.info("[GridRowJsunit_0400] component obj is: " + JSON.stringify(obj));
console.info("[GridRowJsunit_0400] columns: " + JSON.stringify(obj.$attrs.columns));
console.info("[GridRowJsunit_0400] breakpoints: " + JSON.stringify(obj.$attrs.breakpoints));
console.info("[GridRowJsunit_0400] direction: " + JSON.stringify(obj.$attrs.direction));
console.info("[GridRowJsunit_0400] gutter: " + JSON.stringify(obj.$attrs.gutter));
expect(obj.$attrs.columns).assertEqual('12');
expect(obj.$attrs.gutter).assertEqual('<0.000000, 0.000000');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
console.info('[GridRowJsunit_0400] END');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/ListJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -91,20 +91,20 @@ export default function ListJsunit() {
console.info('[ListJsunit_0200] START');
// Verify onScroll function of List component
let gridTop = CommonFunc.getComponentRect('
grid2
');
let gridTop = CommonFunc.getComponentRect('
list
');
let top = gridTop.top
let grid
Left = CommonFunc.getComponentRect('grid2
');
let
left = gridLeft.left
let gridRight = CommonFunc.getComponentRect('
grid2
');
let grid
Bottom = CommonFunc.getComponentRect('list
');
let
bottom = gridBottom.bottom
let gridRight = CommonFunc.getComponentRect('
list
');
let right = gridRight.right
let driver = await UiDriver.create()
await driver.swipe(Math.round(
left + 50), Math.round(top + 100), Math.round(right - 50), Math.round(top + 10
0));
await driver.swipe(Math.round(
top + 50), Math.round(right - 50), Math.round(bottom - 50), Math.round(right - 5
0));
await CommonFunc.sleep(1000);
let onScrollText = await driver.findComponent(BY.key('onScrollText'));
let text1 = await onScrollText.getText();
console.info("[ListJsunit_0200] onScrollText: " + text1);
expect(text1).assertEqual('onScroll
:succ
');
expect(text1).assertEqual('onScroll');
// Verify the functions of onReachStart
await CommonFunc.sleep(200);
...
...
@@ -118,34 +118,34 @@ export default function ListJsunit() {
let onScrollBeginText = await driver.findComponent(BY.key('onScrollBeginText'));
let text3 = await onScrollBeginText.getText();
console.info("[ListJsunit_0200] onScrollBeginText: " + text3);
expect(text3).assertEqual('onScrollBegin
:succ
');
expect(text3).assertEqual('onScrollBegin');
// Verify the functions of onScrollStart
await CommonFunc.sleep(200);
let onScrollStartText = await driver.findComponent(BY.key('onScrollStartText'));
let text4 = await onScrollStartText.getText();
console.info("[ListJsunit_0200] onScrollStartText: " + text4);
expect(text4).assertEqual('onScrollStart
:succ
');
expect(text4).assertEqual('onScrollStart');
// Verify the functions of onScrollStop
await CommonFunc.sleep(200);
let onScrollStopText = await driver.findComponent(BY.key('onScrollStopText'));
let text5 = await onScrollStopText.getText();
console.info("[ListJsunit_0200] onScrollStopText: " + text5);
expect(text5).assertEqual('onScrollStop
:succ
');
expect(text5).assertEqual('onScrollStop');
// Verify the functions of onReachEnd
await driver.swipe(Math.round(
right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 10
0));
await driver.swipe(Math.round(
right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 10
0));
await driver.swipe(Math.round(
bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 5
0));
await driver.swipe(Math.round(
bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 5
0));
await CommonFunc.sleep(1000);
await driver.swipe(Math.round(
right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 10
0));
await driver.swipe(Math.round(
right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 10
0));
await driver.swipe(Math.round(
right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 10
0));
await driver.swipe(Math.round(
bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 5
0));
await driver.swipe(Math.round(
bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 5
0));
await driver.swipe(Math.round(
bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 5
0));
await CommonFunc.sleep(1000);
let onReachEndText = await driver.findComponent(BY.key('onReachEndText'));
let text= await onReachEndText.getText();
console.info("[ListJsunit_0200] onReachEndText: " + text);
expect(text).assertEqual('onReachEnd
:succ
');
expect(text).assertEqual('onReachEnd');
console.info('[ListJsunit_0200] END');
done();
});
...
...
@@ -181,7 +181,7 @@ export default function ListJsunit() {
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'alignListItem',value:ListItemAlign.Start})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'sticky',value:StickyStyle.
Header
})
globalThis.value.message.notify({name:'sticky',value:StickyStyle.
None
})
await CommonFunc.sleep(2000);
// Get the propoties value of the List component
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -137,6 +137,8 @@ export default function RatingJsunit() {
// Modify the indicator value of the Rating component
globalThis.value.message.notify({name:'rating',value:1})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'text',value:'no change'})
await CommonFunc.sleep(2000);
let driver = await UiDriver.create()
let textComponent1 = await driver.findComponent(BY.key('text'));
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -59,15 +59,15 @@ export default function SearchJsunit() {
console.info("[SearchJsunit_0100] textFont: " + JSON.stringify(obj.$attrs.textFont));
console.info("[SearchJsunit_0100] textAlign: " + JSON.stringify(obj.$attrs.textAlign));
console.info("[SearchJsunit_0100] copyOption: " + JSON.stringify(obj.$attrs.copyOption));
expect(obj.$attrs.i
nspector.i
con).assertEqual('resource:///ohos_search.svg');
expect(obj.$attrs.
inspector.
searchButton).assertEqual('SEARCH');
expect(obj.$attrs.
inspector.
placeholderColor).assertEqual('#FF808080');
expect(obj.$attrs.
inspector.
value).assertEqual('');
expect(obj.$attrs.
inspector.
placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}');
expect(obj.$attrs.
inspector.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.
400","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.
inspector.
textAlign).assertEqual('TextAlign.Start');
expect(obj.$attrs.
inspector.
copyOption).assertEqual('CopyOptions.InApp');
expect(obj.$attrs.placeholder
.inspector
).assertEqual('Type to search...');
expect(obj.$attrs.icon).assertEqual('resource:///ohos_search.svg');
expect(obj.$attrs.searchButton).assertEqual('SEARCH');
expect(obj.$attrs.placeholderColor).assertEqual('#FF808080');
expect(obj.$attrs.value).assertEqual('');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}');
expect(obj.$attrs.
textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"
400","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.InApp');
expect(obj.$attrs.placeholder).assertEqual('Type to search...');
console.info('[SearchJsunit_0100] END');
done();
});
...
...
@@ -84,11 +84,11 @@ export default function SearchJsunit() {
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'changeValue',value:'hello'})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'placeholder',value:'
Click
to search...'})
globalThis.value.message.notify({name:'placeholder',value:'
Type
to search...'})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'
fontSize',value:20
})
globalThis.value.message.notify({name:'
placeholderFont',value:'{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'
})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'
weight',value:500
})
globalThis.value.message.notify({name:'
textFont',value:'{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"400","fontFamily":"HarmonyOS Sans"}'
})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'textAlign',value:TextAlign.Center})
await CommonFunc.sleep(500);
...
...
@@ -113,12 +113,12 @@ export default function SearchJsunit() {
//expect(obj.$attrs.icon).assertEqual('./resources/base/media/star_3.png');
expect(obj.$attrs.searchButton).assertEqual('CLICK_SEARCH');
expect(obj.$attrs.value).assertEqual('hello');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"
20.00fp","weight":"5
00","fontFamily":"sans-serif"}');
expect(obj.$attrs.textFont).assertEqual('{"fontSize":"
20.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.5
00","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"
14.00fp","weight":"4
00","fontFamily":"sans-serif"}');
expect(obj.$attrs.textFont).assertEqual('{"fontSize":"
14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"4
00","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.Local
Device
');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.Local');
expect(obj.$attrs.placeholderColor).assertEqual('#FF008000');
expect(obj.$attrs.placeholder).assertEqual('
Click
to search...');
expect(obj.$attrs.placeholder).assertEqual('
Type
to search...');
console.info('[SearchJsunit_0200] END');
done();
});
...
...
@@ -202,9 +202,9 @@ export default function SearchJsunit() {
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'placeholder',value:168})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'
fontSize',value:-20
})
await CommonFunc.sleep(
2
00);
globalThis.value.message.notify({name:'
weight',value:'test
'})
globalThis.value.message.notify({name:'
placeholderFont',value:'aaa'
})
await CommonFunc.sleep(
5
00);
globalThis.value.message.notify({name:'
textFont',value:'bbb
'})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'textAlign',value:'test'})
await CommonFunc.sleep(200);
...
...
@@ -225,14 +225,14 @@ export default function SearchJsunit() {
console.info("[SearchJsunit_0400] copyOption: " + JSON.stringify(obj.$attrs.copyOption));
console.info("[SearchJsunit_0400] placeholder: " + JSON.stringify(obj.$attrs.placeholder));
expect(obj.$attrs.icon).assertEqual('resource:///ohos_search.svg');
expect(obj.$attrs.searchButton).assertEqual('
10
');
expect(obj.$attrs.searchButton).assertEqual('
CLICK_SEARCH
');
expect(obj.$attrs.placeholderColor).assertEqual('#FF00000A');
expect(obj.$attrs.value).assertEqual('hello');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}');
expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"
FontWeight.
400","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"400","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start');
expect(obj.$attrs.copyOption).assertEqual('');
expect(obj.$attrs.placeholder).assertEqual('
Click
to search...');
expect(obj.$attrs.placeholder).assertEqual('
Type
to search...');
console.info('[SearchJsunit_0400] END');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/SelectJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -192,9 +192,9 @@ export default function SelectJsunit() {
expect(obj.$attrs.selectedOptionBgColor).assertEqual('#FF0000FF');
expect(obj.$attrs.selectedOptionFont).assertEqual('{"size":"16.00fp","weight":"400","family":"","style":"FontStyle.Normal"}');
expect(obj.$attrs.selectedOptionFontColor).assertEqual('#FFFFFF00');
expect(obj.$attrs.optionBgColor).assertEqual('#FF
FFFF
FF');
expect(obj.$attrs.optionBgColor).assertEqual('#FF
0000
FF');
expect(obj.$attrs.optionFont).assertEqual('{"size":"16.00fp","weight":"400","family":"","style":"FontStyle.Normal"}');
expect(obj.$attrs.optionFontColor).assertEqual('#FFFF
00
00');
expect(obj.$attrs.optionFontColor).assertEqual('#FFFF
FF
00');
await CommonFunc.sleep(1000);
let driver = await UiDriver.create()
let textComponent = await driver.findComponent(BY.key('indexValue'));
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextClockJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -84,44 +84,31 @@ export default function TextClockJsunit() {
});
it('TextClock_0300', 0, async function (done) {
// Verify the functions of the button of start
and stop
// Verify the functions of the button of start
console.info('[TextClock_0300] START');
// Click stop button
let driver = await UiDriver.create()
let stopButton = await driver.findComponent(BY.text('stop TextClock'));
await stopButton.click();
await CommonFunc.sleep(500);
let accumulateTime1 = await driver.findComponent(BY.key('accumulateTime'));
let text1 = await accumulateTime1.getText();
await CommonFunc.sleep(1000);
let accumulateTime2 = await driver.findComponent(BY.key('accumulateTime'));
let text2 = await accumulateTime2.getText();
expect(text1).assertEqual(text2);
let operation1 = await driver.findComponent(BY.key('operation'));
let textOperation1 = await operation1.getText();
expect(textOperation1).assertEqual('stop success');
let change1 = await driver.findComponent(BY.key('change'));
let textChange1 = await change1.getText();
expect(textChange1).assertEqual('no change success');
// Click start button
let driver = await UiDriver.create()
let startButton = await driver.findComponent(BY.text('start TextClock'));
await startButton.click();
await CommonFunc.sleep(1000);
let accumulateTime1 = await driver.findComponent(BY.key('accumulateTime'));
let text1 = await accumulateTime1.getText();
await CommonFunc.sleep(2000);
let accumulateTime3 = await driver.findComponent(BY.key('accumulateTime'));
let text3 = await accumulateTime3.getText();
expect(text2 == text3).assertFalse();
let accumulateTime2 = await driver.findComponent(BY.key('accumulateTime'));
let text2 = await accumulateTime2.getText();
expect(text1 == text2).assertFalse();
console.info("[TextClock_0300] text1 and text2 not equal !");
let change2 = await driver.findComponent(BY.key('change'));
let textChange2 = await change2.getText();
expect(textChange2).assertEqual('change success');
let change = await driver.findComponent(BY.key('change'));
let textChange = await change.getText();
expect(textChange).assertEqual('change success');
console.info("[TextClock_0300] change success !");
let operation2 = await driver.findComponent(BY.key('operation'));
let textOperation2 = await operation2.getText();
expect(textOperation2).assertEqual('start success');
let operation = await driver.findComponent(BY.key('operation'));
let textOperation = await operation.getText();
expect(textOperation).assertEqual('start success');
console.info("[TextClock_0300] start success !");
console.info('[TextClock_0300] END');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextInputJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -68,7 +68,7 @@ export default function TextInputJsunit() {
expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Search');
expect(obj.$attrs.caretColor).assertEqual('#FF0000FF');
expect(obj.$attrs.maxLength).assertEqual('10');
expect(obj.$attrs.style).assertEqual('TextInputStyle.
Inline
');
expect(obj.$attrs.style).assertEqual('TextInputStyle.
Default
');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.None');
expect(obj.$attrs.showPasswordIcon).assertEqual(false);
...
...
@@ -191,13 +191,15 @@ export default function TextInputJsunit() {
await CommonFunc.sleep(1000);
let textComponent3 = await driver.findComponent(BY.text('全选'));
await textComponent3.click()
let textComponent4 = await driver.findComponent(BY.text('复制'));
await textComponent4.click()
await CommonFunc.sleep(200);
//let textComponent4 = await driver.findComponent(BY.text('复制'));
//await textComponent4.click()
await textComponent.click()
await CommonFunc.sleep(1000);
let copy = await driver.findComponent(BY.key('copy'));
let text3 = await copy.getText();
expect(text3).assertEqual('onCopy:');
let strJson = getInspectorByKey('copy');
let obj = JSON.parse(strJson);
console.info("[TextInputJsunit_0400] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('onCopy:');
console.info("[TextInputJsunit_0400] Verify copy succ !");
// Verify onCut function of TextInput component
...
...
@@ -205,13 +207,15 @@ export default function TextInputJsunit() {
await CommonFunc.sleep(1000);
let textComponent5 = await driver.findComponent(BY.text('全选'));
await textComponent5.click()
await CommonFunc.sleep(200);
let textComponent6 = await driver.findComponent(BY.text('剪切'));
await textComponent6.click()
//await textComponent.click()
await CommonFunc.sleep(1000);
let textComponent7 = await driver.findComponent(BY.key('cut'));
let text4 = await textComponent7.getText();
expect(text4).assertEqual('onCut:');
let strJson1 = getInspectorByKey('cut');
let obj1 = JSON.parse(strJson1);
console.info("[TextInputJsunit_0400] component obj1 is: " + JSON.stringify(obj1));
expect(obj1.$attrs.content).assertEqual('onCut:');
console.info("[TextInputJsunit_0400] Verify cut succ !");
console.info('[TextInputJsunit_0400] END');
done();
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageOneJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -93,6 +93,7 @@ export default function imageOneJsunit() {
let obj4 = JSON.parse(strJson4);
console.info('textimageOneJsunit_0100 component obj4 is: ' + obj4.$attrs.src);
expect(obj4.$attrs.src).assertEqual('resource://rawfile/bm.jpg');
done();
});
it('imageOneJsunit_0300', 0, async function (done) {
...
...
@@ -105,50 +106,51 @@ export default function imageOneJsunit() {
let obj = JSON.parse(strJson);
console.info('textimageOneJsunit_0300 component obj is: ' + obj.$attrs.src);
expect(obj.$attrs.src).assertEqual('resource://rawfile/aaa.png');
done();
});
it('imageOneJsunit_0400', 0, async function (done) {
console.info('imageOneJsunit_0400 START');
await CommonFunc.sleep(1000);
// test the enum of objectFit
globalThis.value.message.notify({name:'objectFit',value:ImageFit.
None
})
await CommonFunc.sleep(100
0
);
let strJson = getInspectorByKey('
image1
');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.
Cover
})
await CommonFunc.sleep(100);
let strJson = getInspectorByKey('
objectFit
');
let obj = JSON.parse(strJson);
console.info('textimageOneJsunit_0400 component obj is: ' + obj.$attrs.objectFit);
expect(obj.$attrs.objectFit).assertEqual('ImageFit.
None
');
expect(obj.$attrs.objectFit).assertEqual('ImageFit.
Cover
');
globalThis.value.message.notify({name:'objectFit',value:
'ImageFit.Auto'
})
await CommonFunc.sleep(100
0
);
let strJson2 = getInspectorByKey('
image1
');
globalThis.value.message.notify({name:'objectFit',value:
ImageFit.Auto
})
await CommonFunc.sleep(100);
let strJson2 = getInspectorByKey('
objectFit
');
let obj2 = JSON.parse(strJson2);
console.info('textimageOneJsunit_0400 component obj2 is: ' + obj2.$attrs.objectFit);
expect(obj2.$attrs.objectFit).assertEqual('ImageFit.Auto');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Fill})
await CommonFunc.sleep(100
0
);
let strJson3 = getInspectorByKey('
image1
');
await CommonFunc.sleep(100);
let strJson3 = getInspectorByKey('
objectFit
');
let obj3 = JSON.parse(strJson3);
console.info('textimageOneJsunit_0400 component obj3 is: ' + obj3.$attrs.objectFit);
expect(obj3.$attrs.objectFit).assertEqual('ImageFit.Fill');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.ScaleDown})
await CommonFunc.sleep(100
0
);
let strJson4 = getInspectorByKey('
image1
');
await CommonFunc.sleep(100);
let strJson4 = getInspectorByKey('
objectFit
');
let obj4 = JSON.parse(strJson4);
console.info('textimageOneJsunit_0400 component obj4 is: ' + obj4.$attrs.objectFit);
expect(obj4.$attrs.objectFit).assertEqual('ImageFit.ScaleDown');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.
Cover
})
await CommonFunc.sleep(100
0
);
let strJson5 = getInspectorByKey('
image1
');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.
None
})
await CommonFunc.sleep(100);
let strJson5 = getInspectorByKey('
objectFit
');
let obj5 = JSON.parse(strJson5);
console.info('textimageOneJsunit_0400 component obj5 is: ' + obj5.$attrs.objectFit);
expect(obj5.$attrs.objectFit).assertEqual('ImageFit.
Cover
');
expect(obj5.$attrs.objectFit).assertEqual('ImageFit.
None
');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Contain})
await CommonFunc.sleep(100
0
);
let strJson6 = getInspectorByKey('
image1
');
await CommonFunc.sleep(100);
let strJson6 = getInspectorByKey('
objectFit
');
let obj6 = JSON.parse(strJson6);
console.info('textimageOneJsunit_0400 component obj6 is: ' + obj6.$attrs.objectFit);
expect(obj6.$attrs.objectFit).assertEqual('ImageFit.Contain');
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageThreeJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -24,13 +24,13 @@ export default function imageThreeJsunit() {
beforeEach(async function (done) {
console.info("imageThreeJsunit beforeEach start");
let options = {
uri: 'MainAbility/pages/image
t
hree',
uri: 'MainAbility/pages/image
T
hree',
}
try {
router.clear();
let pages = router.getState();
console.info("get imageThreeJsunit state pages:" + JSON.stringify(pages));
if (!("image
t
hree" == pages.name)) {
if (!("image
T
hree" == pages.name)) {
console.info("get imageThreeJsunit state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push imageThreeJsunit success " + JSON.stringify(result));
...
...
@@ -46,53 +46,50 @@ export default function imageThreeJsunit() {
console.info('imageThreeJsunit_0100 START');
await CommonFunc.sleep(1000);
// test the image complete Event
let driver = await UiDriver.create()
await CommonFunc.sleep(2000);
let textComponent = await driver.findComponent(BY.text('complete'));
let text = await textComponent.getText();
console.info('imageThreeJsunit_0100 text: ' + text);
expect(text).assertEqual('complete');
await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('complete');
let obj = JSON.parse(strJson);
console.info("[imageThreeJsunit_0100] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('complete');
done();
});
it('imageThreeJsunit_0200', 0, async function (done) {
console.info('imageThreeJsunit_0
2
00 START');
console.info('imageThreeJsunit_0
1
00 START');
await CommonFunc.sleep(1000);
// test the image error event
globalThis.value.message.notify({name:'name',value:'1.png'})
await CommonFunc.sleep(3000);
let driver = await UiDriver.create()
let textComponent = await driver.findComponent(BY.key('error'));
let text = await textComponent.getText();
console.info('imageThreeJsunit_0200 text: ' + text);
expect(text).assertEqual('error');
// test the image finish Event
let strJson = getInspectorByKey('Finish');
let obj = JSON.parse(strJson);
console.info("[imageThreeJsunit_0200] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('init');
done();
});
});
it('imageThreeJsunit_0300', 0, async function (done) {
console.info('imageThreeJsunit_0300 START');
await CommonFunc.sleep(1000);
// test the image click event
let driver = UiDriver.create();
let btn = await driver.findComponent(BY.key('
click
'));
let btn = await driver.findComponent(BY.key('
image2
'));
await btn.click();
await CommonFunc.sleep(100
0
);
let
textComponent = await driver.findComponent(BY.key('click')
);
let
text = await textComponent.getText(
);
console.info(
'imageThreeJsunit_0300 text: ' + text
);
expect(
tex
t).assertEqual('click');
await CommonFunc.sleep(100);
let
strJson = getInspectorByKey('click'
);
let
obj = JSON.parse(strJson
);
console.info(
"[imageThreeJsunit_0300] component obj is: " + JSON.stringify(obj)
);
expect(
obj.$attrs.conten
t).assertEqual('click');
done();
});
it('imageThreeJsunit_0400', 0, async function (done) {
console.info('imageThreeJsunit_0
1
00 START');
console.info('imageThreeJsunit_0
2
00 START');
await CommonFunc.sleep(1000);
// test the image finish Event
let driver = UiDriver.create();
let textComponent = await driver.findComponent(BY.key('Finish'));
let text = await textComponent.getText();
console.info('imageThreeJsunit_0400 text: ' + text);
expect(text).assertEqual('Finish');
// test the image error event
globalThis.value.message.notify({name:'imageName',value:'1.png'})
await CommonFunc.sleep(300);
let strJson = getInspectorByKey('error');
let obj = JSON.parse(strJson);
console.info("[imageThreeJsunit_0400] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('error');
done();
});
})
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageTwoJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -66,11 +66,12 @@ export default function imageTwoJsunit() {
await CommonFunc.sleep(1000);
// modify the image rendermode
globalThis.value.message.notify({name:'renderMode',value:ImageRenderMode.Template})
await CommonFunc.sleep(
10
00);
await CommonFunc.sleep(
2
00);
let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson);
console.info('imageTwoJsunit_0200 component obj is: ' + obj.$attrs.renderMode);
expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.Template');
done();
});
it('imageTwoJsunit_0300', 0, async function (done) {
...
...
@@ -78,11 +79,11 @@ export default function imageTwoJsunit() {
await CommonFunc.sleep(1000);
// modify the image rendermode
globalThis.value.message.notify({name:'renderMode',value:undefined})
await CommonFunc.sleep(
3000);
await CommonFunc.sleep(
200);
let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson);
console.info('imageTwoJsunit_0300 component obj is: ' + obj.$attrs.renderMode);
expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.
Template
');
expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.
Original
');
done();
});
...
...
@@ -91,21 +92,21 @@ export default function imageTwoJsunit() {
await CommonFunc.sleep(1000);
// test the enum of interpolation
globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.Low})
await CommonFunc.sleep(300
0
);
await CommonFunc.sleep(300);
let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson);
console.info('imageTwoJsunit_0300 component obj is: ' + obj.$attrs.interpolation);
expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.Low');
globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.Medium})
await CommonFunc.sleep(300
0
);
await CommonFunc.sleep(300);
let strJson2 = getInspectorByKey('image1');
let obj2 = JSON.parse(strJson2);
console.info('imageTwoJsunit_0400 component obj2 is: ' + obj2.$attrs.interpolation);
expect(obj2.$attrs.interpolation).assertEqual('ImageInterpolation.Medium');
globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.High})
await CommonFunc.sleep(300
0
);
await CommonFunc.sleep(300);
let strJson3 = getInspectorByKey('image1');
let obj3 = JSON.parse(strJson3);
console.info('imageTwoJsunit_0400 component obj3 is: ' + obj3.$attrs.interpolation);
...
...
@@ -118,11 +119,11 @@ export default function imageTwoJsunit() {
await CommonFunc.sleep(1000);
// test the enum of interpolation
globalThis.value.message.notify({name:'interpolation',value:undefined})
await CommonFunc.sleep(200
0
);
await CommonFunc.sleep(200);
let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson);
console.info('imageTwoJsunit_0500 component obj is: ' + obj.$attrs.interpolation);
expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.
High
');
expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.
None
');
done();
});
...
...
@@ -130,7 +131,7 @@ export default function imageTwoJsunit() {
console.info('imageOneJsunit_0600 START');
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'fillColor',value:"#FFEEAA"})
await CommonFunc.sleep(200
0
);
await CommonFunc.sleep(200);
let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson);
console.info('imageOneJsunit_0600 component obj is: ' + obj.$attrs.fillColor);
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/marqueeJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -30,7 +30,7 @@ export default function marqueeJsunit() {
router.clear();
let pages = router.getState();
console.info("get marqueeJsunit state pages:" + JSON.stringify(pages));
if (!("mar
g
uee" == pages.name)) {
if (!("mar
q
uee" == pages.name)) {
console.info("get marqueeJsunit state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push marqueeJsunit success " + JSON.stringify(result));
...
...
@@ -63,7 +63,7 @@ export default function marqueeJsunit() {
console.info('marqueeJsunit_0200 START');
// modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'fromStart',value:true})
await CommonFunc.sleep(200
0
);
await CommonFunc.sleep(200);
// check the value of changed parameter
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
...
...
@@ -72,31 +72,6 @@ export default function marqueeJsunit() {
});
it('marqueeJsunit_0300', 0, async function (done) {
console.info('marqueeJsunit_0300 START');
await CommonFunc.sleep(1000);
// modify the values partly attribute illegal value of marguee dynamically
globalThis.value.message.notify({name:'loop',value:-30})
await CommonFunc.sleep(1000);
// check the value of changed attribute
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.loop).assertEqual('2');
done();
});
it('marqueeJsunit_0400', 0, async function (done) {
console.info('marqueeJsunit_0400 START');
// modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'step',value:50})
await CommonFunc.sleep(2000);
// check the value of changed parameter
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.step).assertEqual('50.000000');
done();
});
it('marqueeJsunit_0500', 0, async function (done) {
console.info('marqueeJsunit_0400 START');
await CommonFunc.sleep(1000);
// test event
...
...
@@ -109,18 +84,44 @@ export default function marqueeJsunit() {
// check the test event
let ttx = await driver.findComponent(ON.id('text1'));
let txt = await ttx.getText();
console.info("[marqueeJsunit_0
5
00'] component obj is: " + txt);
console.info("[marqueeJsunit_0
3
00'] component obj is: " + txt);
expect(txt == 'onStart').assertTrue();
let ttxx = await driver.findComponent(ON.id('text2'));
let txtt = await ttxx.getText();
console.info("[marqueeJsunit_0
5
00'] component obj2 is: " + txtt);
console.info("[marqueeJsunit_0
3
00'] component obj2 is: " + txtt);
expect(txtt == 'onBounce').assertTrue();
await driver.delayMs(1000);
let ttxxx = await driver.findComponent(ON.id('text3'));
let txttt = await ttxxx.getText();
console.info("[marqueeJsunit_0
5
00'] component obj3 is: " + txttt);
console.info("[marqueeJsunit_0
3
00'] component obj3 is: " + txttt);
expect(txttt == 'onFinish').assertTrue();
done();
});
it('marqueeJsunit_0400', 0, async function (done) {
console.info('marqueeJsunit_0300 START');
await CommonFunc.sleep(100);
// modify the values partly attribute illegal value of marguee dynamically
globalThis.value.message.notify({name:'loop',value:-30})
await CommonFunc.sleep(1000);
// check the value of changed attribute
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.loop).assertEqual('-30');
done();
});
it('marqueeJsunit_0500', 0, async function (done) {
console.info('marqueeJsunit_0400 START');
// modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'step',value:50})
await CommonFunc.sleep(200);
// check the value of changed parameter
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.step).assertEqual('50.000000');
done();
});
it('marqueeJsunit_0600', 0, async function (done) {
console.info('marqueeJsunit_0600 START');
...
...
@@ -130,7 +131,7 @@ export default function marqueeJsunit() {
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
// to confirm
expect(obj.$attrs.step).assertEqual('
5
0.000000');
expect(obj.$attrs.step).assertEqual('
-3
0.000000');
done();
});
...
...
@@ -138,7 +139,7 @@ export default function marqueeJsunit() {
console.info('marqueeJsunit_0700 START');
// modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'loop',value:2})
await CommonFunc.sleep(100
0
);
await CommonFunc.sleep(100);
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.loop).assertEqual('2');
...
...
@@ -148,13 +149,12 @@ export default function marqueeJsunit() {
it('marqueeJsunit_0800', 0, async function (done) {
console.info('marqueeJsunit_0800 START');
// modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'src',value:'starts rolling'})
await CommonFunc.sleep(200
0
);
globalThis.value.message.notify({name:'src',value:'
Running Marquee
starts rolling'})
await CommonFunc.sleep(200);
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.src).assertEqual('Running Marquee starts rolling');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -125,7 +125,7 @@ export default function sliderJsunit() {
console.info('sliderJsunit_0500 component obj is: ' + obj.$attrs.blockColor + "---" + obj.$attrs.trackColor + "--" + obj.$attrs.selectedColor + "--" );
expect(obj.$attrs.blockColor).assertEqual('#FFEE82EE');
expect(obj.$attrs.trackColor).assertEqual('#FFEE82EE');
expect(obj.$attrs.selectedColor).assertEqual('#FF
AEFFFF
');
expect(obj.$attrs.selectedColor).assertEqual('#FF
EE82EE
');
done();
});
...
...
@@ -154,7 +154,7 @@ export default function sliderJsunit() {
it('sliderJsunit_0700', 0, async function (done) {
console.info('sliderJsunit_0700 START');
// modify the constructor attribute of slider dynamically
globalThis.value.message.notify({name:'v
alu
e',value:30})
globalThis.value.message.notify({name:'v
InSetValueOn
e',value:30})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'style',value:SliderStyle.OutSet})
await CommonFunc.sleep(1000);
...
...
@@ -186,7 +186,7 @@ export default function sliderJsunit() {
it('sliderJsunit_0800', 0, async function (done) {
console.info('sliderJsunit_0800 START');
// modify the constructor attribute of slider dynamically
globalThis.value.message.notify({name:'v
alu
e',value:-30})
globalThis.value.message.notify({name:'v
InSetValueOn
e',value:-30})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'reverse',value:1})
await CommonFunc.sleep(1000);
...
...
@@ -207,7 +207,7 @@ export default function sliderJsunit() {
+ "---" + obj.$attrs.constructor.reverse + "----" + obj.$attrs.constructor.min + "----" + obj.$attrs.constructor.max + "---" + obj.$attrs.constructor.step);
expect(obj.$attrs.style).assertEqual('SliderStyle.OutSet');
expect(obj.$attrs.constructor.direction).assertEqual('Axis.Horizontal');
expect(obj.$attrs.constructor.value).assertEqual('
4
0.000000');
expect(obj.$attrs.constructor.value).assertEqual('
2
0.000000');
expect(obj.$attrs.constructor.reverse).assertEqual('false');
expect(obj.$attrs.constructor.min).assertEqual('-20.000000');
expect(obj.$attrs.constructor.max).assertEqual('1000.000000');
...
...
@@ -234,7 +234,7 @@ export default function sliderJsunit() {
let textIn = await driver.findComponent(ON.id('tex'));
let txt = await textIn.getText();
console.info('sliderJsunit_0900 component textIn obj is: ' + txt);
expect(txt).assertEqual('
4
0');
expect(txt).assertEqual('
2
0');
let modeT = await driver.findComponent(ON.id('modeT'));
let txtt = await modeT.getText();
console.info('sliderJsunit_0900 modeT component obj is: ' + txtt);
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/stepperJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -186,4 +186,4 @@ export default function stepperJsunit() {
done();
});
})
}
\ No newline at end of file
}
arkui/ace_ets_component_ui/entry/src/main/ets/test/textAreaJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -56,7 +56,6 @@ export default function textAreaJsunit() {
expect(obj.$attrs.placeholderColor).assertEqual('#FFAACCEE');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.End');
expect(obj.$attrs.caretColor).assertEqual('#FFACDEFF');
expect(obj.$attrs.inputFilter).assertEqual('shang');
expect(obj.$attrs.fontSize).assertEqual('16.00fp');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.Local');
done();
...
...
@@ -73,7 +72,7 @@ export default function textAreaJsunit() {
let strJson = getInspectorByKey('textArea');
let obj = JSON.parse(strJson);
console.info('textAreaJsunit_0200 component obj is: ' + obj.$attrs.placeholderFont);
//
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"20.00fp","weight":"300","fontFamily":"sans-serif"}');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"20.00fp","weight":"300","fontFamily":"sans-serif"}');
done();
});
...
...
@@ -89,7 +88,7 @@ export default function textAreaJsunit() {
let strJson = getInspectorByKey('textArea');
let obj = JSON.parse(strJson);
console.info('textAreaJsunit_0300 component obj is: ' + obj.$attrs.placeholderFont);
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"
16
.00fp","fontWeight":"FontWeight.Normal","fontFamily":"sans-serif"}');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"
-30
.00fp","fontWeight":"FontWeight.Normal","fontFamily":"sans-serif"}');
done();
});
...
...
@@ -166,10 +165,10 @@ export default function textAreaJsunit() {
let text = await driver.findComponent(BY.key('textArea'));
await text.inputText('123');
await CommonFunc.sleep(2000);
let
textIn = await driver.findComponent(BY.key('change')
);
let
txt = await textIn.getText(
);
console.info('textAreaJsunit_0800 component obj is: ' +
tx
t);
expect(
txt).assertEqual('test
');
let
strJson = getInspectorByKey('change'
);
let
obj = JSON.parse(strJson
);
console.info('textAreaJsunit_0800 component obj is: ' +
obj.$attrs.conten
t);
expect(
obj.$attrs.content).assertEqual('123
');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/textTwoJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -43,56 +43,62 @@ export default function textTwoJsunit() {
});
it('textTwoJsunit_0100', 0, async function (done) {
console.info('imageOneJsunit_0100 START');
console.info('textTwoJsunit_0200 START');
// test the illegal value of decoration
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'type',value:undefined})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:undefined})
await CommonFunc.sleep(1000);
// get the image component and test attribute
let strJson = getInspectorByKey('text1');
let obj = JSON.parse(strJson);
console.info('textTwoJsunit_0100 component obj is: ' + obj.$attrs.decoration);
expect(obj.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FF000000"}');
expect(obj.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FF000000"}');
done();
});
it('textTwoJsunit_0200', 0, async function (done) {
console.info('imageOneJsunit_0200 START');
await CommonFunc.sleep(500);
// get the image component and test attribute
let strJson = getInspectorByKey('text1');
let obj = JSON.parse(strJson);
console.info('textTwoJsunit_0200 component obj is: ' + obj.$attrs.decoration);
expect(obj.$attrs.decoration).assertEqual('{"type":"TextDecorationType.LineThrough","color":"#FFFFEEAF"}');
await CommonFunc.sleep(1000);
// to modify the atrribute
globalThis.value.message.notify({name:'type',value:TextDecorationType.Overline})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:Color.Green})
await CommonFunc.sleep(200
0
);
await CommonFunc.sleep(200);
let strJson2 = getInspectorByKey('text1');
let obj2 = JSON.parse(strJson2);
console.info('textTwoJsunit_0
1
00 component obj2 is: ' + obj2.$attrs.decoration);
console.info('textTwoJsunit_0
2
00 component obj2 is: ' + obj2.$attrs.decoration);
expect(obj2.$attrs.decoration).assertEqual('{"type":"TextDecorationType.Overline","color":"#FF008000"}');
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'type',value:TextDecorationType.Underline})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:'rgb(238, 130, 238)'})
await CommonFunc.sleep(200
0
);
await CommonFunc.sleep(200);
let strJson3 = getInspectorByKey('text1');
let obj3 = JSON.parse(strJson3);
console.info('textTwoJsunit_0
1
00 component obj3 is: ' + obj3.$attrs.decoration);
console.info('textTwoJsunit_0
2
00 component obj3 is: ' + obj3.$attrs.decoration);
expect(obj3.$attrs.decoration).assertEqual('{"type":"TextDecorationType.Underline","color":"#FFEE82EE"}');
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'type',value:TextDecorationType.None})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:'#FFACEEEE'})
await CommonFunc.sleep(200
0
);
await CommonFunc.sleep(200);
let strJson4 = getInspectorByKey('text1');
let obj4 = JSON.parse(strJson4);
console.info('textTwoJsunit_0
1
00 component obj4 is: ' + obj4.$attrs.decoration);
console.info('textTwoJsunit_0
2
00 component obj4 is: ' + obj4.$attrs.decoration);
expect(obj4.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FFACEEEE"}');
done();
});
it('textTwoJsunit_0200', 0, async function (done) {
console.info('textTwoJsunit_0200 START');
// test the illegal value of decoration
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'type',value:5})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:"#ACE"})
await CommonFunc.sleep(2000);
let strJson2 = getInspectorByKey('text1');
let obj2 = JSON.parse(strJson2);
console.info('textTwoJsunit_0200 component obj2 is: ' + obj2.$attrs.decoration);
expect(obj2.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FFAACCEE"}');
});
it('textTwoJsunit_0300', 0, async function (done) {
console.info('textTwoJsunit_0300 START');
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets
浏览文件 @
5b7e2855
...
...
@@ -96,8 +96,8 @@ export default function flexTextMargin_AutoJsunit() {
let textMargin03 = CommonFunc.getComponentRect('textMargin03');
let flexTextMargin01 = CommonFunc.getComponentRect('flexTextMargin01');
expect(Math.round(textMargin01.left - flexTextMargin01.left)).assertEqual(
Math.round(vp2px(500/17)
))
expect(Math.round(textMargin02.left - textMargin01.right)).assertEqual(
Math.round(vp2px(500/17)
))
expect(Math.round(textMargin01.left - flexTextMargin01.left)).assertEqual(
vp2px(30
))
expect(Math.round(textMargin02.left - textMargin01.right)).assertEqual(
vp2px(30
))
expect(textMargin02.right).assertEqual(textMargin03.left)
expect(textMargin03.right).assertEqual(flexTextMargin01.right)
...
...
@@ -108,9 +108,9 @@ export default function flexTextMargin_AutoJsunit() {
expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50))
expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100))
expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150))
expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(
2500/17
)))
expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(
2500/17
)))
expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(
2500/17
)))
expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(
440/3
)))
expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(
440/3
)))
expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(
440/3
)))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1500 END');
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneMargin.test.ets
浏览文件 @
5b7e2855
...
...
@@ -104,20 +104,20 @@ export default function AlignCenter_AddOneMargin() {
expect(Center_AddOneMargin_01.top).assertEqual(Center_AddOneMargin_012.top);
expect(Center_AddOneMargin_013.top).assertEqual(Center_AddOneMargin_012.top);
expect(Math.round(Center_AddOneMargin_011.left - Center_AddOneMargin_01.left))
.assertEqual(
Math.round(vp2px(500/17)
));
.assertEqual(
vp2px(30
));
expect(Math.round(Center_AddOneMargin_011.top - Center_AddOneMargin_01.top)).assertEqual(vp2px(30));
expect(Math.round(Center_AddOneMargin_012.left - Center_AddOneMargin_011.right))
.assertEqual(
Math.round(vp2px(500/17)
));
.assertEqual(
vp2px(30
));
expect(Center_AddOneMargin_012.right).assertEqual(Center_AddOneMargin_013.left);
expect(Math.round(Center_AddOneMargin_011.bottom - Center_AddOneMargin_011.top)).assertEqual(vp2px(50));
expect(Math.round(Center_AddOneMargin_012.bottom - Center_AddOneMargin_012.top)).assertEqual(vp2px(100));
expect(Math.round(Center_AddOneMargin_013.bottom - Center_AddOneMargin_013.top)).assertEqual(vp2px(150));
expect(Math.round(Center_AddOneMargin_011.right - Center_AddOneMargin_011.left))
.assertEqual(Math.round(vp2px(
2500/17
)));
.assertEqual(Math.round(vp2px(
440/3
)));
expect(Math.round(Center_AddOneMargin_012.right - Center_AddOneMargin_012.left))
.assertEqual(Math.round(vp2px(
2500/17
)));
.assertEqual(Math.round(vp2px(
440/3
)));
expect(Math.round(Center_AddOneMargin_013.right - Center_AddOneMargin_013.left))
.assertEqual(Math.round(vp2px(
2500/17
)));
.assertEqual(Math.round(vp2px(
440/3
)));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1500] END');
done();
})
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets
浏览文件 @
5b7e2855
...
...
@@ -100,8 +100,8 @@ export default function AlignEnd_AddOneMargin() {
let End_AddOneMargin_013 = CommonFunc.getComponentRect('End_AddOneMargin_013');
let End_AddOneMargin_01 = CommonFunc.getComponentRect('End_AddOneMargin_01');
expect(Math.round(End_AddOneMargin_011.top - End_AddOneMargin_01.top)).assertEqual(vp2px(30));
expect(Math.round(End_AddOneMargin_012.left - End_AddOneMargin_011.right)).assertEqual(
Math.round(vp2px(500/17)
));
expect(Math.round(End_AddOneMargin_011.left - End_AddOneMargin_01.left)).assertEqual(
Math.round(vp2px(500/17)
));
expect(Math.round(End_AddOneMargin_012.left - End_AddOneMargin_011.right)).assertEqual(
vp2px(30
));
expect(Math.round(End_AddOneMargin_011.left - End_AddOneMargin_01.left)).assertEqual(
vp2px(30
));
expect(End_AddOneMargin_013.top).assertEqual(End_AddOneMargin_012.top);
expect(End_AddOneMargin_012.top).assertEqual(End_AddOneMargin_01.top);
expect(End_AddOneMargin_013.left).assertEqual(End_AddOneMargin_012.right);
...
...
@@ -109,9 +109,9 @@ export default function AlignEnd_AddOneMargin() {
expect(Math.round(End_AddOneMargin_011.bottom - End_AddOneMargin_011.top)).assertEqual(vp2px(50));
expect(Math.round(End_AddOneMargin_012.bottom - End_AddOneMargin_012.top)).assertEqual(vp2px(100));
expect(Math.round(End_AddOneMargin_013.bottom - End_AddOneMargin_013.top)).assertEqual(vp2px(150));
expect(Math.round(End_AddOneMargin_011.right - End_AddOneMargin_011.left)).assertEqual(Math.round(vp2px(
2500/17
)));
expect(Math.round(End_AddOneMargin_012.right - End_AddOneMargin_012.left)).assertEqual(Math.round(vp2px(
2500/17
)));
expect(Math.round(End_AddOneMargin_013.right - End_AddOneMargin_013.left)).assertEqual(Math.round(vp2px(
2500/17
)));
expect(Math.round(End_AddOneMargin_011.right - End_AddOneMargin_011.left)).assertEqual(Math.round(vp2px(
440/3
)));
expect(Math.round(End_AddOneMargin_012.right - End_AddOneMargin_012.left)).assertEqual(Math.round(vp2px(
440/3
)));
expect(Math.round(End_AddOneMargin_013.right - End_AddOneMargin_013.left)).assertEqual(Math.round(vp2px(
440/3
)));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1500] END');
done();
})
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneMargin.test.ets
浏览文件 @
5b7e2855
...
...
@@ -105,7 +105,7 @@ export default function AlignSpaceEvenly_AddOneMargin() {
let SpaceEvenly_AddOneMargin_01 = CommonFunc.getComponentRect('SpaceEvenly_AddOneMargin_01');
expect(Math.round(SpaceEvenly_AddOneMargin_011.top - SpaceEvenly_AddOneMargin_01.top)).assertEqual(vp2px(30));
expect(Math.round(SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left))
.assertEqual(
Math.round(vp2px(500/17)
));
.assertEqual(
vp2px(30
));
expect(Math.round(SpaceEvenly_AddOneMargin_012.left - SpaceEvenly_AddOneMargin_011.right))
.assertEqual(Math.round(SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left));
expect(SpaceEvenly_AddOneMargin_013.right).assertEqual(SpaceEvenly_AddOneMargin_01.right);
...
...
@@ -116,11 +116,11 @@ export default function AlignSpaceEvenly_AddOneMargin() {
expect(Math.round(SpaceEvenly_AddOneMargin_012.bottom - SpaceEvenly_AddOneMargin_012.top)).assertEqual(vp2px(100));
expect(Math.round(SpaceEvenly_AddOneMargin_013.bottom - SpaceEvenly_AddOneMargin_013.top)).assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddOneMargin_011.right - SpaceEvenly_AddOneMargin_011.left))
.assertEqual(Math.round(vp2px(
2500/17
)));
.assertEqual(Math.round(vp2px(
440/3
)));
expect(Math.round(SpaceEvenly_AddOneMargin_012.right - SpaceEvenly_AddOneMargin_012.left))
.assertEqual(Math.round(vp2px(
2500/17
)));
.assertEqual(Math.round(vp2px(
440/3
)));
expect(Math.round(SpaceEvenly_AddOneMargin_013.right - SpaceEvenly_AddOneMargin_013.left))
.assertEqual(Math.round(vp2px(
2500/17
)));
.assertEqual(Math.round(vp2px(
440/3
)));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1600] END');
done();
})
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets
浏览文件 @
5b7e2855
...
...
@@ -104,16 +104,16 @@ export default function AlignStart_AddOneMargin() {
expect(Start_AddOneMargin_013.left).assertEqual(Start_AddOneMargin_012.right);
expect(Start_AddOneMargin_013.right).assertEqual(Start_AddOneMargin_01.right);
expect(Math.round(Start_AddOneMargin_012.left - Start_AddOneMargin_011.right))
.assertEqual(
Math.round(vp2px(500/17)
));
.assertEqual(
vp2px(30
));
expect(Math.round(Start_AddOneMargin_011.top - Start_AddOneMargin_01.top)).assertEqual(vp2px(30));
expect(Math.round(Start_AddOneMargin_011.left - Start_AddOneMargin_01.left))
.assertEqual(
Math.round(vp2px(500/17)
));
.assertEqual(
vp2px(30
));
expect(Math.round(Start_AddOneMargin_011.right - Start_AddOneMargin_011.left))
.assertEqual(Math.round(vp2px(
2500/17
)));
.assertEqual(Math.round(vp2px(
440/3
)));
expect(Math.round(Start_AddOneMargin_012.right - Start_AddOneMargin_012.left))
.assertEqual(Math.round(vp2px(
2500/17
)));
.assertEqual(Math.round(vp2px(
440/3
)));
expect(Math.round(Start_AddOneMargin_013.right - Start_AddOneMargin_013.left))
.assertEqual(Math.round(vp2px(
2500/17
)));
.assertEqual(Math.round(vp2px(
440/3
)));
expect(Math.round(Start_AddOneMargin_011.bottom - Start_AddOneMargin_011.top)).assertEqual(vp2px(50));
expect(Math.round(Start_AddOneMargin_012.bottom - Start_AddOneMargin_012.top)).assertEqual(vp2px(100));
expect(Math.round(Start_AddOneMargin_013.bottom - Start_AddOneMargin_013.top)).assertEqual(vp2px(150));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录