mercredi 16 décembre 2020

Cypress Command log truncate

Is it possible to truncate the Command Log for the assertion methods?

I have such test

cy.request('/').its('body').should('contain' 'somestring');

The body contains the whole page HTML as a string which results in massive pollution in the Command log in cypress which leads to memory issues. If I would like to do more assertions it will crash cypress.

How can truncate the assert log so it doesn't load the whole body in the assertion Command Log enter image description here

I've tried saving the HTML string to file and reading it so I could make an assertion like on a normal page but currently, it seems not possible in Cypress to load the local file.

Cherrio is also a thing I could potentially use to retrieve data from that HTML string but I would like to avoid using it.

Aucun commentaire:

Enregistrer un commentaire