Skip to content

Commit

Permalink
fix(cypress): roboto loading check for visual regression
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Sep 14, 2024
1 parent d5a0c36 commit 974c0f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cypress/e2e/visual-regression.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ describe('Visual regression tests', function() {
cy.window().then((win) => {
// Load roboto font for visual regression consistency
win.loadRoboto = true
win.document.body.style.fontFamily = 'Roboto'
win.document.body.style.setProperty('--font-face', 'Roboto')
win.document.body.style.setProperty('font-family', 'Roboto')
})
})

Expand All @@ -52,9 +53,11 @@ describe('Visual regression tests', function() {
})

it('Open the viewer on file click', function() {
cy.intercept('GET', '**/viewer/css/fonts/roboto-*').as('roboto-font')
cy.intercept('GET', '**/core/preview*').as('image1')
cy.intercept('GET', '/remote.php/dav/files/*/test-card.mp4').as('video')
cy.openFile('test-card.mp4')
cy.wait('@roboto-font')
cy.wait('@video')
// We preload images, so we can check its loading here and not when clicking next
cy.wait('@image1')
Expand Down

0 comments on commit 974c0f1

Please sign in to comment.