index.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // ***********************************************************
  2. // This example support/index.js is processed and
  3. // loaded automatically before your test files.
  4. //
  5. // This is a great place to put global configuration and
  6. // behavior that modifies Cypress.
  7. //
  8. // You can change the location of this file or turn off
  9. // automatically serving support files with the
  10. // 'supportFile' configuration option.
  11. //
  12. // You can read more here:
  13. // https://on.cypress.io/configuration
  14. // ***********************************************************
  15. // Import commands.js using ES2015 syntax:
  16. import './assertions'
  17. import './commands'
  18. import './screenshot'
  19. // Alternatively you can use CommonJS syntax:
  20. // require('./commands')
  21. // Ignore 'ResizeObserver loop limit exceeded' exception
  22. // https://github.com/cypress-io/cypress/issues/8418
  23. const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/
  24. Cypress.on('uncaught:exception', (err) => {
  25. /* returning false here prevents Cypress from failing the test */
  26. if (resizeObserverLoopErrRe.test(err.message)) {
  27. return false
  28. }
  29. })
  30. declare global {
  31. // eslint-disable-next-line @typescript-eslint/no-namespace
  32. namespace Cypress {
  33. interface Chainable {
  34. getByTestid(selector: string, options?: Partial<Loggable & Timeoutable & Withinable & Shadow>): Chainable<JQuery<Element>>,
  35. login(username: string, password: string): Chainable<void>,
  36. collapseSidebar(isCollapsed: boolean, waitUntilSaving?: boolean): Chainable<void>,
  37. waitUntilSkeletonDisappear(): Chainable<void>,
  38. waitUntilSpinnerDisappear(): Chainable<void>,
  39. appendTextToEditorUntilContains(inputText: string): Chainable<void>
  40. }
  41. }
  42. }