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

!5544 web组件失败用例修改

Merge pull request !5544 from 章靖/OpenHarmony-3.2-Beta3
...@@ -55,6 +55,7 @@ struct Index { ...@@ -55,6 +55,7 @@ struct Index {
@State cacheError:boolean=false @State cacheError:boolean=false
@State mixedSwitch:boolean=false @State mixedSwitch:boolean=false
@State mixedAllSwitch:boolean=false @State mixedAllSwitch:boolean=false
@State overViewFalseHeight:number=0
onPageShow(){ onPageShow(){
let valueChangeEvent={ let valueChangeEvent={
eventId:10, eventId:10,
...@@ -207,6 +208,28 @@ struct Index { ...@@ -207,6 +208,28 @@ struct Index {
this.geoShow=false this.geoShow=false
} }
}) })
.onBlur(()=>{
console.info("onBlur==>")
this.controller.requestFocus()
})
TextInput({placeholder:"inputs your words"})
.key('textInput')
.type(InputType.Normal)
.placeholderColor(Color.Blue)
.placeholderFont({size:20,weight:FontWeight.Normal,family:"sans-serif",style:FontStyle.Normal})
.enterKeyType(EnterKeyType.Next)
.caretColor(Color.Green)
.height(60)
.fontSize(30)
.fontWeight(FontWeight.Bold)
.fontFamily("cursive")
.fontStyle(FontStyle.Italic)
.fontColor(Color.Red)
.maxLength(20)
.border({width:1,color:0x317AF7,radius:10,style:BorderStyle.Solid})
.onClick(()=>{
console.info("TextInput click")
})
Row(){ Row(){
Button("web click").key('webcomponent').onClick(async ()=>{ Button("web click").key('webcomponent').onClick(async ()=>{
console.info("key==>"+this.str) console.info("key==>"+this.str)
...@@ -301,7 +324,8 @@ struct Index { ...@@ -301,7 +324,8 @@ struct Index {
} }
case "emitGetRequestFocus":{ case "emitGetRequestFocus":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/second.html"}) this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/second.html"})
this.controller.requestFocus() await Utils.sleep(2000)
sendEventByKey('textInput',10,'')
break; break;
} }
case "emitAccessBackward":{ case "emitAccessBackward":{
...@@ -489,9 +513,11 @@ struct Index { ...@@ -489,9 +513,11 @@ struct Index {
await Utils.sleep(1000) await Utils.sleep(1000)
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/overview.html"}) this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/overview.html"})
setTimeout(()=>{ setTimeout(()=>{
let webPageHeight=this.controller.getPageHeight()
this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{ this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
this.overViewFalseHeight=parseInt(res)
console.info("getViewResult==>"+res) console.info("getViewResult==>"+res)
Utils.emitEventTwo(1150,res,168) Utils.emitEventTwo(webPageHeight,res,168)
}}) }})
},3000) },3000)
break; break;
...@@ -503,7 +529,7 @@ struct Index { ...@@ -503,7 +529,7 @@ struct Index {
setTimeout(()=>{ setTimeout(()=>{
this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{ this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
console.info("getViewResult==>"+res) console.info("getViewResult==>"+res)
Utils.emitEventTwo(2350,res,170) Utils.emitEventTwo(this.overViewFalseHeight,parseInt(res),170)
}}) }})
},3000) },3000)
break; break;
......
...@@ -132,4 +132,22 @@ export default class Utils { ...@@ -132,4 +132,22 @@ export default class Utils {
console.info("emit emitKey err: " + JSON.stringify(err)); console.info("emit emitKey err: " + JSON.stringify(err));
} }
} }
static registerLargerEvent(testCaseName,eventId,done){
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.actualValue).assertLarger(backData.data.expectedValue);
console.info(`[${testCaseName}] END`);
done()
}
let innerEvent = {
eventId:eventId,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(innerEvent,callBack)
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
} }
...@@ -389,7 +389,7 @@ export default function webJsunit() { ...@@ -389,7 +389,7 @@ export default function webJsunit() {
*/ */
it('overviewModeAccessTrue',0,async function(done){ it('overviewModeAccessTrue',0,async function(done){
emitKey="emitOnPrompt"; emitKey="emitOnPrompt";
Utils.registerEventTwo("overviewModeAccessTrue",170,done); Utils.registerLargerEvent("overviewModeAccessTrue",170,done);
sendEventByKey('webcomponent',10,''); sendEventByKey('webcomponent',10,'');
}) })
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册