滑动自动化 - WebdriverIO - javascript Mobile
我是 javascript 新手,我正在遵循此代码,但是当开始自动化时,它不会滑下页面。 (移动)
`$(FORMS_ICON_HOME_SCREEN).click()
const {height} = driver.getWindowSize()
const anchorPercentage = 50
const startPointPercentage = 90
const endPointPercentage = 10
const anchor = height * anchorPercentage / 100
const startPoint = height * startPointPercentage / 100
const endPoint = height * endPointPercentage / 100
await $(FORM_HEADER_TEXT).click()
driver.touchPerform([
{
action: 'press',
options: {
x: anchor,
y: startPoint
}
},
{
action: 'wait',
options: {
ms: 1000
}
},
{
action: 'moveTo',
options: {
x: anchor,
y: endPoint
}
},
{
action: 'release',
options: {}
}
])
await $(ACTIVE_BUTTON).click()
});
});
` 当我开始时,请提供尽可能详细的信息。感谢你
I'm new to javascript and I'm following this code but when starting automation it doesn't slide down page. (mobile)
`$(FORMS_ICON_HOME_SCREEN).click()
const {height} = driver.getWindowSize()
const anchorPercentage = 50
const startPointPercentage = 90
const endPointPercentage = 10
const anchor = height * anchorPercentage / 100
const startPoint = height * startPointPercentage / 100
const endPoint = height * endPointPercentage / 100
await $(FORM_HEADER_TEXT).click()
driver.touchPerform([
{
action: 'press',
options: {
x: anchor,
y: startPoint
}
},
{
action: 'wait',
options: {
ms: 1000
}
},
{
action: 'moveTo',
options: {
x: anchor,
y: endPoint
}
},
{
action: 'release',
options: {}
}
])
await $(ACTIVE_BUTTON).click()
});
});
`
As I'm starting, putting as much detail as possible, please. Thank u
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论