login with out the UI

0
Hi, I am trying to test an app with cypress and wondered if I could log in without the UI. The app has not been set up for rest. Just an ordinary app. Looking at local storage cookies, there is an XASESSIONID cookie. Currently I am trying     cy.request('POST', '/p/login', {       name: 'fred',       password: 'passwd',     }) I have set my login page to have a url of /login. And the name and password come from the system.user class which is inherited by the account class. And my person class is associated with account. But I think the code above assumes there is a login API waiting at /p/login which I guess there is not because it is a page. If I go via the UI in cypress, all works. So is what I am trying to do with cypress possible with a mendix app? I am not sure if fixtures are appropriate in this situation – basically setting the json I expect to get back and allow cypress to intercept the network return and replace it with my json. On other projects I have used cypress on, the login API has return user data and a token for subsequent API calls. So other than the XSESSIONID cookie, is Mendix returning anything? Sorry if this is a bit vague and disjointed, probably reflects my current confused thinking (!).
asked
1 answers
0

I’m not familiar with Cypress, but if it executes JavaScript, could you use the login function in the mx client library?

https://apidocs.rnd.mendix.com/9/client/mx.html#.login

 

answered