未验证 提交 e0390045 编写于 作者: O openharmony_ci 提交者: Gitee

!8868 删除Toggle默认色校验&适配UI测试套

Merge pull request !8868 from 王旭鹏/master
......@@ -132,59 +132,6 @@ export default function ToggleJsunit() {
done();
});
it('testToggle06', 0, async function (done) {
console.info('testToggle06 START');
try {
let eventData = {
data: {
"selectedColor": '-a',
}
}
let indexEvent = {
eventId: 1033,
priority: events_emitter.EventPriority.LOW
}
console.info("testToggle06 start to publish emit");
events_emitter.emit(indexEvent, eventData);
} catch (err) {
console.log("testToggle06 change component data error: " + err.message);
}
await Utils.sleep(4000);
let strJsonNew = getInspectorByKey('toggle');
let objNew = JSON.parse(strJsonNew);
console.info("testToggle06 component objNew is: " + JSON.stringify(objNew));
// 非法入参默认初始值
expect(objNew.$attrs.selectedColor).assertEqual('#33007DFF');
console.info('testToggle06 END');
done();
});
it('testToggle07', 0, async function (done) {
console.info('testToggle07 START');
try {
let eventData = {
data: {
"selectedColor": '-0.1',
}
}
let indexEvent = {
eventId: 1034,
priority: events_emitter.EventPriority.LOW
}
console.info("testToggle07 start to publish emit");
events_emitter.emit(indexEvent, eventData);
} catch (err) {
console.log("testToggle07 change component data error: " + err.message);
}
await Utils.sleep(4000);
let strJsonNew = getInspectorByKey('toggle');
let objNew = JSON.parse(strJsonNew);
console.info("testToggle07 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.selectedColor).assertEqual('#33007DFF');
console.info('testToggle07 END');
done();
});
it('testToggle08', 0, async function (done) {
console.info('testToggle04 START');
try {
......
......@@ -78,7 +78,7 @@ export default function SearchJsunit() {
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'icon',value:'./resources/base/media/star_3.png'})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'searchButton',value:'CLICK_SEARCH'})
globalThis.value.message.notify({name:'searchButton',value:'search'})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'placeholderColor',value:Color.Green})
await CommonFunc.sleep(500);
......@@ -111,7 +111,7 @@ export default function SearchJsunit() {
console.info("[SearchJsunit_0200] textAlign: " + JSON.stringify(obj.$attrs.textAlign));
console.info("[SearchJsunit_0200] copyOption: " + JSON.stringify(obj.$attrs.copyOption));
//expect(obj.$attrs.icon).assertEqual('./resources/base/media/star_3.png');
expect(obj.$attrs.searchButton).assertEqual('CLICK_SEARCH');
expect(obj.$attrs.searchButton).assertEqual('search');
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":"400","fontFamily":"HarmonyOS Sans"}');
......@@ -141,35 +141,42 @@ export default function SearchJsunit() {
await CommonFunc.sleep(1000);
// Verify the onSubmit function of the Search component
let textComponent2 = await driver.findComponent(BY.text('CLICK_SEARCH'));
let textComponent2 = await driver.findComponent(BY.text('search'));
await textComponent2.click()
await CommonFunc.sleep(1000);
console.info("[SearchJsunit_0300] CLICK_SEARCH succ ");
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.click()
await textComponent1.longClick()
await CommonFunc.sleep(1000);
console.info("[SearchJsunit_0300] first longClick succ ");
let textComponent3 = await driver.findComponent(BY.text('全选'));
await textComponent3.click()
let textComponent4 = await driver.findComponent(BY.text('复制'));
await textComponent4.click()
await CommonFunc.sleep(1000);
console.info("[SearchJsunit_0300] click copy succ ");
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.click()
await textComponent1.longClick()
await CommonFunc.sleep(1000);
console.info("[SearchJsunit_0300] secand longClick succ ");
let textComponent5 = await driver.findComponent(BY.text('全选'));
await textComponent5.click()
let textComponent6 = await driver.findComponent(BY.text('剪切'));
await textComponent6.click()
await CommonFunc.sleep(1000);
console.info("[SearchJsunit_0300] click cut succ ");
let strJson4 = getInspectorByKey('cut');
let obj4 = JSON.parse(strJson4);
console.info("[SearchJsunit_0300] obj4: " + JSON.stringify(obj4));
......@@ -181,6 +188,7 @@ export default function SearchJsunit() {
let textComponent8 = await driver.findComponent(BY.text('粘贴'));
await textComponent8.click()
await CommonFunc.sleep(1000);
console.info("[SearchJsunit_0300] click paste succ ");
let strJson5 = getInspectorByKey('paste');
let obj5 = JSON.parse(strJson5);
console.info("[SearchJsunit_0300] obj5: " + JSON.stringify(obj5));
......@@ -190,8 +198,11 @@ export default function SearchJsunit() {
let textComponent7 = await driver.findComponent(BY.key('button'));
await textComponent7.click();
await CommonFunc.sleep(1000);
let text = await textComponent7.getText();
expect(text).assertEqual('Set caretPosition 2');
console.info("[SearchJsunit_0300] click button succ ");
let strJson6 = getInspectorByKey('button');
let obj6 = JSON.parse(strJson6);
console.info("[SearchJsunit_0300] obj6: " + JSON.stringify(obj6));
expect(obj6.$attrs.label).assertEqual('Set caretPosition 2');
console.info('[SearchJsunit_0300] END');
done();
});
......@@ -233,7 +244,7 @@ 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('CLICK_SEARCH');
expect(obj.$attrs.searchButton).assertEqual('search');
expect(obj.$attrs.placeholderColor).assertEqual('#FF00000A');
expect(obj.$attrs.value).assertEqual('');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}');
......
......@@ -96,10 +96,8 @@ export default function TextInputJsunit() {
console.info("[TextInputJsunit_0200] textAlign: " + JSON.stringify(obj.$attrs.textAlign));
expect(obj.$attrs.placeholder).assertEqual('inline style');
expect(obj.$attrs.type).assertEqual('InputType.Normal');
expect(obj.$attrs.placeholderColor).assertEqual('#FF182431');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"16.00fp","weight":"400","fontFamily":"sans-serif"}');
expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Done');
expect(obj.$attrs.caretColor).assertEqual('#FF007DFF');
expect(obj.$attrs.maxLength).assertEqual('INF');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start');
expect(obj.$attrs.showPasswordIcon).assertEqual(true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册