我有以下代码,我想检查是否/account/logout
调用了服务,如何实现它?
it('should log out', () => {
// It will be good to check if application returned
// to login page and if /account/logout endpoint has been called.
cy.get('[alt="user_avatar"]')
.should('be.visible')
.click()
.get('[data-cy=cy-btn-signout]')
.click();
cy.wait(500)
cy.url().should('include', '/login');
cy.pause();
});
我想检查
/account/logout
服务是否被调用,如何执行?
假设其为邮寄电话:
cy.server();
cy.route('POST', '/account/logout').as('logout');
cy.wait('@logout');
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句