2021-11-29 15:19:07 +01:00
|
|
|
/* eslint-disable @typescript-eslint/no-namespace */
|
|
|
|
// ***********************************************************
|
|
|
|
// This example support/index.js is processed and
|
|
|
|
// loaded automatically before your test files.
|
|
|
|
//
|
|
|
|
// This is a great place to put global configuration and
|
|
|
|
// behavior that modifies Cypress.
|
|
|
|
//
|
|
|
|
// You can change the location of this file or turn off
|
|
|
|
// automatically serving support files with the
|
|
|
|
// 'supportFile' configuration option.
|
|
|
|
//
|
|
|
|
// You can read more here:
|
|
|
|
// https://on.cypress.io/configuration
|
|
|
|
// ***********************************************************
|
2021-12-06 15:48:50 +01:00
|
|
|
/// <reference types="cypress" />
|
2021-11-29 15:19:07 +01:00
|
|
|
|
|
|
|
declare global {
|
|
|
|
namespace Cypress {
|
|
|
|
interface Chainable {
|
2021-12-06 15:48:50 +01:00
|
|
|
signOut(): Chainable<any>
|
|
|
|
signIn(email: string): Chainable<any>
|
2022-01-12 09:57:00 +01:00
|
|
|
loadTypebotFixtureInDatabase(path: string): Chainable<any>
|
2021-12-06 15:48:50 +01:00
|
|
|
mouseMoveBy(
|
|
|
|
x: number,
|
|
|
|
y: number,
|
|
|
|
options?: { delay: number }
|
|
|
|
): Chainable<
|
|
|
|
[
|
|
|
|
Element,
|
|
|
|
{
|
|
|
|
initialRect: ClientRect
|
|
|
|
finalRect: ClientRect
|
|
|
|
delta: { x: number; y: number }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
>
|
2021-11-29 15:19:07 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-12-06 15:48:50 +01:00
|
|
|
|
2022-01-08 08:38:39 +01:00
|
|
|
Cypress.on('uncaught:exception', (err) => {
|
|
|
|
if (err.message.includes('ResizeObserver loop limit exceeded')) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2022-01-14 07:49:24 +01:00
|
|
|
export const getIframeBody = () => {
|
|
|
|
return cy
|
|
|
|
.get('#typebot-iframe')
|
|
|
|
.its('0.contentDocument.body')
|
|
|
|
.should('not.be.empty')
|
|
|
|
.then(cy.wrap)
|
|
|
|
}
|
|
|
|
|
2021-12-06 15:48:50 +01:00
|
|
|
// Import commands.js using ES2015 syntax:
|
|
|
|
import '@testing-library/cypress/add-commands'
|
2021-12-28 11:13:09 +01:00
|
|
|
import 'cypress-file-upload'
|
2021-11-29 15:19:07 +01:00
|
|
|
import './commands'
|
|
|
|
|
|
|
|
// Alternatively you can use CommonJS syntax:
|
|
|
|
// require('./commands')
|