I want to test for broken images on the page.
If I inspect the DOM for the broken image I see
<img src="https://www.example.com/images/a123.jpg" alt="a123">
#shadow-root (user-agent)
<span id="alttext-container">
<img id="alttext-image" width="16" height="16" align="left" style="margin: 0px;
display: inline; float: left;">
<span id="alttext">a123</span>
</span>
But if I try to access the alttext in the test it fails.
cy.get('img[src="https://www.example.com/images/a123.jpg"]')
.shadow()
.find('span[id="alttext"]')
How do I verify the alt text that shows on the screen.