login.cy.ts 804 B

12345678910111213141516171819202122232425262728
  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. it.only('菜单', function() {
  19. cy.getTestId('menu').children().should('have.length', 4);
  20. cy.getTestId('menu').children().first().should('include.text', '首页');
  21. });
  22. });