Hello there, awesome little library you have built!
I am trying to construct some selectors based on an injected web-component that uses the shadow dom to shield the component from unwanted style changes.
This would be the shadow host:
class ParentSelector {
@By.Type('product-host', { eq: 0 }) static base: Selector;
}
And these would be the elements within the shadow dom:
const testAttribute = { attribute: 'data-testid', parent: ParentSelector.base };
class ProductCardSelectors {
@By.Attribute('product-title', testAttribute) static title: Selector;
@By.Attribute('product-images-slide', testAttribute) static image: Selector;
@By.Attribute('product-card-add', testAttribute) static addButton: Selector;
@By.Attribute('product-price', testAttribute) static price: Selector;
@By.Attribute('product-merchant', testAttribute) static vendor: Selector;
@By.Attribute('stock', partAttribute) static outOfStockBadge: Selector;
}
I know I can reference the parent by passing in parent config option - but how can I tell the ProductCardSelectors class to traverse the shadow dom?
Do you have a recipe or workaround for this perhaps?
Cheers 😄
Hello there, awesome little library you have built!
I am trying to construct some selectors based on an injected web-component that uses the shadow dom to shield the component from unwanted style changes.
This would be the shadow host:
And these would be the elements within the shadow dom:
I know I can reference the parent by passing in parent config option - but how can I tell the ProductCardSelectors class to traverse the shadow dom?
Do you have a recipe or workaround for this perhaps?
Cheers 😄