0

I am new to cypress and I am learning it.

I want to confirm that I have landed on a ‘Thank you’ page after clicking on submit button and landing on thank you page.

How do I check this using cypress.

Can anyone please help me with this.

Thanks in advance. Appreciate your help.

Preeti D
  • 21
  • 2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 24 '21 at 17:01

1 Answers1

0

So at first, you need to trigger a redirect into "Thank you page" you didn't describe a way of redirecting (click or simply straight open this page).

The easiest way to do this is just verify an unique element to this page is visible like:

cy.get(*selector_unique_for_this_page*).should('be.visible')

Another method is to check url cy.url().should('include', 'thank-you.html');

Or you can validate also the page title by:

cy.title().should('eq', 'Thank you page')

Toster
  • 361
  • 3
  • 17