3 ms·
Until you have a ton of automated tests. Then a markup (class) change breaks all the selectors used in the tests - not fun. I prefer to abstract the styling so
by steveax 12y ago
Until you have a ton of automated tests. Then a markup (class) change breaks all the selectors used in the tests - not fun. I prefer to abstract the styling so I don't have to fix the tests if the styling needs to change.
- psychometry 12y agoAn HTML element can have both a class and an ID or multiple classes. Your tests should not have any knowledge of your framework's classes.
- steveax 12y agoSo your saying that tests should always rely only on the id attribute? Tell me how you target elements that have id attributes auto-generated by a framework either on the front end, Ember for instance, or the back end? It's a nice idea, but falls over pretty spectacularly in the real world when you have a complicated web application.
- psychometry 12y agoRead my comment again. You can select elements using whatever CSS/XPATH selectors you want. Whether those elements have additional presentational CSS classes on them is completely irrelevant since the selectors will still work.