提交 7bc244a0 编写于 作者: W wang-xupeng2

modify textInput testcase

Signed-off-by: Nwang-xupeng2 <wangxupeng2@huawei.com>
上级 ac0eb0f4
...@@ -24,7 +24,7 @@ struct TextInputPage { ...@@ -24,7 +24,7 @@ struct TextInputPage {
@State enterKeyType: EnterKeyType = EnterKeyType.Search @State enterKeyType: EnterKeyType = EnterKeyType.Search
@State caretColor: Color = Color.Blue @State caretColor: Color = Color.Blue
@State maxLength: number = 10 @State maxLength: number = 10
@State copyOption: CopyOptions = CopyOptions.None @State copyOption: CopyOptions = CopyOptions.InApp
@State showPasswordIcon: boolean = false @State showPasswordIcon: boolean = false
@State style: TextInputStyle = TextInputStyle.Default @State style: TextInputStyle = TextInputStyle.Default
@State textAlign: TextAlign = TextAlign.Center @State textAlign: TextAlign = TextAlign.Center
......
...@@ -70,7 +70,7 @@ export default function TextInputJsunit() { ...@@ -70,7 +70,7 @@ export default function TextInputJsunit() {
expect(obj.$attrs.maxLength).assertEqual('10'); expect(obj.$attrs.maxLength).assertEqual('10');
expect(obj.$attrs.style).assertEqual('TextInputStyle.Default'); expect(obj.$attrs.style).assertEqual('TextInputStyle.Default');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.None'); expect(obj.$attrs.copyOption).assertEqual('CopyOptions.InApp');
expect(obj.$attrs.showPasswordIcon).assertEqual(false); expect(obj.$attrs.showPasswordIcon).assertEqual(false);
console.info('[TextInputJsunit_0100] END'); console.info('[TextInputJsunit_0100] END');
done(); done();
...@@ -192,14 +192,14 @@ export default function TextInputJsunit() { ...@@ -192,14 +192,14 @@ export default function TextInputJsunit() {
let textComponent3 = await driver.findComponent(BY.text('全选')); let textComponent3 = await driver.findComponent(BY.text('全选'));
await textComponent3.click() await textComponent3.click()
await CommonFunc.sleep(200); await CommonFunc.sleep(200);
//let textComponent4 = await driver.findComponent(BY.text('复制')); let textComponent4 = await driver.findComponent(BY.text('复制'));
//await textComponent4.click() await textComponent4.click()
await textComponent.click() await textComponent.click()
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('copy'); let strJson = getInspectorByKey('copy');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[TextInputJsunit_0400] component obj is: " + JSON.stringify(obj)); console.info("[TextInputJsunit_0400] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('onCopy:'); expect(obj.$attrs.content).assertEqual('onCopy:hello');
console.info("[TextInputJsunit_0400] Verify copy succ !"); console.info("[TextInputJsunit_0400] Verify copy succ !");
// Verify onCut function of TextInput component // Verify onCut function of TextInput component
...@@ -210,13 +210,25 @@ export default function TextInputJsunit() { ...@@ -210,13 +210,25 @@ export default function TextInputJsunit() {
await CommonFunc.sleep(200); await CommonFunc.sleep(200);
let textComponent6 = await driver.findComponent(BY.text('剪切')); let textComponent6 = await driver.findComponent(BY.text('剪切'));
await textComponent6.click() await textComponent6.click()
//await textComponent.click()
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let strJson1 = getInspectorByKey('cut'); let strJson1 = getInspectorByKey('cut');
let obj1 = JSON.parse(strJson1); let obj1 = JSON.parse(strJson1);
console.info("[TextInputJsunit_0400] component obj1 is: " + JSON.stringify(obj1)); console.info("[TextInputJsunit_0400] component obj1 is: " + JSON.stringify(obj1));
expect(obj1.$attrs.content).assertEqual('onCut:'); expect(obj1.$attrs.content).assertEqual('onCut:hello');
console.info("[TextInputJsunit_0400] Verify cut succ !"); console.info("[TextInputJsunit_0400] Verify cut succ !");
// Verify onPaste function of TextInput component
await textComponent.click()
await textComponent.longClick()
await CommonFunc.sleep(1000);
let textComponent7 = await driver.findComponent(BY.text('粘贴'));
await textComponent7.click()
await CommonFunc.sleep(1000);
let strJson2 = getInspectorByKey('paste');
let obj2 = JSON.parse(strJson2);
console.info("[TextInputJsunit_0400] component obj2 is: " + JSON.stringify(obj2));
expect(obj2.$attrs.content).assertEqual('onPaste:hello');
console.info("[TextInputJsunit_0400] Verify paste succ !");
console.info('[TextInputJsunit_0400] END'); console.info('[TextInputJsunit_0400] END');
done(); done();
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册