Search code examples
htmlvue.jscucumbercypresscypress-cucumber-preprocessor

Why is the change of <title> element in index.html not reflected in the cypress interface?


I have been trying to understand the cypress file & folder structure when used with cucumber and vue.js but it's been driving me crazy, especially when different sources say different things. My problem is I wrote the following test: screenshot of source code and browser element inspection

This is the Cypress output

When I open my website locally on chrome, I see clearly that the title element has been changed. Why is test in cypress still not passing when it should?


Solution

  • For checking the title you have to use cy.title(). So in your case it would be:

    cy.title().should('eq', 'User Registration')