Several frontend frameworks support data-test-* attributes. They are intended to be used in tests, not in production. It allows tests to easily identify elements in the DOM, without relying on long CSS selectors or element IDs, and without impacting the behaviour of the application. In fact, several frameworks render data-test-* attributes only during development, not during production. It would be nice if Seaside would support data-test-* attributes too.
The first step is to have a dedicated method to add a data-test-* attribute. Seaside provides WATagBrush>>#htmlDataAttributeAt:put:, which means that today code like this is required to add a data-test-* attribute:
html htmlDataAttributeAt: 'test-some-element' put: true
Several frontend frameworks support
data-test-*
attributes. They are intended to be used in tests, not in production. It allows tests to easily identify elements in the DOM, without relying on long CSS selectors or element IDs, and without impacting the behaviour of the application. In fact, several frameworks renderdata-test-*
attributes only during development, not during production. It would be nice if Seaside would supportdata-test-*
attributes too.The first step is to have a dedicated method to add a
data-test-*
attribute. Seaside providesWATagBrush>>#htmlDataAttributeAt:put:
, which means that today code like this is required to add adata-test-*
attribute:I suggest adding: