Is there a recommended approach for automatically testing css selectors?
I am in the process of developing a SCSS framework and I want to integrate automated tests. Specifically, I aim to verify that the css selectors are functioning correctly.
For example, if I have the following HTML:
<input class="btn" disabled id="test"></input>
and corresponding CSS:
.btn {
color: red;
...
}
.btn:disabled {
color: green;
...
}
I want to create a test to confirm that the element with id=test has .btn:disabled as the highest priority CSS class (the last one with the most specificity) and .btn as the second-highest priority. Essentially, I need to ensure that both .btn:disabled and .btn styles are applied to the element, with the styles from .btn:disabled taking precedence over those from .btn.
I am considering using Selenium for this task. Are there effective methods for achieving this without hard-coding the css values into the tests?