From 974c0f1e81bb226322aa250db36baa1bb9e0bb05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Sat, 14 Sep 2024 12:15:02 +0200 Subject: [PATCH] fix(cypress): roboto loading check for visual regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- cypress/e2e/visual-regression.cy.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/visual-regression.cy.ts b/cypress/e2e/visual-regression.cy.ts index 9712ec1cb..f721eb966 100644 --- a/cypress/e2e/visual-regression.cy.ts +++ b/cypress/e2e/visual-regression.cy.ts @@ -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') }) }) @@ -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')