WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 7e66f75

Browse files
committed
Cypres wait for images
1 parent 66a4b39 commit 7e66f75

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

cypress/integration/landing.spec.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
1-
const waitAllImagesToLoad = () =>
2-
cy
3-
.get('img', { includeShadowDom: true })
4-
.filter('[src]')
5-
.filter(':visible')
6-
.should(($images) =>
7-
$images.map((_, image: HTMLImageElement) =>
8-
expect(image.naturalWidth).to.be.greaterThan(0)
9-
)
10-
)
11-
121
describe('Landing Page', () => {
132
it('opens all sections', () => {
143
cy.visit('/')
154

16-
waitAllImagesToLoad()
5+
cy.get('img[data-placeholder-image]').should('not.be.visible')
176

187
cy.percySnapshot('Landing Page', { widths: [700, 1200] })
198
})

0 commit comments

Comments
 (0)