login.cy.ts 627 B

12345678910111213141516171819202122
  1. import {loginIntercept, loginSetup, menuIntercept} from './utils';
  2. describe('登录页面', function () {
  3. beforeEach(function () {
  4. loginIntercept();
  5. menuIntercept();
  6. loginSetup();
  7. });
  8. it('登录', function () {
  9. cy.getTestId('user_name').should('contain.text', '超级管理员');
  10. });
  11. it('退出', function () {
  12. cy.get('.ant-dropdown-trigger').trigger('mouseover');
  13. cy.get('.ant-dropdown').should('be.visible');
  14. cy.get('.ant-dropdown-menu').children().first().click();
  15. cy.get('.ant-modal-confirm-btns').children().last().click();
  16. cy.url().should('contain', '/login');
  17. });
  18. });