-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add useCustomLocator() for non-DOM locators #302
base: main
Are you sure you want to change the base?
Conversation
All DOM-specific parts of the existing locator have been moved into their own folder, DOMLocator. existing calls to `useLocator()` will continue to use the DOM locator, but as an opt-in you can provide a custom locator with the same API as the DOM locator. The types your custom locator are expected to match can be found at `locator/types.ts`.
|
|
||
export type {LocationAttr, LocatorComponent, TargetIDE, TargetURLFunction} from './find-components' | ||
|
||
export type LocatorOptions = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not make LocatorOptions DOM-agnostic without changing the api. targetIDE is fine, but key assumes the browser's implementation of keyboard keys
|
||
// TODO: rename or remove? | ||
// this is used externally so any change is a change in API | ||
export type {LocatorOptions} from './DOMLocator/types' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If breaking changes are OK I would maybe rename this to DOMLocatorOptions
All DOM-specific parts of the existing locator have been moved into their own folder, DOMLocator. existing calls to
useLocator()
will continue to use the DOM locator, but as an opt-in you can provide a custom locator with the same API as the DOM locator. The types your custom locator are expected to match can be found atlocator/types.ts
.