index.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 './commands'
  17. import './screenshot'
  18. // Alternatively you can use CommonJS syntax:
  19. // require('./commands')
  20. // Ignore 'ResizeObserver loop limit exceeded' exception
  21. // https://github.com/cypress-io/cypress/issues/8418
  22. const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/
  23. Cypress.on('uncaught:exception', (err) => {
  24. /* returning false here prevents Cypress from failing the test */
  25. if (resizeObserverLoopErrRe.test(err.message)) {
  26. return false
  27. }
  28. })
  29. declare global {
  30. // eslint-disable-next-line @typescript-eslint/no-namespace
  31. namespace Cypress {
  32. interface Chainable {
  33. getByTestid(selector: string, options?: Partial<Loggable & Timeoutable & Withinable & Shadow>): Chainable<JQuery<Element>>,
  34. login(username: string, password: string): Chainable<void>,
  35. collapseSidebar(isCollapsed: boolean, waitUntilSaving?: boolean): Chainable<void>,
  36. waitUntilSkeletonDisappear(): Chainable<void>,
  37. waitUntilSpinnerDisappear(): Chainable<void>,
  38. }
  39. }
  40. }