Bypass UI Login using Cypress

北城余情 提交于 2021-02-10 08:43:37

问题


I am having problem bypassing UI login. My web application doesn't use API to authenticate users. There are no endpoints like /login. index.php will just open the login page and submit the form to login.

The application authenticate the user by auth($_REQUEST['username'], $_REQUEST['password_tx']);

This is what cypress printed after UI login submit.

I have no idea how to move on from here.

    // This doesn't work. The application doesn't get the user details from the body. It is in the submitted form. 
    cy.request({
        method: 'POST',
        url: '/index.php?p=sys001',
        form: true, 
        body: {
            username: 'user',
            password_tx: 'pass'
        }
    })

来源:https://stackoverflow.com/questions/51878136/bypass-ui-login-using-cypress

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!