Is it possible to do some sort of text check? Basi...
# help
g
Is it possible to do some sort of text check? Basically if I have a very long text and I want to see if the word 'Hello' is in the text using Cypress?
f
Hi again 🙂 yeah, there's plenty of ways to do this. You're talking about text in an element, I take it?
g
Oh hi there!
well its actually a XML response
from an API
and I have a word that I take from the HTML using Cypress
and I want to see if the word is in the API response
@fresh-doctor-14925
f
Please don't @ me for a response. If you need more urgent replies, you may wish to consider paying for a dashboard plan to get premium cypress support https://www.cypress.io/pricing/
You can perform assertions on responses from
cy.request()
using
expect()
, in conjunction with the syntax listed here https://docs.cypress.io/guides/references/assertions#Chai
g
Oh im sorry, I thought u just didnt see the message as I don tget any notificaitons if anyone replies in a thread
f
No worries. I see them, I just can't always reply right away
g
All goodie! sorry for that 😁 also thanks for the help! Managed to go forward. I used instead includes 😁