Load HTML string #14197
Answered
by
bahmutov
stychu
asked this question in
Component Testing
Load HTML string
#14197
-
Is it possible to load the HTML string I cypress?? I need a way to assert some element existence when doing API calls. cy.request('/').its('body') <- returns me a HTML string as a response If I do directly
It does the job but unfortunately, this loads the whole HTML string to the cypress command log, and having few of this kind of assertions make cypress run out of memory. |
Beta Was this translation helpful? Give feedback.
Answered by
bahmutov
Dec 16, 2020
Replies: 1 comment 10 replies
-
You can skip logging them cy.request('/').its('body', {log: false})
.then(text => {
if (!text.includes(somestring)) {
throw new Error('Text does not have the expected string')
}
}) |
Beta Was this translation helpful? Give feedback.
10 replies
Answer selected by
bahmutov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can skip logging them