File tree 3 files changed +24
-6
lines changed
3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 7
7
installTestingLibraryFixture ,
8
8
queriesFixture as locatorQueriesFixture ,
9
9
options ,
10
+ queriesFor ,
10
11
registerSelectorsFixture ,
11
12
withinFixture ,
12
13
} from './locator'
@@ -35,9 +36,11 @@ interface LocatorFixtures extends Partial<Config> {
35
36
36
37
export { configure } from '..'
37
38
38
- export type { ElementHandleFixtures as TestingLibraryFixtures }
39
- export { elementHandleQueriesFixture as fixture }
40
- export { elementHandleFixtures as fixtures }
41
- export type { LocatorFixtures }
42
- export { locatorQueriesFixture }
43
- export { locatorFixtures }
39
+ export type { ElementHandleFixtures as TestingLibraryFixtures , LocatorFixtures }
40
+ export {
41
+ locatorFixtures ,
42
+ locatorQueriesFixture ,
43
+ elementHandleQueriesFixture as fixture ,
44
+ elementHandleFixtures as fixtures ,
45
+ queriesFor ,
46
+ }
Original file line number Diff line number Diff line change @@ -92,6 +92,20 @@ const createFindQuery =
92
92
return locator
93
93
}
94
94
95
+ /**
96
+ * Given a `Page` or `Locator` instance, return an object of Testing Library
97
+ * query methods that return a `Locator` instance for the queried element
98
+ *
99
+ * @internal this API is not currently intended for public usage and may be
100
+ * removed or changed outside of semantic release versioning. If possible, you
101
+ * should use the `locatorFixtures` with **@playwright/test** instead.
102
+ * @see {@link locatorFixtures }
103
+ *
104
+ * @param pageOrLocator `Page` or `Locator` instance to use as the query root
105
+ * @param config Testing Library configuration to apply to queries
106
+ *
107
+ * @returns object containing scoped Testing Library query methods
108
+ */
95
109
const queriesFor = ( pageOrLocator : Page | Locator , config ?: Partial < Config > ) =>
96
110
allQueryNames . reduce (
97
111
( rest , query ) => ( {
Original file line number Diff line number Diff line change 6
6
withinFixture ,
7
7
} from './fixtures'
8
8
export type { Queries } from './fixtures'
9
+ export { queriesFor } from './helpers'
You can’t perform that action at this time.
0 commit comments