Last active
March 24, 2023 20:30
-
-
Save Julianhm9612/3682e458598a6994a73b1befd88e308d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('Validate the images displayed', () => { | |
cy.get('.v-image__image').each(($el) => { | |
const image = $el.css('background-image').replace('url("', '').replace('")', '') | |
cy.request(image).then((res) => { | |
expect(res.status).to.eql(200); | |
}); | |
}); | |
}); | |
it('Validate the images displayed', () => { | |
cy.get('.image', { includeShadowDom: true }) | |
.filter('[src]') | |
.should(($imgs) => $imgs.map((i, /** @type {HTMLImageElement} */ img) => expect(img.naturalWidth).to.be.greaterThan(0))); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment