@@ -30,7 +30,7 @@ function querySelector(selectors: string): HTMLElement
30
30
用法:
31
31
32
32
` ` ` js
33
- const btns = testUtils.querySelectorAll('.btns')
33
+ const btns = testUtils.queries. querySelectorAll('.btns')
34
34
` ` `
35
35
36
36
### querySelectorAll
@@ -48,7 +48,7 @@ function querySelectorAll(selectors: string): HTMLElement[]
48
48
用法:
49
49
50
50
` ` ` js
51
- const btns = testUtils.querySelectorAll('.btns')
51
+ const btns = testUtils.queries. querySelectorAll('.btns')
52
52
` ` `
53
53
54
54
### waitForQuerySelector
@@ -67,7 +67,7 @@ async function waitForQuerySelector(selectors: string, params?: TParams): Promis
67
67
用法:
68
68
69
69
` ` ` js
70
- const btn = await testUtils.waitForQuerySelector('.async-btn')
70
+ const btn = await testUtils.queries. waitForQuerySelector('.async-btn')
71
71
` ` `
72
72
73
73
### waitForQuerySelectorAll
@@ -86,7 +86,7 @@ async function waitForQuerySelectorAll(selectors: string, params?: TParams): Pro
86
86
用法:
87
87
88
88
` ` ` js
89
- const btns = await testUtils.waitForQuerySelectorAll('.async-btns')
89
+ const btns = await testUtils.queries. waitForQuerySelectorAll('.async-btns')
90
90
` ` `
91
91
92
92
## 按照文本查询
@@ -108,7 +108,7 @@ function queryByText(text: string, selector?: string): HTMLElement
108
108
109
109
` ` ` js
110
110
// <Text>Hello World!!!</Text>
111
- const textView = testUtils.queryByText('Hello World')
111
+ const textView = testUtils.queries. queryByText('Hello World')
112
112
` ` `
113
113
114
114
### queryByTextAll
@@ -129,7 +129,7 @@ function queryAllByText(text: string, selector?: string): HTMLElement[]
129
129
` ` ` js
130
130
// <Text>Hello World!!</Text>
131
131
// <View>Hello World!!!</View>
132
- const textViews = testUtils.queryAllByText('Hello World')
132
+ const textViews = testUtils.queries. queryAllByText('Hello World')
133
133
` ` `
134
134
135
135
### waitForQueryByText
@@ -150,7 +150,7 @@ async function waitForQueryByText(text: string, selector?: string, params?: TWai
150
150
151
151
` ` ` js
152
152
// <Text>Hello World!!!</Text>
153
- const textView = async testUtils.waitForQueryByText("Hello World");
153
+ const textView = async testUtils.queries. waitForQueryByText("Hello World");
154
154
` ` `
155
155
156
156
### waitForQueryAllByText
@@ -172,7 +172,7 @@ async function waitForQueryAllByText(text: string, selector?: string, params?: T
172
172
` ` ` js
173
173
// <Text>Hello World!!</Text>
174
174
// <View>Hello World!!!</View>
175
- const textViews = async testUtils.waitForQueryAllByText("Hello World");
175
+ const textViews = async testUtils.queries. waitForQueryAllByText("Hello World");
176
176
` ` `
177
177
178
178
## 按照 Placeholder 查询
@@ -193,7 +193,7 @@ function queryByPlaceholder(text: string): HTMLElement
193
193
194
194
` ` ` js
195
195
// <input placeholder="hello" />
196
- const input = testUtils.queryByPlaceholder('hello')
196
+ const input = testUtils.queries. queryByPlaceholder('hello')
197
197
` ` `
198
198
199
199
### queryAllByPlaceholder
@@ -213,7 +213,7 @@ function queryAllByPlaceholder(text: string): HTMLElement[]
213
213
` ` ` js
214
214
// <input placeholder="hello" />
215
215
// <input placeholder="hello" />
216
- const inputs = testUtils.queryAllByPlaceholder('hello')
216
+ const inputs = testUtils.queries. queryAllByPlaceholder('hello')
217
217
` ` `
218
218
219
219
### waitForQueryByPlaceholder
@@ -233,7 +233,7 @@ async function waitForQueryByPlaceholder(text: string, params?: TParams): Promis
233
233
234
234
` ` ` js
235
235
// <input placeholder="async-placeholde" />
236
- const input = await testUtils.waitForQueryByPlaceholder('async-placeholder')
236
+ const input = await testUtils.queries. waitForQueryByPlaceholder('async-placeholder')
237
237
` ` `
238
238
239
239
### waitForQueryAllByPlaceholder
@@ -254,7 +254,7 @@ async function waitForQueryAllByPlaceholder(text: string, params?: TParams): Pro
254
254
` ` ` js
255
255
// <input placeholder="async-placeholde" />
256
256
// <input placeholder="async-placeholde" />
257
- const inputs = await testUtils.waitForQueryAllByPlaceholder('async-placeholder')
257
+ const inputs = await testUtils.queries. waitForQueryAllByPlaceholder('async-placeholder')
258
258
` ` `
259
259
260
260
## 按照属性查询
@@ -276,7 +276,7 @@ function queryByAttribute(attr: string, value: any): HTMLElement
276
276
277
277
` ` ` js
278
278
// <div key="value" />
279
- const view = testUtils.queryByAttribute('key', 'value')
279
+ const view = testUtils.queries. queryByAttribute('key', 'value')
280
280
` ` `
281
281
282
282
### queryAllByAttribute
@@ -297,7 +297,7 @@ function queryAllByAttribute(attr: string, value: any): HTMLElement[]
297
297
` ` ` js
298
298
// <div key="value" />
299
299
// <div key="value" />
300
- const view = testUtils.queryAllByAttribute('key', 'value')
300
+ const view = testUtils.queries. queryAllByAttribute('key', 'value')
301
301
` ` `
302
302
303
303
### waitForQueryByAttribute
@@ -318,7 +318,7 @@ async function waitForQueryByAttribute(attr: string, value: string, params?: TPa
318
318
319
319
` ` ` js
320
320
// <div key="value" />
321
- const view = await testUtils.waitForQueryByAttribute('key', 'value')
321
+ const view = await testUtils.queries. waitForQueryByAttribute('key', 'value')
322
322
` ` `
323
323
324
324
### waitForQueryAllByAttribute
@@ -340,5 +340,5 @@ async function waitForQueryAllByAttribute(attr: string, value: string, params?:
340
340
` ` ` js
341
341
// <div key="value" />
342
342
// <div key="value" />
343
- const inputs = await testUtils.waitForQueryAllByAttribute('key', 'value')
343
+ const inputs = await testUtils.queries. waitForQueryAllByAttribute('key', 'value')
344
344
` ` `
0 commit comments