Skip to main content

significantAttributes

tip

UI Coverage is a paid add-on. Schedule a demo today and see how easy it is to enhance your testing while speeding up your development process.

UI Coverage has logic that automatically identifies and groups elements based on their appearance and structure in the DOM.

Sometimes, your project may use custom attributes to identify elements that are not considered "significant" to the identification and grouping rules used by UI Coverage by default. This can cause UI Coverage to identify and group elements incorrectly, as it does not use the most meaningful attributes available.

The attributes listed in significantAttributes are considered "significant" and are prioritized above the default significant attributes, but below data-cy-ui-id and data-cy-ui-group, for the purpose of identification and grouping.

Syntax​

{
"uiCoverage": {
"significantAttributes": [
string
]
}
}

significantAttributes​

Optional. String[]

An array of attribute names that should be considered "significant" for the purpose of identification and grouping in UI Coverage.

Examples​

Consider a custom attribute significant​

Config​

{
"uiCoverage": {
"significantAttributes": ["data-custom-id"]
}
}

HTML​

<body>
<input id="a" data-custom-id="foo"></input>
<input id="b" data-custom-id="bar"></input>
<input id="c" data-custom-id="bar"></input>
</body>

Elements shown in UI​

[data-custom-id="foo"]
[data-custom-id="bar"] (2 instances)