Skip to content

Commit

Permalink
feat: XPath and Text selector types are now supported
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Sep 21, 2022
1 parent 3385cf0 commit 9d3fad2
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,22 @@ export interface StepWithFrame extends StepWithTarget {

export interface StepWithSelectors extends StepWithFrame {
/**
* A list of alternative selectors that lead to selection of a single element to perform the step on.
* Currently, we support CSS selectors and ARIA selectors (start with 'aria/'). Each selector
* could be a string or an array of strings. If it's a string, it means that the selector points directly to the target
* element. If it's an array, the last element is the selector for the target element and the preceding selectors
* point to the ancestor elements. If the parent element is a shadow root host, the subsequent
* selector is evaluated only against the shadow DOM of the host (i.e., `parent.shadowRoot.querySelector`). If the parent
* element is not a shadow root host, the subsequent selector is evaluated in the regular DOM (i.e., `parent.querySelector`).
* A list of alternative selectors that lead to selection of a single element
* to perform the step on. Currently, we support CSS selectors, ARIA selectors
* (start with 'aria/'), XPath selectors (start with `xpath/`) and text
* selectors (start with `text/`). Each selector could be a string or an array
* of strings. If it's a string, it means that the selector points directly to
* the target element. If it's an array, the last element is the selector for
* the target element and the preceding selectors point to the ancestor
* elements. If the parent element is a shadow root host, the subsequent
* selector is evaluated only against the shadow DOM of the host (i.e.,
* `parent.shadowRoot.querySelector`). If the parent element is not a shadow
* root host, the subsequent selector is evaluated in the regular DOM (i.e.,
* `parent.querySelector`).
*
* During the execution, it's recommended that the implementation tries out all of the alternative selectors to improve
* reliability of the replay as some selectors might get outdated over time.
* During the execution, it's recommended that the implementation tries out
* all of the alternative selectors to improve reliability of the replay as
* some selectors might get outdated over time.
*/
selectors: Selector[];
}
Expand Down

0 comments on commit 9d3fad2

Please sign in to comment.