Skip to content

← All questions

testIdAttribute is data-test, so why does the heal suggestion say getByTestId?

Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.

Our app has used data-test since long before we adopted SDODS. I set it in the project file:

yaml
testIdAttribute: data-test

Heal report suggests getByTestId('cart-badge') for a locator that healed. I pasted that into the page object expecting it to look for data-testid and fail. It works. I would like to understand why before I trust it in twenty other places.

2 answers

Know the answer?

Wrap commands and output in triple backticks and they will render as a code block.

Checking whether you’re signed in…

Have a different question? Ask it.

Related