Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
1d4f76a1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1d4f76a1
编写于
5月 24, 2023
作者:
W
wang-xupeng2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update slider steper and grid testcases
Signed-off-by:
N
wang-xupeng2
<
wangxupeng2@huawei.com
>
上级
ec8b0dfc
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
39 addition
and
34 deletion
+39
-34
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/slider.ets
...ponent_ui/entry/src/main/ets/MainAbility/pages/slider.ets
+3
-3
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/stepper.ets
...onent_ui/entry/src/main/ets/MainAbility/pages/stepper.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridJsunit.test.ets
..._component_ui/entry/src/main/ets/test/GridJsunit.test.ets
+7
-9
arkui/ace_ets_component_ui/entry/src/main/ets/test/stepperJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/stepperJsunit.test.ets
+28
-21
未找到文件。
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/slider.ets
浏览文件 @
1d4f76a1
...
@@ -206,7 +206,7 @@ struct SliderExample {
...
@@ -206,7 +206,7 @@ struct SliderExample {
Text(this.modeT).fontSize(9).fontColor(0xCCCCCC).width('50%').margin(15).key('modeT')
Text(this.modeT).fontSize(9).fontColor(0xCCCCCC).width('50%').margin(15).key('modeT')
Row() {
Row() {
Slider({
Slider({
value: this.vInSetValueOne
1
,
value: this.vInSetValueOne,
style: this.style,
style: this.style,
direction: this.directionT,
direction: this.directionT,
reverse: this.reverse,// 竖向的Slider默认是上端是min值,下端是max值,因此想要从下往上滑动,需要设置reverse为true
reverse: this.reverse,// 竖向的Slider默认是上端是min值,下端是max值,因此想要从下往上滑动,需要设置reverse为true
...
@@ -215,7 +215,7 @@ struct SliderExample {
...
@@ -215,7 +215,7 @@ struct SliderExample {
step:this.step
step:this.step
}).showTips(true)
}).showTips(true)
.onChange((value: number, mode: SliderChangeMode) => {
.onChange((value: number, mode: SliderChangeMode) => {
this.vInSetValueOne
1
= value
this.vInSetValueOne = value
console.info('value:' + value + 'm`ode:' + mode.toString())
console.info('value:' + value + 'm`ode:' + mode.toString())
}).key('sliderConstructor')
}).key('sliderConstructor')
...
@@ -233,7 +233,7 @@ struct SliderExample {
...
@@ -233,7 +233,7 @@ struct SliderExample {
Slider().showTips(true)
Slider().showTips(true)
.onChange((value: number, mode: SliderChangeMode) => {
.onChange((value: number, mode: SliderChangeMode) => {
this.vInSetValueOne = value
this.vInSetValueOne
1
= value
this.modeT = mode.toString()
this.modeT = mode.toString()
console.info('value:' + value + 'm`ode:' + mode.toString())
console.info('value:' + value + 'm`ode:' + mode.toString())
}).key('sliderConstructor2')
}).key('sliderConstructor2')
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/stepper.ets
浏览文件 @
1d4f76a1
...
@@ -88,7 +88,7 @@ struct StepperExample {
...
@@ -88,7 +88,7 @@ struct StepperExample {
// 第二个步骤页
// 第二个步骤页
StepperItem() {
StepperItem() {
Column() {
Column() {
Text('Page Two')
Text('Page Two')
.key('pageTwo')
.itemTextStyle()
.itemTextStyle()
Button('change status:' + this.secondState)
Button('change status:' + this.secondState)
.backgroundColor('#007dFF')
.backgroundColor('#007dFF')
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridJsunit.test.ets
浏览文件 @
1d4f76a1
...
@@ -143,12 +143,9 @@ export default function GridJsunit() {
...
@@ -143,12 +143,9 @@ export default function GridJsunit() {
// Verify onScrollIndex event
// Verify onScrollIndex event
let grid2 = CommonFunc.getComponentRect('grid2');
let grid2 = CommonFunc.getComponentRect('grid2');
let top = grid2.top
let top = grid2.top
let grid2b = CommonFunc.getComponentRect('grid2');
let bottom = grid2.bottom
let bottom = grid2b.bottom
let left = grid2.left
let grid2l = CommonFunc.getComponentRect('grid2');
let right = grid2.right
let left = grid2l.left
let grid2r = CommonFunc.getComponentRect('grid2');
let right = grid2r.right
let driver = await UiDriver.create()
let driver = await UiDriver.create()
await driver.swipe(Math.round((right - left) / 2), Math.round(bottom - 10), Math.round((right - left) / 2), Math.round(top + 10));
await driver.swipe(Math.round((right - left) / 2), Math.round(bottom - 10), Math.round((right - left) / 2), Math.round(top + 10));
await driver.swipe(Math.round((right - left) / 2), Math.round(bottom - 10), Math.round((right - left) / 2), Math.round(top + 10));
await driver.swipe(Math.round((right - left) / 2), Math.round(bottom - 10), Math.round((right - left) / 2), Math.round(top + 10));
...
@@ -166,9 +163,10 @@ export default function GridJsunit() {
...
@@ -166,9 +163,10 @@ export default function GridJsunit() {
let button = await driver.findComponent(BY.key('button'));
let button = await driver.findComponent(BY.key('button'));
await button.click();
await button.click();
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
let button1 = await driver.findComponent(BY.key('button'));
let strJson = getInspectorByKey('button');
let text3 = await button1.getText();
let obj = JSON.parse(strJson);
expect(text3).assertEqual('clicked');
console.info('[GridJsunit_0400] component obj is: ' + obj.$attrs.content);
expect(obj.$attrs.content).assertEqual('clicked');
console.info('[GridJsunit_0400] END');
console.info('[GridJsunit_0400] END');
done();
done();
});
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/stepperJsunit.test.ets
浏览文件 @
1d4f76a1
...
@@ -120,32 +120,36 @@ export default function stepperJsunit() {
...
@@ -120,32 +120,36 @@ export default function stepperJsunit() {
it('stepperJsunit_0600', 0, async function (done) {
it('stepperJsunit_0600', 0, async function (done) {
console.info('stepperJsunit_0600 START');
console.info('stepperJsunit_0600 START');
// reset the component init status
globalThis.value.message.notify({name:'nextLabel',value:'下一步'});
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'prevLabel',value:'返回'});
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'status',value:ItemState.Normal});
globalThis.value.message.notify({name:'status',value:ItemState.Normal});
// test the stepper onChange onNext onPrevious event
// test the stepper onChange onNext onPrevious event
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
let driver = UiDriver.create();
let driver = UiDriver.create();
let button = await driver.findComponent(BY.text('Next'));
let button = await driver.findComponent(BY.text('Next'));
await button.click();
await button.click();
console.info('stepperJsunit_0600 button click succ');
await CommonFunc.sleep(1000);
// reset the component init status
globalThis.value.message.notify({name:'nextLabel',value:'下一步'});
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'prevLabel',value:'返回'});
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
let button2 = await driver.findComponent(BY.text('下一步'));
let button2 = await driver.findComponent(BY.text('下一步'));
await button2.click();
await button2.click();
console.info('stepperJsunit_0600 button2 click succ');
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
let
textThree = await driver.findComponent(BY.text('Page Three')
);
let
strJson = getInspectorByKey('pageThree'
);
let
txt = await textThree.getText(
);
let
obj = JSON.parse(strJson
);
console.info('stepperJsunit_0
700 component obj is: ' + tx
t);
console.info('stepperJsunit_0
600 component obj is: ' + obj.$attrs.conten
t);
expect(
tx
t).assertEqual('Page Three');
expect(
obj.$attrs.conten
t).assertEqual('Page Three');
// test the previous
// test the previous
let button3 = await driver.findComponent(BY.text('返回'));
let button3 = await driver.findComponent(BY.text('返回'));
await button3.click();
await button3.click();
let textTwo = await driver.findComponent(BY.text('Page Two'));
await CommonFunc.sleep(1000);
let txtT = await textTwo.getText();
console.info('stepperJsunit_0600 button3 click succ');
console.info('stepperJsunit_0600 component obj is: ' + txtT);
let strJson1 = getInspectorByKey('pageTwo');
expect(txtT).assertEqual('Page Two');
let obj1 = JSON.parse(strJson1);
console.info('stepperJsunit_0600 component obj1 is: ' + obj1.$attrs.content);
expect(obj1.$attrs.content).assertEqual('Page Two');
done();
done();
});
});
...
@@ -157,17 +161,20 @@ export default function stepperJsunit() {
...
@@ -157,17 +161,20 @@ export default function stepperJsunit() {
await CommonFunc.sleep(2000);
await CommonFunc.sleep(2000);
let button2 = await driver.findComponent(BY.text('下一步'));
let button2 = await driver.findComponent(BY.text('下一步'));
await button2.click();
await button2.click();
console.info('stepperJsunit_0700 button2 click succ');
await CommonFunc.sleep(2000);
await CommonFunc.sleep(2000);
let button3 = await driver.findComponent(BY.text('下一步'));
let button3 = await driver.findComponent(BY.text('下一步'));
await button3.click();
await button3.click();
console.info('stepperJsunit_0700 button3 click succ');
await CommonFunc.sleep(2000);
await CommonFunc.sleep(2000);
let button4 = await driver.findComponent(BY.text('开始'));
let button4 = await driver.findComponent(BY.text('开始'));
await button4.click();
await button4.click();
console.info('stepperJsunit_0700 button4 click succ');
await CommonFunc.sleep(2000);
await CommonFunc.sleep(2000);
let
textTwo = await driver.findComponent(BY.text('Page Four')
);
let
strJson = getInspectorByKey('pageFour'
);
let
txtT = await textTwo.getText(
);
let
obj = JSON.parse(strJson
);
console.info('stepperJsunit_0700 component obj is: ' +
txtT
);
console.info('stepperJsunit_0700 component obj is: ' +
obj.$attrs.content
);
expect(
txtT
).assertEqual('Page Four');
expect(
obj.$attrs.content
).assertEqual('Page Four');
done();
done();
});
});
...
@@ -179,10 +186,10 @@ export default function stepperJsunit() {
...
@@ -179,10 +186,10 @@ export default function stepperJsunit() {
let button = await driver.findComponent(BY.text('返回'));
let button = await driver.findComponent(BY.text('返回'));
await button.click();
await button.click();
await CommonFunc.sleep(2000);
await CommonFunc.sleep(2000);
let
textTwo = await driver.findComponent(BY.text('Page Three')
);
let
strJson = getInspectorByKey('pageThree'
);
let
txtT = await textTwo.getText(
);
let
obj = JSON.parse(strJson
);
console.info('stepperJsunit_0800 component obj is: ' +
txtT
);
console.info('stepperJsunit_0800 component obj is: ' +
obj.$attrs.content
);
expect(
txtT
).assertEqual('Page Three');
expect(
obj.$attrs.content
).assertEqual('Page Three');
done();
done();
});
});
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录