Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8c9ce3d4
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看板
提交
8c9ce3d4
编写于
3月 22, 2023
作者:
C
chensi10
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
badge part2
Signed-off-by:
N
chensi10
<
chensi52@huawei.com
>
上级
02122f24
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
371 addition
and
1 deletion
+371
-1
arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/test/badge.ets
...ts_ux/ace_ets_component_badge/src/main/ets/test/badge.ets
+371
-1
未找到文件。
arkui/ace_ets_components_ux/ace_ets_component_badge/src/main/ets/test/badge.ets
浏览文件 @
8c9ce3d4
...
...
@@ -816,6 +816,376 @@ export default function badgeTest() {
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0100
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property argument to 5
*/
it('ArkUX_Stage_Badge_BorderWidth_0100', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0100 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0100');
console.info('ArkUX_Stage_Badge_BorderWidth_0100 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0100 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0100 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0100 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("5.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0100 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0100 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0200
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property argument to "5"
*/
it('ArkUX_Stage_Badge_BorderWidth_0200', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0200 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0200');
console.info('ArkUX_Stage_Badge_BorderWidth_0200 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0200 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0200 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0200 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("5.00px");
console.info('ArkUX_Stage_Badge_BorderWidth_0200 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0200 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0300
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property argument to $r("app.string.badge_Size_test")
*/
it('ArkUX_Stage_Badge_BorderWidth_0300', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0300 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0300');
console.info('ArkUX_Stage_Badge_BorderWidth_0300 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0300 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0300 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0300 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("7.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0300 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0300 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0400
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Sets the BorderWidth property parameter to the exception value ""
*/
it('ArkUX_Stage_Badge_BorderWidth_0400', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0400 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0400');
console.info('ArkUX_Stage_Badge_BorderWidth_0400 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0400 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0400 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0400 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("0.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0400 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0400 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0500
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Sets the BorderWidth property parameter to the exception value null
*/
it('ArkUX_Stage_Badge_BorderWidth_0500', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0500 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0500');
console.info('ArkUX_Stage_Badge_BorderWidth_0500 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0500 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0500 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0500 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("1.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0500 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0500 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0600
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Sets the BorderWidth property parameter to the exception value undefined
*/
it('ArkUX_Stage_Badge_BorderWidth_0600', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0600 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0600');
console.info('ArkUX_Stage_Badge_BorderWidth_0600 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0600 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0600 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0600 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("1.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0600 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0600 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0700
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property parameter to 5,
* and set the BorderWidth property parameter to "7fp" again
*/
it('ArkUX_Stage_Badge_BorderWidth_0700', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0700 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0700');
console.info('ArkUX_Stage_Badge_BorderWidth_0700 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0700 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0700 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0700 component style.borderWidth is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("7.00fp");
console.info('ArkUX_Stage_Badge_BorderWidth_0700 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0700 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0800
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property parameter to 5
* and set the BorderWidth property parameter to undefined again
*/
it('ArkUX_Stage_Badge_BorderWidth_0800', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0800 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0800');
console.info('ArkUX_Stage_Badge_BorderWidth_0800 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0800 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0800 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0800 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("1.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0800 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0800 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0900
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Sets the BorderWidth property parameter to the exception value "asdf%^7"
*/
it('ArkUX_Stage_Badge_BorderWidth_0900', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0900 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0900');
console.info('ArkUX_Stage_Badge_BorderWidth_0900 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0900 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0900 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0900 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("0.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0900 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0900 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_1000
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property parameter to "5lpx"
* and the common property width property value to the outlier value 7
*/
it('ArkUX_Stage_Badge_BorderWidth_1000', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_1000 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1000');
console.info('ArkUX_Stage_Badge_BorderWidth_1000 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_1000 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_1000 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_1000 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("5.00lpx");
console.info('ArkUX_Stage_Badge_BorderWidth_1000 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_1000 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_1100
* @tc.name Combined test all new attributes of the Badge component
* @tc.desc Set the BorderWidth property argument to 0
*/
it('ArkUX_Stage_Badge_BorderWidth_1100', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_1000 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1100');
console.info('ArkUX_Stage_Badge_BorderWidth_1100 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_1100 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_1100 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_1100 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("0.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_1100 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_1100 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_1200
* @tc.name Combined test all new attributes of the Badge component
* @tc.desc Simultaneous setting BorderWidth(5) fontWeight(600) BorderColor(#FFFD0000)
*/
it('ArkUX_Stage_Badge_BorderWidth_1200', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_1200 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1200');
console.info('ArkUX_Stage_Badge_BorderWidth_1200 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_1200 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_1200 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_1200 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("5.00vp");
expect(style.fontWeight).assertEqual("FontWeight.600");
expect(style.borderColor).assertEqual("#FFFD0000");
console.info('ArkUX_Stage_Badge_BorderWidth_1200 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_1200 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_1300
* @tc.name Combined test all new attributes of the Badge component
* @tc.desc Do not set new attributes
*/
it('ArkUX_Stage_Badge_BorderWidth_1300', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_1300 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1300');
console.info('ArkUX_Stage_Badge_BorderWidth_1300 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_1300 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_1300 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_1300 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("1.00vp");
expect(style.fontWeight).assertEqual("FontWeight.Normal");
expect(style.borderColor).assertEqual("#FFFA2A2D");
console.info('ArkUX_Stage_Badge_BorderWidth_1300 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_1300 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录