提交 874ba95b 编写于 作者: W wang-xupeng2

modify rating and search

Signed-off-by: Nwang-xupeng2 <wangxupeng2@huawei.com>
上级 a8f8b83f
......@@ -18,7 +18,7 @@ import {MessageManager,Callback} from '../utils/MessageManager';
@Component
struct RatingPage {
@State rating: number = 3.5
@State indicator : boolean = false
@State indicator : boolean = true
@State stars: number = 5
@State stepSize: number = 0.5
@State text: string = 'no change'
......
......@@ -51,7 +51,7 @@ export default function RatingJsunit() {
console.info("[RatingJsunit_0100] component obj is: " + JSON.stringify(obj));
await CommonFunc.sleep(1000);
expect(obj.$attrs.rating).assertEqual('3.500000');
expect(obj.$attrs.indicator).assertEqual('false');
expect(obj.$attrs.indicator).assertEqual('true');
expect(obj.$attrs.stars).assertEqual('5');
expect(obj.$attrs.stepSize).assertEqual('0.500000');
expect(obj.$attrs.starStyle).assertEqual('{"backgroundUri":"resources/base/media/star_1.png","foregroundUri":"resources/base/media/star_2.png","secondaryUri":"resources/base/media/star_3.png"}');
......@@ -134,7 +134,8 @@ export default function RatingJsunit() {
console.info('[RatingJsunit_0600] START');
await CommonFunc.sleep(1000);
// Modify the indicator value of the Rating component
globalThis.value.message.notify({name:'indicator',value:false})
globalThis.value.message.notify({name:'rating',value:1})
await CommonFunc.sleep(1000);
let driver = await UiDriver.create()
let textComponent1 = await driver.findComponent(BY.key('text'));
......
......@@ -63,8 +63,8 @@ export default function SearchJsunit() {
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":"FontWeight.400","fontFamily":"HarmonyOS Sans"}');
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.textAlign).assertEqual('TextAlign.Start');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.InApp');
expect(obj.$attrs.placeholder).assertEqual('Type to search...');
......@@ -113,8 +113,8 @@ 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": "500", "fontFamily ": "sans-serif" }');
expect(obj.$attrs.textFont).assertEqual('{ "fontSize":"20.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.500","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"20.00fp","weight":"500","fontFamily":"sans-serif"}');
expect(obj.$attrs.textFont).assertEqual('{"fontSize":"20.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.500","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.LocalDevice');
expect(obj.$attrs.placeholderColor).assertEqual('#FF008000');
......@@ -156,7 +156,7 @@ export default function SearchJsunit() {
await textComponent4.click()
let copy = await driver.findComponent(BY.key('copy'));
let text3 = await copy.getText();
expect(text3).assertEqual('onCopy:');
expect(text3).assertEqual('onCopy:hello');
// Verify the onCut function of the Search component
await textComponent1.longClick()
......@@ -226,8 +226,8 @@ export default function SearchJsunit() {
expect(obj.$attrs.searchButton).assertEqual('10');
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.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.textAlign).assertEqual('TextAlign.Start');
expect(obj.$attrs.copyOption).assertEqual('');
expect(obj.$attrs.placeholder).assertEqual('Click to search...');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册