Selector Configuration
Every selector accepts configuration as a second argument:
alias#
Assigns an alias to a selector. This alias can be used to reference that element as a parent of another selector.
parentAlias#
Allows referencing parent of a selector via its alias.
note
Please note, that child-parent relationship via alias works only within one class.
attribute#
Custom attribute to be used by @ByAttribute selector. Being ignored by all other selectors.
eq#
Index of a DOM element in an array of elements.
note
Works with both XPath and CSS selectors. However, please note that it is not going to work if your XPath selector returns string, number or boolean.
timeout#
Selector timeout. By default, the library inherits timeout configuration from Cypress.
parent#
Allows referencing parent of a selector via reference to another selector.
note
- This kind of child-parent relationship doesn't have 'one-class' limitation and works across all classes with selectors.
- It is possible to use the
XPathselector as a parent for theCSSselector and vise versa. XPathselectors that specify parents, should use relative location path (e.g../divinstead of//div). Otherwise, theparentattribute forXPathselector that uses absolute location path is going to be ignored.
ignoreCase#
Makes text selector case insensitive.
note
Works only with @ByExactText, @ByPartialText, @ByPartialLinkText and @ByExactLinkText selectors.