Shopify / polaris

Shopify’s design system to help us work together to build a great experience for all of our merchants.
https://polaris.shopify.com
Other
5.82k stars 1.17k forks source link

Pass thru data-testid for automated testing (cypress/playwright/...) #12939

Open gerwinbrunner opened 2 days ago

gerwinbrunner commented 2 days ago

Summary

Summary it would be great if all data-... props to a component would be passed thru.

It works for Box, but does not for i.e. Page component.

This is a repost of: https://github.com/Shopify/polaris/issues/3056 and https://github.com/Shopify/polaris/issues/11710

Rationale To do automated testing with i.e. cypress you would need in some cases to set the data-testid prop on specific elements.

This is not possible to do with just the id prop (multiple elements of the same kind) or with plain xpath expressions.

Rationale

No response