Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
27fea3f8
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看板
提交
27fea3f8
编写于
5月 12, 2023
作者:
W
wang-xupeng2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update search/marquee/textArea
Signed-off-by:
N
wang-xupeng2
<
wangxupeng2@huawei.com
>
上级
d7ae7fb8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
26 deletion
+30
-26
arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/SearchJsunit.test.ets
+26
-18
arkui/ace_ets_component_ui/entry/src/main/ets/test/marqueeJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/marqueeJsunit.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
+3
-7
未找到文件。
arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets
浏览文件 @
27fea3f8
...
...
@@ -134,18 +134,20 @@ export default function SearchJsunit() {
let textComponent1 = await driver.findComponent(BY.key('search'));
await textComponent1.inputText("hello")
await CommonFunc.sleep(1000);
let change = await driver.findComponent(BY.key('change'));
let text1 = await change.getText();
expect(text1).assertEqual('onChange:hello');
let strJson1 = getInspectorByKey('change');
let obj1 = JSON.parse(strJson1);
console.info("[SearchJsunit_0300] obj1: " + JSON.stringify(obj1));
expect(obj1.$attrs.content).assertEqual('onChange:hello');
await CommonFunc.sleep(1000);
// Verify the onSubmit function of the Search component
let textComponent2 = await driver.findComponent(BY.text('CLICK_SEARCH'));
await textComponent2.click()
await CommonFunc.sleep(1000);
let submit = await driver.findComponent(BY.key('submit'));
let text2 = await submit.getText();
expect(text2).assertEqual('onSubmit:hello');
let strJson2 = getInspectorByKey('submit');
let obj2 = JSON.parse(strJson2);
console.info("[SearchJsunit_0300] obj2: " + JSON.stringify(obj2));
expect(obj2.$attrs.content).assertEqual('onSubmit:hello');
// Verify the onCopy function of the Search component
await textComponent1.longClick()
...
...
@@ -154,9 +156,11 @@ export default function SearchJsunit() {
await textComponent3.click()
let textComponent4 = await driver.findComponent(BY.text('复制'));
await textComponent4.click()
let copy = await driver.findComponent(BY.key('copy'));
let text3 = await copy.getText();
expect(text3).assertEqual('onCopy:hello');
await CommonFunc.sleep(1000);
let strJson3 = getInspectorByKey('copy');
let obj3 = JSON.parse(strJson3);
console.info("[SearchJsunit_0300] obj3: " + JSON.stringify(obj3));
expect(obj3.$attrs.content).assertEqual('onCopy:hello');
// Verify the onCut function of the Search component
await textComponent1.longClick()
...
...
@@ -165,25 +169,29 @@ export default function SearchJsunit() {
await textComponent5.click()
let textComponent6 = await driver.findComponent(BY.text('剪切'));
await textComponent6.click()
let cut = await driver.findComponent(BY.key('cut'));
let text4 = await cut.getText();
expect(text4).assertEqual('onCut:hello');
await CommonFunc.sleep(1000);
let strJson4 = getInspectorByKey('cut');
let obj4 = JSON.parse(strJson4);
console.info("[SearchJsunit_0300] obj4: " + JSON.stringify(obj4));
expect(obj4.$attrs.content).assertEqual('onCut:hello');
// Verify the onPaste function of the Search component
await textComponent1.longClick()
await CommonFunc.sleep(1000);
let textComponent8 = await driver.findComponent(BY.text('粘贴'));
await textComponent8.click()
let paste = await driver.findComponent(BY.key('paste'));
let text5 = await paste.getText();
expect(text5).assertEqual('onPaste:hello');
await CommonFunc.sleep(1000);
let strJson5 = getInspectorByKey('paste');
let obj5 = JSON.parse(strJson5);
console.info("[SearchJsunit_0300] obj5: " + JSON.stringify(obj5));
expect(obj5.$attrs.content).assertEqual('onPaste:hello');
// Verify the caretPosition function of the Search component
let textComponent7 = await driver.findComponent(BY.key('button'));
await textComponent7.click();
await CommonFunc.sleep(1000);
let text
6
= await textComponent7.getText();
expect(text
6
).assertEqual('Set caretPosition 2');
let text = await textComponent7.getText();
expect(text).assertEqual('Set caretPosition 2');
console.info('[SearchJsunit_0300] END');
done();
});
...
...
@@ -227,7 +235,7 @@ export default function SearchJsunit() {
expect(obj.$attrs.icon).assertEqual('resource:///ohos_search.svg');
expect(obj.$attrs.searchButton).assertEqual('CLICK_SEARCH');
expect(obj.$attrs.placeholderColor).assertEqual('#FF00000A');
expect(obj.$attrs.value).assertEqual('
hello
');
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');
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/marqueeJsunit.test.ets
浏览文件 @
27fea3f8
...
...
@@ -131,7 +131,7 @@ export default function marqueeJsunit() {
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
// to confirm
expect(
obj.$attrs.step).assertEqual('1.000000'
);
expect(
parseInt(obj.$attrs.step)).assertEqual(vp2px(6)
);
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/textAreaJsunit.test.ets
浏览文件 @
27fea3f8
...
...
@@ -158,13 +158,9 @@ export default function textAreaJsunit() {
it('textAreaJsunit_0800', 0, async function (done) {
console.info('textAreaJsunit_0800 START');
// globalThis.value.message.notify({name:'placeholder',value:''})
let driver = UiDriver.create();
let allSelect = await driver.findComponent(BY.text('全选'));
await allSelect.click();
globalThis.value.message.notify({name:'text',value:''})
await CommonFunc.sleep(1000);
let cutComponent = await driver.findComponent(BY.text('剪切'));
await cutComponent.click();
let driver = UiDriver.create();
await CommonFunc.sleep(1000);
// test the change event
let text = await driver.findComponent(BY.key('textArea'));
...
...
@@ -210,7 +206,7 @@ export default function textAreaJsunit() {
});
it('textAreaJsunit_1000', 0, async function (done) {
console.info('
marqueeJsunit_09
00 START');
console.info('
textAreaJsunit_10
00 START');
await CommonFunc.sleep(1000);
// test the cut event
let driver = UiDriver.create();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录