https://cypress.io logo
Assert text with random part in the middle of it.
# i-need-help
m
Hello, Thanks for looking here 😄 I am using this command: cy.contains(some_string); Now the string I pass to assert looks this way "This is the text that I want to assert". I can't predict the content of but I want to assert if the sentence appeared. I can split it into two assertions steps but I don't like that. Any ideas how could I pass this "randomness" to my assertion?
g
read https://on.cypress.io/contains - this command allows using regular expression
m
Thank you Gleb 👍