commands.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // ***********************************************
  2. // This example namespace declaration will help
  3. // with Intellisense and code completion in your
  4. // IDE or Text Editor.
  5. // ***********************************************
  6. // declare namespace Cypress {
  7. // interface Chainable<Subject = any> {
  8. // customCommand(param: any): typeof customCommand;
  9. // }
  10. // }
  11. //
  12. // function customCommand(param: any): void {
  13. // console.warn(param);
  14. // }
  15. //
  16. // NOTE: You can use it like so:
  17. // Cypress.Commands.add('customCommand', customCommand);
  18. //
  19. // ***********************************************
  20. // This example commands.js shows you how to
  21. // create various custom commands and overwrite
  22. // existing commands.
  23. //
  24. // For more comprehensive examples of custom
  25. // commands please read more here:
  26. // https://on.cypress.io/custom-commands
  27. // ***********************************************
  28. //
  29. //
  30. // -- This is a parent command --
  31. // Cypress.Commands.add("login", (email, password) => { ... })
  32. //
  33. //
  34. // -- This is a child command --
  35. // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
  36. //
  37. //
  38. // -- This is a dual command --
  39. // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
  40. //
  41. //
  42. // -- This will overwrite an existing command --
  43. // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })