This repository was archived by the owner on Aug 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 77 installTestingLibraryFixture ,
88 queriesFixture as locatorQueriesFixture ,
99 options ,
10+ queriesFor ,
1011 registerSelectorsFixture ,
1112 withinFixture ,
1213} from './locator'
@@ -35,9 +36,11 @@ interface LocatorFixtures extends Partial<Config> {
3536
3637export { configure } from '..'
3738
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 =
9292 return locator
9393 }
9494
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+ */
95109const queriesFor = ( pageOrLocator : Page | Locator , config ?: Partial < Config > ) =>
96110 allQueryNames . reduce (
97111 ( rest , query ) => ( {
Original file line number Diff line number Diff line change 66 withinFixture ,
77} from './fixtures'
88export type { Queries } from './fixtures'
9+ export { queriesFor } from './helpers'
You can’t perform that action at this time.
0 commit comments