diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index 7045ae0f0..df6099bf7 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -51,9 +51,14 @@ before(() => { beforeEach(() => { const baseUrl = Cypress.env('dhis2BaseUrl') const instanceVersion = Cypress.env('dhis2InstanceVersion') + const hideRequestsFromLog = Cypress.env('hideRequestsFromLog') const envVariableName = computeEnvVariableName(instanceVersion) const { name, value, ...options } = JSON.parse(Cypress.env(envVariableName)) + if (hideRequestsFromLog) { + // disable Cypress's default behavior of logging all XMLHttpRequests and fetches + cy.intercept({ resourceType: /xhr|fetch/ }, { log: false }) + } localStorage.setItem(LOCAL_STORAGE_KEY, baseUrl) cy.setCookie(name, value, options)