Re:Show HN: I created a browser automation tool
by yowmamasita on Saturday August 06, 2022 @10:08AM
(#32368221)
It detects the data-testid attribute quite well. We use it at work in replacement of manually creating cypress scripts.
Re:Show HN: I created a browser automation tool
by EddySchauHai on Saturday August 06, 2022 @12:22PM
(#32369402)
That’s good to know, I had bad luck with it then. But even so, you also lost the ability to use testing patterns like the page object model where you can update changing IDs or flows more easily - if something changes drastically early in the recording, wouldn’t it need to be re-recorded for all test cases?
Best practice is to add test attributes to the HTML elements (such as data-testid="SubmitButton") so if the page is moved around or the button is edited the tests remain stable. There's a lot of good online sources on making UI testing somewhat more reliable :)