commands.d.ts 922 B

123456789101112131415161718192021222324252627282930313233
  1. /// <reference types="cypress" />
  2. declare namespace Cypress {
  3. interface Chainable<Subject = any> {
  4. /**
  5. * 自定义命令:登录并完成初始化进入主页
  6. *
  7. * 这个命令封装了完整的登录流程:
  8. * 1. 清除存储
  9. * 2. Mock 所有必要的 API(i18n、quota、patient types、body parts)
  10. * 3. 执行登录
  11. * 4. 等待初始化完成
  12. *
  13. * @param username - 用户名,默认 'admin'
  14. * @param password - 密码,默认 '123456'
  15. *
  16. * @example
  17. * cy.loginAndInitialize();
  18. * cy.loginAndInitialize('testuser', 'testpass');
  19. */
  20. loginAndInitialize(username?: string, password?: string): Chainable<Subject>;
  21. /**
  22. * 记录带时间戳的日志
  23. *
  24. * @param message - 日志消息
  25. * @param args - 额外参数
  26. */
  27. logWithDate(message: string, ...args: any[]): Chainable<Subject>;
  28. }
  29. }
  30. export {};