commands.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /// <reference types="cypress" />
  2. // ***********************************************
  3. // This example commands.ts shows you how to
  4. // create various custom commands and overwrite
  5. // existing commands.
  6. //
  7. // For more comprehensive examples of custom
  8. // commands please read more here:
  9. // https://on.cypress.io/custom-commands
  10. // ***********************************************
  11. //
  12. //
  13. // -- This is a parent command --
  14. // Cypress.Commands.add('login', (email, password) => { ... })
  15. //
  16. //
  17. // -- This is a child command --
  18. // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
  19. //
  20. //
  21. // -- This is a dual command --
  22. // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
  23. //
  24. //
  25. // -- This will overwrite an existing command --
  26. // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
  27. //
  28. // declare global {
  29. // namespace Cypress {
  30. // interface Chainable {
  31. // login(email: string, password: string): Chainable<void>
  32. // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
  33. // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
  34. // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
  35. // }
  36. // }
  37. // }
  38. export {}