The difference between the two is that hiding using the "visible" attribute leaves the element on the page, rather than actually displaying. Thus, this distance will be taken into account when the page displays the rest of the screen.
It seems like this does another way, it actually stops the element that is placed on the page, which can change the way other elements are placed on the page.
Usually testing the visible part is enough from my experience, but if you want to be more complete, then yes, you will need to check using "& &". conditions for multiple attributes. In fact, it all depends on how clean the code you use is and how well the other aspects of the system user interface are tested.
Another goal to consider is the goal of the test. Are you testing the code you wrote, or how does the browser use Javascript to render the page? You want to test the generated code and rely on the browser working (because if the browser stops working, then all this is unreliable). Therefore, if your code tells the element to set some attribute, checking this attribute is all you need to do. Everything that can actually be really proved is tested outside the code itself (as with manual page viewing, etc.).
Caleb source share