For test automation, we would need "attributes" to find elements to interact with easy
and stable. Is it possible to provide a build that has these kind of attributes?
The general idea is for html elements to have an attribute `data-cy` or `data-test-id`, example:
The idea behind this is, id and class can change, but `data-test-id` will always stay the same, so the test case can stay the same even if the button style changes due to a change in the class.
If something similar would be possible for cumulocity too, then it would mean that we can write tests once and they would always work. One thing that we have to think about and agree on, is what name for the `data-test-id` to use. Do all of them have to be unique or not and etc.
Here is nice link for best practices when using data-cy: https://www.bigbinary.com/learn-qaautomation-using-cypress/data-cy-conventions
Here is nice link with good example when using data-cy: https://medium.com/agilix/angular-and-cypress-data-cy-attributes-d698c01df062
Only comment I have about this link is to not have data-cy attribute twice...
This: <button data-cy="first" (click)="first()" data-cy="first">First button</button>
this one should never expire: data_cy_elements.txt
@Levon: Please provide again the document, the link for accessing it expired.
Hello, I've attached a document which specifies which elements we would like to have an attribute on: data_cy_elements.txt
Please let me know if this is sufficient.
We do plan to add unique identifiers to many UI elements with future releases (10.14 and onwards). If there are specific UI elements for which you need a unique identifier, please send us a list with the description of the element (which app / view / element) to make sure that we consider them.