Cypress api mock

class CommonPage {
    mockApiResponse() {
        cy.server()
        const res = {
            code: "000000",
            message: 'success',
            data: [
                { accountid: 1, loginname: 'bestfei' },
                { reginsterTime: '2020-06-28' },
            ],
            success: true,
        }
        cy.route('http://www.best.fei/login', (Response = res))
        return this
    }
}

你可能感兴趣的:(Cypress api mock)