Cypress not finding elements in mendix app

I have used cypress before in testing websites. Not saying that I am that good with it but I have made it work. So far I have a two line test. cy.visit('/') cy.contains('Welcome') I have set cypress.json baseurl to http://localhost:8080/index.html and if I have a single line test – just the visit then it works (and if I append /fred then it fails). But test fails on the contains. I can use F12 to inspect the page and I can find the “Welcome”. Even if I specify a cy.get(‘.pageheader-title’).contains(‘Welcome’) then similar result after 4 seconds timeout. So does mendix produce code compatible with cypress? I can’t think why it would not. Is there something I have to do special when using cypress with a mendix app?
2 answers

Hi John,

maybe the page hasn’t completely loaded when the second line is executed? Put a short sleep/wait in between the two lines and see if that works.


I found the problem.

I had set my baseurl value incorrectly. So all my own fault.