提交 4976b23d 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

fix(uts): 修复自动化测试 $$ 标签选择器获取失败问题

上级 a1aa6f50
......@@ -72,9 +72,13 @@ export const getElements = (
callback
)
if (element != null) {
let selector = params.selector
if (selector.startsWith('uni-')) {
selector = selector.replace('uni-', '')
}
// @ts-ignore
const list: UTSJSONObject[] = []
getValidNodes(element, params.selector, list, true)
getValidNodes(element, selector, list, true)
callback({ elements: list }, null)
}
}
......
......@@ -80,7 +80,11 @@ export const getElements = (params: GetElementParams, callback: Callback): void
if (page == null) {
callback(null, { errMsg: `Page[${params.pageId}] not exists` })
} else {
const elements = page.$querySelectorAll(params.selector)
let selector = params.selector
if (selector.startsWith('uni-')) {
selector = selector.replace('uni-', '')
}
const elements = page.$querySelectorAll(selector)
// @ts-ignore
const result = [] as UTSJSONObject[]
elements?.forEach(element => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册