From 8890006c439bf382cdcfc238a9997d5c455fac5e Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 11 Mar 2025 17:19:39 +0100 Subject: [PATCH] fix: refs #8581 update validateDownload command to support multiple file types --- test/cypress/support/commands.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 137b61c4f..91fa4cfff 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -473,6 +473,7 @@ Cypress.Commands.add('validateDescriptor', (toCheck = {}) => { }); Cypress.Commands.add('validateVnTableRows', (opts = {}) => { + cy.waitTableLoad(); let { cols = [], rows = [] } = opts; if (!Array.isArray(cols)) cols = [cols]; const rowSelector = rows.length @@ -545,14 +546,17 @@ Cypress.Commands.add('validateCheckbox', (selector, expectedVal = 'true') => { Cypress.Commands.add('validateDownload', (trigger, opts = {}) => { const { url = /api\/dms\/\d+\/downloadFile\?access_token=.+/, - type = 'text/plain', + types = ['text/plain', 'image/jpeg'], alias = 'download', } = opts; cy.intercept('GET', url).as(alias); trigger(); cy.wait(`@${alias}`).then(({ response }) => { expect(response.statusCode).to.equal(200); - expect(response.headers['content-type']).to.include(type); + const isValidType = types.some((type) => + response.headers['content-type'].includes(type), + ); + expect(isValidType).to.be.true; }); });