busola icon indicating copy to clipboard operation
busola copied to clipboard

Provide test-specific attributes for read-only components

Open triffer opened this issue 1 year ago • 0 comments

Description In the UI test of our modules we would like to have more stable selectors. We currently have a hard time creating long time reliable selectors, because most of the selectors would include structural or styling details. Since we use the templating, this is completely out of our control. We currently have the following specific use cases:

  • in a resource list we want to get a specific field in a column to assert the content
  • in a details view, we want to select a header field to assert the content

One idea is to make a data-testid available for every field that is configured in our module in the templating. We should also be cautious about putting data-testid in production code, so a special image that includes this attribute for UI testing might be a good idea.

Reasons We want to have more reliable tests in out module that don't fail if the styling/components used change in Busola.

Attachments

triffer avatar Feb 14 '24 12:02 triffer