Lately, I've been using Cypress for testing my code. However, I encountered an issue where the content-header is missing when running the app on Chrome controlled by Cypress. The response content length plays a crucial role in the functionality of my software as it is used for computations. I am seeking a solution to retrieve the content-length value for writing my tests. The particular section of my test code where this problem arises is shown below:
cy.get('#setSelectedComponent').click().then(() => {
cy.contains('Part C').click()
cy.get('#createInstanceFromAsmTree').click({ force: true })
cy.get(`[aria-label="Toggle Assembly D"]`).click({ force: true })
cy.get('#matTreeNode').contains('Part C-1').should('be.visible')
})
The 'cy.contains('Part C').click()' part is where the absence of content-header causes issues.