build: upgrade packages
This commit is contained in:
@ -13,7 +13,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chakra-ui/css-reset": "2.0.3",
|
"@chakra-ui/css-reset": "2.0.3",
|
||||||
"@chakra-ui/react": "^2.2.6",
|
"@chakra-ui/react": "^2.2.8",
|
||||||
"@codemirror/lang-css": "^6.0.0",
|
"@codemirror/lang-css": "^6.0.0",
|
||||||
"@codemirror/lang-html": "^6.1.0",
|
"@codemirror/lang-html": "^6.1.0",
|
||||||
"@codemirror/lang-javascript": "^6.0.2",
|
"@codemirror/lang-javascript": "^6.0.2",
|
||||||
@ -27,19 +27,19 @@
|
|||||||
"@emotion/styled": "^11.10.0",
|
"@emotion/styled": "^11.10.0",
|
||||||
"@giphy/js-fetch-api": "4.4.0",
|
"@giphy/js-fetch-api": "4.4.0",
|
||||||
"@giphy/js-types": "^4.2.1",
|
"@giphy/js-types": "^4.2.1",
|
||||||
"@giphy/react-components": "6.0.0",
|
"@giphy/react-components": "6.1.1",
|
||||||
"@googleapis/drive": "^3.0.1",
|
"@googleapis/drive": "^3.0.1",
|
||||||
"@sentry/nextjs": "7.9.0",
|
"@sentry/nextjs": "7.11.1",
|
||||||
"@stripe/stripe-js": "1.35.0",
|
"@stripe/stripe-js": "1.35.0",
|
||||||
"@tanstack/react-table": "8.5.11",
|
"@tanstack/react-table": "8.5.11",
|
||||||
"@udecode/plate-basic-marks": "16.0.0",
|
"@udecode/plate-basic-marks": "16.3.0",
|
||||||
"@udecode/plate-common": "^7.0.2",
|
"@udecode/plate-common": "^7.0.2",
|
||||||
"@udecode/plate-core": "16.0.0",
|
"@udecode/plate-core": "16.3.0",
|
||||||
"@udecode/plate-link": "16.0.0",
|
"@udecode/plate-link": "16.3.0",
|
||||||
"@udecode/plate-serializer-html": "16.0.0",
|
"@udecode/plate-serializer-html": "16.3.0",
|
||||||
"@udecode/plate-ui-link": "16.0.0",
|
"@udecode/plate-ui-link": "16.3.0",
|
||||||
"@udecode/plate-ui-toolbar": "16.0.0",
|
"@udecode/plate-ui-toolbar": "16.3.0",
|
||||||
"aws-sdk": "2.1189.0",
|
"aws-sdk": "2.1199.0",
|
||||||
"bot-engine": "workspace:*",
|
"bot-engine": "workspace:*",
|
||||||
"browser-image-compression": "^2.0.0",
|
"browser-image-compression": "^2.0.0",
|
||||||
"canvas-confetti": "^1.5.1",
|
"canvas-confetti": "^1.5.1",
|
||||||
@ -49,8 +49,8 @@
|
|||||||
"dequal": "^2.0.3",
|
"dequal": "^2.0.3",
|
||||||
"emojilib": "3.0.7",
|
"emojilib": "3.0.7",
|
||||||
"focus-visible": "^5.2.0",
|
"focus-visible": "^5.2.0",
|
||||||
"framer-motion": "7.0.0",
|
"framer-motion": "7.2.0",
|
||||||
"google-auth-library": "^8.1.1",
|
"google-auth-library": "^8.3.0",
|
||||||
"google-spreadsheet": "^3.3.0",
|
"google-spreadsheet": "^3.3.0",
|
||||||
"got": "12.3.1",
|
"got": "12.3.1",
|
||||||
"htmlparser2": "^8.0.1",
|
"htmlparser2": "^8.0.1",
|
||||||
@ -61,9 +61,9 @@
|
|||||||
"micro": "9.4.1",
|
"micro": "9.4.1",
|
||||||
"micro-cors": "^0.1.1",
|
"micro-cors": "^0.1.1",
|
||||||
"minio": "7.0.30",
|
"minio": "7.0.30",
|
||||||
"next": "12.2.4",
|
"next": "12.2.5",
|
||||||
"next-auth": "4.10.3",
|
"next-auth": "4.10.3",
|
||||||
"nodemailer": "^6.7.7",
|
"nodemailer": "^6.7.8",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"papaparse": "^5.3.2",
|
"papaparse": "^5.3.2",
|
||||||
"prettier": "2.7.1",
|
"prettier": "2.7.1",
|
||||||
@ -75,7 +75,7 @@
|
|||||||
"slate-history": "^0.66.0",
|
"slate-history": "^0.66.0",
|
||||||
"slate-hyperscript": "^0.77.0",
|
"slate-hyperscript": "^0.77.0",
|
||||||
"slate-react": "0.82.0",
|
"slate-react": "0.82.0",
|
||||||
"stripe": "10.0.0",
|
"stripe": "10.3.0",
|
||||||
"styled-components": "^5.3.5",
|
"styled-components": "^5.3.5",
|
||||||
"svg-round-corners": "^0.3.0",
|
"svg-round-corners": "^0.3.0",
|
||||||
"swr": "^1.3.0",
|
"swr": "^1.3.0",
|
||||||
@ -85,13 +85,14 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "7.18.10",
|
"@babel/core": "7.18.10",
|
||||||
|
"@chakra-ui/styled-system": "^2.2.7",
|
||||||
"@playwright/test": "1.25.0",
|
"@playwright/test": "1.25.0",
|
||||||
"@types/canvas-confetti": "^1.4.3",
|
"@types/canvas-confetti": "^1.4.3",
|
||||||
"@types/google-spreadsheet": "^3.3.0",
|
"@types/google-spreadsheet": "^3.3.0",
|
||||||
"@types/jsonwebtoken": "8.5.8",
|
"@types/jsonwebtoken": "8.5.8",
|
||||||
"@types/micro-cors": "^0.1.2",
|
"@types/micro-cors": "^0.1.2",
|
||||||
"@types/minio": "^7.0.13",
|
"@types/minio": "^7.0.13",
|
||||||
"@types/node": "18.6.5",
|
"@types/node": "18.7.8",
|
||||||
"@types/nodemailer": "6.4.5",
|
"@types/nodemailer": "6.4.5",
|
||||||
"@types/nprogress": "^0.2.0",
|
"@types/nprogress": "^0.2.0",
|
||||||
"@types/papaparse": "5.3.3",
|
"@types/papaparse": "5.3.3",
|
||||||
@ -100,12 +101,12 @@
|
|||||||
"@types/react": "^18.0.17",
|
"@types/react": "^18.0.17",
|
||||||
"@types/react-table": "^7.7.12",
|
"@types/react-table": "^7.7.12",
|
||||||
"@types/tinycolor2": "^1.4.3",
|
"@types/tinycolor2": "^1.4.3",
|
||||||
"@typescript-eslint/eslint-plugin": "5.33.0",
|
"@typescript-eslint/eslint-plugin": "5.33.1",
|
||||||
"@typescript-eslint/parser": "5.33.0",
|
"@typescript-eslint/parser": "5.33.1",
|
||||||
"db": "workspace:*",
|
"db": "workspace:*",
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.1",
|
||||||
"eslint": "8.21.0",
|
"eslint": "8.22.0",
|
||||||
"eslint-config-next": "12.2.4",
|
"eslint-config-next": "12.2.5",
|
||||||
"eslint-plugin-react": "^7.30.1",
|
"eslint-plugin-react": "^7.30.1",
|
||||||
"models": "workspace:*",
|
"models": "workspace:*",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
|
@ -16,7 +16,8 @@ test.describe('Send email block', () => {
|
|||||||
!process.env.SMTP_PORT ||
|
!process.env.SMTP_PORT ||
|
||||||
!process.env.SMTP_SECURE ||
|
!process.env.SMTP_SECURE ||
|
||||||
!process.env.SMTP_HOST ||
|
!process.env.SMTP_HOST ||
|
||||||
!process.env.SMTP_PASSWORD
|
!process.env.SMTP_PASSWORD ||
|
||||||
|
!process.env.SMTP_FROM
|
||||||
)
|
)
|
||||||
throw new Error('SMTP_ env vars are missing')
|
throw new Error('SMTP_ env vars are missing')
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
@ -31,9 +32,7 @@ test.describe('Send email block', () => {
|
|||||||
|
|
||||||
await page.goto(`/typebots/${typebotId}/edit`)
|
await page.goto(`/typebots/${typebotId}/edit`)
|
||||||
await page.click('text=Configure...')
|
await page.click('text=Configure...')
|
||||||
await page.click(
|
await page.click(`text=${process.env.SMTP_FROM}`)
|
||||||
`text=${process.env.NEXT_PUBLIC_SMTP_FROM?.match(/\<(.*)\>/)?.pop()}`
|
|
||||||
)
|
|
||||||
await page.click('text=Connect new')
|
await page.click('text=Connect new')
|
||||||
const createButton = page.locator('button >> text=Create')
|
const createButton = page.locator('button >> text=Create')
|
||||||
await expect(createButton).toBeDisabled()
|
await expect(createButton).toBeDisabled()
|
||||||
|
@ -26,6 +26,9 @@ test.describe.parallel('Theme page', () => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
await page.goto(`/typebots/${typebotId}/theme`)
|
await page.goto(`/typebots/${typebotId}/theme`)
|
||||||
|
await expect(
|
||||||
|
typebotViewer(page).locator('button >> text="Go"')
|
||||||
|
).toBeVisible()
|
||||||
await page.click('button:has-text("General")')
|
await page.click('button:has-text("General")')
|
||||||
|
|
||||||
// Font
|
// Font
|
||||||
@ -60,6 +63,9 @@ test.describe.parallel('Theme page', () => {
|
|||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
await page.goto(`/typebots/${typebotId}/theme`)
|
await page.goto(`/typebots/${typebotId}/theme`)
|
||||||
|
await expect(
|
||||||
|
typebotViewer(page).locator('button >> text="Go"')
|
||||||
|
).toBeVisible()
|
||||||
await page.click('button:has-text("Chat")')
|
await page.click('button:has-text("Chat")')
|
||||||
|
|
||||||
// Host avatar
|
// Host avatar
|
||||||
@ -175,6 +181,9 @@ test.describe.parallel('Theme page', () => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
await page.goto(`/typebots/${typebotId}/theme`)
|
await page.goto(`/typebots/${typebotId}/theme`)
|
||||||
|
await expect(
|
||||||
|
typebotViewer(page).locator('button >> text="Go"')
|
||||||
|
).toBeVisible()
|
||||||
await page.click('button:has-text("Custom CSS")')
|
await page.click('button:has-text("Custom CSS")')
|
||||||
await page.fill(
|
await page.fill(
|
||||||
'div[role="textbox"]',
|
'div[role="textbox"]',
|
||||||
|
@ -8,30 +8,30 @@
|
|||||||
"analyze": "cross-env ANALYZE=true next build"
|
"analyze": "cross-env ANALYZE=true next build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chakra-ui/icon": "^3.0.6",
|
"@chakra-ui/icon": "^3.0.8",
|
||||||
"@chakra-ui/react": "2.2.6",
|
"@chakra-ui/react": "2.2.8",
|
||||||
"@emotion/react": "11.10.0",
|
"@emotion/react": "11.10.0",
|
||||||
"@emotion/styled": "11.10.0",
|
"@emotion/styled": "11.10.0",
|
||||||
"aos": "^2.3.4",
|
"aos": "^2.3.4",
|
||||||
"bot-engine": "*",
|
"bot-engine": "*",
|
||||||
"focus-visible": "^5.2.0",
|
"focus-visible": "^5.2.0",
|
||||||
"framer-motion": "7.0.0",
|
"framer-motion": "7.2.0",
|
||||||
"models": "*",
|
"models": "*",
|
||||||
"next": "12.2.4",
|
"next": "12.2.5",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-dom": "18.2.0",
|
"react-dom": "18.2.0",
|
||||||
"utils": "*"
|
"utils": "*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "7.18.10",
|
"@babel/core": "7.18.10",
|
||||||
"@chakra-ui/styled-system": "^2.2.5",
|
"@chakra-ui/styled-system": "^2.2.7",
|
||||||
"@next/bundle-analyzer": "12.2.4",
|
"@next/bundle-analyzer": "12.2.5",
|
||||||
"@types/aos": "^3.0.4",
|
"@types/aos": "^3.0.4",
|
||||||
"@types/node": "18.6.5",
|
"@types/node": "18.7.8",
|
||||||
"@types/react": "^18.0.17",
|
"@types/react": "^18.0.17",
|
||||||
"autoprefixer": "10.4.8",
|
"autoprefixer": "10.4.8",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "8.21.0",
|
"eslint": "8.22.0",
|
||||||
"postcss": "8.4.16",
|
"postcss": "8.4.16",
|
||||||
"prettier": "2.7.1",
|
"prettier": "2.7.1",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.7.4"
|
||||||
|
@ -12,38 +12,39 @@
|
|||||||
"test:open": "PWDEBUG=1 pnpm playwright test"
|
"test:open": "PWDEBUG=1 pnpm playwright test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sentry/nextjs": "7.9.0",
|
"@sentry/nextjs": "7.11.1",
|
||||||
"aws-sdk": "2.1190.0",
|
"aws-sdk": "2.1199.0",
|
||||||
"bot-engine": "*",
|
"bot-engine": "*",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"cuid": "^2.1.8",
|
"cuid": "^2.1.8",
|
||||||
"db": "workspace:*",
|
"db": "workspace:*",
|
||||||
"google-spreadsheet": "^3.3.0",
|
"google-spreadsheet": "^3.3.0",
|
||||||
"got": "12.3.1",
|
"got": "12.3.1",
|
||||||
"next": "12.2.4",
|
"next": "12.2.5",
|
||||||
"nodemailer": "^6.7.7",
|
"nodemailer": "^6.7.8",
|
||||||
"qs": "^6.11.0",
|
"qs": "^6.11.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"sanitize-html": "^2.7.1",
|
"sanitize-html": "^2.7.1",
|
||||||
"stripe": "10.0.0"
|
"stripe": "10.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/papaparse": "5.3.3",
|
"@babel/preset-env": "^7.18.10",
|
||||||
"@playwright/test": "1.25.0",
|
"@playwright/test": "1.25.0",
|
||||||
"eslint-plugin-react": "^7.30.1",
|
|
||||||
"@types/cors": "^2.8.12",
|
"@types/cors": "^2.8.12",
|
||||||
"@types/google-spreadsheet": "^3.3.0",
|
"@types/google-spreadsheet": "^3.3.0",
|
||||||
"@types/node": "18.6.5",
|
"@types/node": "18.7.8",
|
||||||
"@types/nodemailer": "6.4.5",
|
"@types/nodemailer": "6.4.5",
|
||||||
|
"@types/papaparse": "5.3.3",
|
||||||
"@types/qs": "^6.9.7",
|
"@types/qs": "^6.9.7",
|
||||||
"@types/react": "^18.0.17",
|
"@types/react": "^18.0.17",
|
||||||
"@types/sanitize-html": "2.6.2",
|
"@types/sanitize-html": "2.6.2",
|
||||||
"@typescript-eslint/eslint-plugin": "5.33.0",
|
"@typescript-eslint/eslint-plugin": "5.33.0",
|
||||||
"@typescript-eslint/parser": "5.33.0",
|
"@typescript-eslint/parser": "5.33.1",
|
||||||
"eslint": "8.21.0",
|
"eslint": "8.22.0",
|
||||||
"eslint-config-next": "12.2.4",
|
"eslint-config-next": "12.2.5",
|
||||||
"google-auth-library": "^8.1.1",
|
"eslint-plugin-react": "^7.30.1",
|
||||||
|
"google-auth-library": "^8.3.0",
|
||||||
"models": "workspace:*",
|
"models": "workspace:*",
|
||||||
"next-transpile-modules": "^9.0.0",
|
"next-transpile-modules": "^9.0.0",
|
||||||
"papaparse": "^5.3.2",
|
"papaparse": "^5.3.2",
|
||||||
|
@ -2,7 +2,9 @@ import { devices, PlaywrightTestConfig } from '@playwright/test'
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
require('dotenv').config({ path: path.join(__dirname, '.env.local') })
|
require('dotenv').config({
|
||||||
|
path: path.join(__dirname, 'playwright/.env'),
|
||||||
|
})
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
globalSetup: require.resolve(path.join(__dirname, 'playwright/global-setup')),
|
globalSetup: require.resolve(path.join(__dirname, 'playwright/global-setup')),
|
||||||
@ -11,14 +13,13 @@ const config: PlaywrightTestConfig = {
|
|||||||
expect: {
|
expect: {
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
},
|
},
|
||||||
retries: process.env.NO_RETRIES ? 0 : 2,
|
retries: process.env.NO_RETRIES ? 0 : 1,
|
||||||
workers: process.env.CI ? 1 : 3,
|
workers: process.env.CI ? 1 : 3,
|
||||||
reporter: 'html',
|
reporter: 'html',
|
||||||
maxFailures: process.env.CI ? 10 : undefined,
|
maxFailures: process.env.CI ? 10 : undefined,
|
||||||
use: {
|
use: {
|
||||||
actionTimeout: 0,
|
actionTimeout: 0,
|
||||||
baseURL: process.env.NEXT_PUBLIC_VIEWER_URL,
|
baseURL: process.env.VIEWER_URL,
|
||||||
storageState: path.join(__dirname, 'playwright/proUser.json'),
|
|
||||||
trace: 'on-first-retry',
|
trace: 'on-first-retry',
|
||||||
video: 'retain-on-failure',
|
video: 'retain-on-failure',
|
||||||
locale: 'en-US',
|
locale: 'en-US',
|
||||||
|
4
apps/viewer/playwright/.env.example
Normal file
4
apps/viewer/playwright/.env.example
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
VIEWER_URL=http://localhost:3001
|
||||||
|
BUILDER_URL=http://localhost:3000
|
||||||
|
DATABASE_URL=postgresql://postgres:typebot@localhost:5432/typebot
|
||||||
|
ENCRYPTION_SECRET=SgVkYp2s5v8y/B?E(H+MbQeThWmZq4t6 #256-bits secret (can be generated here: https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx)
|
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"cookies": [],
|
|
||||||
"origins": [
|
|
||||||
{
|
|
||||||
"origin": "http://localhost:3000",
|
|
||||||
"localStorage": [
|
|
||||||
{
|
|
||||||
"name": "authenticatedUser",
|
|
||||||
"value": "{\"id\":\"proUser\",\"name\":\"Pro user\",\"email\":\"pro-user@email.com\",\"emailVerified\":null,\"image\":\"https://avatars.githubusercontent.com/u/16015833?v=4\",\"plan\":\"PRO\",\"stripeId\":null}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "typebot-20-modal",
|
|
||||||
"value": "hide"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
12
apps/viewer/playwright/services/browser.ts
Normal file
12
apps/viewer/playwright/services/browser.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Page } from '@playwright/test'
|
||||||
|
|
||||||
|
export const mockSessionApiCalls = (page: Page) =>
|
||||||
|
page.route(`${process.env.BUILDER_URL}/api/auth/session`, (route) => {
|
||||||
|
if (route.request().method() === 'GET') {
|
||||||
|
return route.fulfill({
|
||||||
|
status: 200,
|
||||||
|
body: '{"user":{"id":"proUser","name":"Pro user","email":"pro-user@email.com","emailVerified":null,"image":"https://avatars.githubusercontent.com/u/16015833?v=4","stripeId":null,"graphNavigation": "TRACKPAD"}}',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return route.continue()
|
||||||
|
})
|
@ -6,6 +6,9 @@ import { typebotViewer } from '../services/selectorUtils'
|
|||||||
import { importTypebotInDatabase } from '../services/database'
|
import { importTypebotInDatabase } from '../services/database'
|
||||||
import { readFileSync } from 'fs'
|
import { readFileSync } from 'fs'
|
||||||
import { isDefined } from 'utils'
|
import { isDefined } from 'utils'
|
||||||
|
import { mockSessionApiCalls } from 'playwright/services/browser'
|
||||||
|
|
||||||
|
test.beforeEach(({ page }) => mockSessionApiCalls(page))
|
||||||
|
|
||||||
test('should work as expected', async ({ page, browser }) => {
|
test('should work as expected', async ({ page, browser }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = cuid()
|
||||||
@ -26,7 +29,7 @@ test('should work as expected', async ({ page, browser }) => {
|
|||||||
await expect(
|
await expect(
|
||||||
typebotViewer(page).locator(`text="3 files uploaded"`)
|
typebotViewer(page).locator(`text="3 files uploaded"`)
|
||||||
).toBeVisible()
|
).toBeVisible()
|
||||||
await page.goto(`http://localhost:3000/typebots/${typebotId}/results`)
|
await page.goto(`${process.env.BUILDER_URL}/typebots/${typebotId}/results`)
|
||||||
await expect(page.locator('text="api.json"')).toHaveAttribute(
|
await expect(page.locator('text="api.json"')).toHaveAttribute(
|
||||||
'href',
|
'href',
|
||||||
/.+\/api\.json/
|
/.+\/api\.json/
|
||||||
|
@ -3,6 +3,9 @@ import path from 'path'
|
|||||||
import { importTypebotInDatabase } from '../services/database'
|
import { importTypebotInDatabase } from '../services/database'
|
||||||
import { typebotViewer } from '../services/selectorUtils'
|
import { typebotViewer } from '../services/selectorUtils'
|
||||||
import cuid from 'cuid'
|
import cuid from 'cuid'
|
||||||
|
import { mockSessionApiCalls } from 'playwright/services/browser'
|
||||||
|
|
||||||
|
test.beforeEach(({ page }) => mockSessionApiCalls(page))
|
||||||
|
|
||||||
test('should work as expected', async ({ page }) => {
|
test('should work as expected', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = cuid()
|
||||||
@ -16,7 +19,7 @@ test('should work as expected', async ({ page }) => {
|
|||||||
await typebotViewer(page).locator('input').fill('26')
|
await typebotViewer(page).locator('input').fill('26')
|
||||||
await typebotViewer(page).locator('input').press('Enter')
|
await typebotViewer(page).locator('input').press('Enter')
|
||||||
await typebotViewer(page).locator('button >> text=Yes').click()
|
await typebotViewer(page).locator('button >> text=Yes').click()
|
||||||
await page.goto(`http://localhost:3000/typebots/${typebotId}/results`)
|
await page.goto(`${process.env.BUILDER_URL}/typebots/${typebotId}/results`)
|
||||||
await expect(page.locator('text="Baptiste"')).toBeVisible()
|
await expect(page.locator('text="Baptiste"')).toBeVisible()
|
||||||
await expect(page.locator('text="26"')).toBeVisible()
|
await expect(page.locator('text="26"')).toBeVisible()
|
||||||
await expect(page.locator('text="Yes"')).toBeVisible()
|
await expect(page.locator('text="Yes"')).toBeVisible()
|
||||||
|
@ -11,6 +11,9 @@ import {
|
|||||||
} from 'models'
|
} from 'models'
|
||||||
import { typebotViewer } from '../services/selectorUtils'
|
import { typebotViewer } from '../services/selectorUtils'
|
||||||
import cuid from 'cuid'
|
import cuid from 'cuid'
|
||||||
|
import { mockSessionApiCalls } from 'playwright/services/browser'
|
||||||
|
|
||||||
|
test.beforeEach(({ page }) => mockSessionApiCalls(page))
|
||||||
|
|
||||||
test('Should correctly parse metadata', async ({ page }) => {
|
test('Should correctly parse metadata', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = cuid()
|
||||||
|
@ -3,6 +3,9 @@ import { importTypebotInDatabase } from '../services/database'
|
|||||||
import cuid from 'cuid'
|
import cuid from 'cuid'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { typebotViewer } from '../services/selectorUtils'
|
import { typebotViewer } from '../services/selectorUtils'
|
||||||
|
import { mockSessionApiCalls } from 'playwright/services/browser'
|
||||||
|
|
||||||
|
test.beforeEach(({ page }) => mockSessionApiCalls(page))
|
||||||
|
|
||||||
test('should correctly be injected', async ({ page }) => {
|
test('should correctly be injected', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = cuid()
|
||||||
|
@ -7,17 +7,20 @@ import cuid from 'cuid'
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { typebotViewer } from '../services/selectorUtils'
|
import { typebotViewer } from '../services/selectorUtils'
|
||||||
import { SmtpCredentialsData } from 'models'
|
import { SmtpCredentialsData } from 'models'
|
||||||
|
import { mockSessionApiCalls } from 'playwright/services/browser'
|
||||||
|
|
||||||
|
test.beforeEach(({ page }) => mockSessionApiCalls(page))
|
||||||
|
|
||||||
const mockSmtpCredentials: SmtpCredentialsData = {
|
const mockSmtpCredentials: SmtpCredentialsData = {
|
||||||
from: {
|
from: {
|
||||||
email: 'tobin.tillman65@ethereal.email',
|
email: 'kimberly.boyer36@ethereal.email',
|
||||||
name: 'John Smith',
|
name: 'Kimberly Boyer',
|
||||||
},
|
},
|
||||||
host: 'smtp.ethereal.email',
|
host: 'smtp.ethereal.email',
|
||||||
port: 587,
|
port: 587,
|
||||||
isTlsEnabled: false,
|
isTlsEnabled: true,
|
||||||
username: 'tobin.tillman65@ethereal.email',
|
username: 'kimberly.boyer36@ethereal.email',
|
||||||
password: 'Ty9BcwCBrK6w8AG2hx',
|
password: '4jvjGUgxYKRjbk15tW',
|
||||||
}
|
}
|
||||||
|
|
||||||
test('should send an email', async ({ page }) => {
|
test('should send an email', async ({ page }) => {
|
||||||
@ -36,13 +39,13 @@ test('should send an email', async ({ page }) => {
|
|||||||
const { previewUrl } = await response.json()
|
const { previewUrl } = await response.json()
|
||||||
await page.goto(previewUrl)
|
await page.goto(previewUrl)
|
||||||
await expect(page.locator('text="Hey!"')).toBeVisible()
|
await expect(page.locator('text="Hey!"')).toBeVisible()
|
||||||
await expect(page.locator('text="John Smith"')).toBeVisible()
|
await expect(page.locator('text="Kimberly Boyer"')).toBeVisible()
|
||||||
await expect(page.locator('text="<test1@gmail.com>" >> nth=0')).toBeVisible()
|
await expect(page.locator('text="<test1@gmail.com>" >> nth=0')).toBeVisible()
|
||||||
await expect(page.locator('text="<test2@gmail.com>" >> nth=0')).toBeVisible()
|
await expect(page.locator('text="<test2@gmail.com>" >> nth=0')).toBeVisible()
|
||||||
await expect(
|
await expect(
|
||||||
page.locator('text="<baptiste.arnaud95@gmail.com>" >> nth=0')
|
page.locator('text="<baptiste.arnaud95@gmail.com>" >> nth=0')
|
||||||
).toBeVisible()
|
).toBeVisible()
|
||||||
await page.goto(`http://localhost:3000/typebots/${typebotId}/results`)
|
await page.goto(`${process.env.BUILDER_URL}/typebots/${typebotId}/results`)
|
||||||
await page.click('text="See logs"')
|
await page.click('text="See logs"')
|
||||||
await expect(page.locator('text="Email successfully sent"')).toBeVisible()
|
await expect(page.locator('text="Email successfully sent"')).toBeVisible()
|
||||||
})
|
})
|
||||||
|
@ -10,6 +10,9 @@ import {
|
|||||||
defaultTextInputOptions,
|
defaultTextInputOptions,
|
||||||
InputBlockType,
|
InputBlockType,
|
||||||
} from 'models'
|
} from 'models'
|
||||||
|
import { mockSessionApiCalls } from 'playwright/services/browser'
|
||||||
|
|
||||||
|
test.beforeEach(({ page }) => mockSessionApiCalls(page))
|
||||||
|
|
||||||
test('Result should be in storage by default', async ({ page }) => {
|
test('Result should be in storage by default', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = cuid()
|
||||||
|
@ -2,6 +2,9 @@ import test, { expect } from '@playwright/test'
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { importTypebotInDatabase } from '../services/database'
|
import { importTypebotInDatabase } from '../services/database'
|
||||||
import { typebotViewer } from '../services/selectorUtils'
|
import { typebotViewer } from '../services/selectorUtils'
|
||||||
|
import { mockSessionApiCalls } from 'playwright/services/browser'
|
||||||
|
|
||||||
|
test.beforeEach(({ page }) => mockSessionApiCalls(page))
|
||||||
|
|
||||||
test('should work as expected', async ({ page }) => {
|
test('should work as expected', async ({ page }) => {
|
||||||
const typebotId = 'cl0ibhi7s0018n21aarlmg0cm'
|
const typebotId = 'cl0ibhi7s0018n21aarlmg0cm'
|
||||||
@ -24,6 +27,6 @@ test('should work as expected', async ({ page }) => {
|
|||||||
resp.status() === 200 &&
|
resp.status() === 200 &&
|
||||||
resp.request().method() === 'PUT'
|
resp.request().method() === 'PUT'
|
||||||
)
|
)
|
||||||
await page.goto(`http://localhost:3000/typebots/${typebotId}/results`)
|
await page.goto(`${process.env.BUILDER_URL}/typebots/${typebotId}/results`)
|
||||||
await expect(page.locator('text=Hello there!')).toBeVisible()
|
await expect(page.locator('text=Hello there!')).toBeVisible()
|
||||||
})
|
})
|
||||||
|
@ -4,6 +4,9 @@ import cuid from 'cuid'
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { typebotViewer } from '../services/selectorUtils'
|
import { typebotViewer } from '../services/selectorUtils'
|
||||||
import { HttpMethod } from 'models'
|
import { HttpMethod } from 'models'
|
||||||
|
import { mockSessionApiCalls } from 'playwright/services/browser'
|
||||||
|
|
||||||
|
test.beforeEach(({ page }) => mockSessionApiCalls(page))
|
||||||
|
|
||||||
test('should execute webhooks properly', async ({ page }) => {
|
test('should execute webhooks properly', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = cuid()
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"qs": "^6.11.0",
|
"qs": "^6.11.0",
|
||||||
"react-frame-component": "5.2.3",
|
"react-frame-component": "5.2.3",
|
||||||
"react-phone-number-input": "3.2.6",
|
"react-phone-number-input": "3.2.8",
|
||||||
"react-scroll": "^1.8.7",
|
"react-scroll": "^1.8.7",
|
||||||
"react-transition-group": "4.4.5",
|
"react-transition-group": "4.4.5",
|
||||||
"resize-observer": "^1.0.4"
|
"resize-observer": "^1.0.4"
|
||||||
@ -27,11 +27,11 @@
|
|||||||
"@types/react-scroll": "^1.8.4",
|
"@types/react-scroll": "^1.8.4",
|
||||||
"@types/react-transition-group": "^4.4.5",
|
"@types/react-transition-group": "^4.4.5",
|
||||||
"@typescript-eslint/eslint-plugin": "5.33.0",
|
"@typescript-eslint/eslint-plugin": "5.33.0",
|
||||||
"@typescript-eslint/parser": "5.33.0",
|
"@typescript-eslint/parser": "5.33.1",
|
||||||
"autoprefixer": "10.4.8",
|
"autoprefixer": "10.4.8",
|
||||||
"db": "workspace:*",
|
"db": "workspace:*",
|
||||||
"eslint": "8.21.0",
|
"eslint": "8.22.0",
|
||||||
"eslint-config-next": "12.2.4",
|
"eslint-config-next": "12.2.5",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"eslint-plugin-react": "7.30.1",
|
"eslint-plugin-react": "7.30.1",
|
||||||
@ -40,7 +40,7 @@
|
|||||||
"prettier": "2.7.1",
|
"prettier": "2.7.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"rollup": "2.77.2",
|
"rollup": "2.78.1",
|
||||||
"rollup-plugin-dts": "^4.2.2",
|
"rollup-plugin-dts": "^4.2.2",
|
||||||
"rollup-plugin-peer-deps-external": "^2.2.4",
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
||||||
"rollup-plugin-postcss": "^4.0.2",
|
"rollup-plugin-postcss": "^4.0.2",
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
"main": "./index.ts",
|
"main": "./index.ts",
|
||||||
"types": "./index.ts",
|
"types": "./index.ts",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prisma": "4.1.1",
|
"prisma": "4.2.1",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
"dotenv-cli": "6.0.0"
|
"dotenv-cli": "6.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "4.1.1"
|
"@prisma/client": "4.2.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dx": "dotenv -e ../../apps/builder/.env.local prisma db push && pnpm generate:schema && pnpm start:sutdio ",
|
"dx": "dotenv -e ../../apps/builder/.env.local prisma db push && pnpm generate:schema && pnpm start:sutdio ",
|
||||||
|
@ -11,14 +11,14 @@
|
|||||||
"@rollup/plugin-commonjs": "22.0.2",
|
"@rollup/plugin-commonjs": "22.0.2",
|
||||||
"@rollup/plugin-node-resolve": "^13.3.0",
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
||||||
"@rollup/plugin-typescript": "8.3.4",
|
"@rollup/plugin-typescript": "8.3.4",
|
||||||
"rollup": "2.77.2",
|
"rollup": "2.78.1",
|
||||||
"rollup-plugin-dts": "^4.2.2",
|
"rollup-plugin-dts": "^4.2.2",
|
||||||
"rollup-plugin-peer-deps-external": "^2.2.4",
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
||||||
"next": "12.2.4",
|
"next": "12.2.5",
|
||||||
"db": "workspace:*"
|
"db": "workspace:*"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"zod": "^3.17.10"
|
"zod": "^3.18.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"next": "^12.0.0",
|
"next": "^12.0.0",
|
||||||
|
@ -11,19 +11,19 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-typescript": "8.3.4",
|
"@rollup/plugin-typescript": "8.3.4",
|
||||||
"@types/jest": "^28.1.6",
|
"@types/jest": "^28.1.7",
|
||||||
"@typescript-eslint/eslint-plugin": "5.32.0",
|
"@typescript-eslint/eslint-plugin": "5.32.0",
|
||||||
"@typescript-eslint/parser": "5.32.0",
|
"@typescript-eslint/parser": "5.33.1",
|
||||||
"eslint": "8.21.0",
|
"eslint": "8.22.0",
|
||||||
"eslint-plugin-functional": "^4.2.2",
|
"eslint-plugin-functional": "^4.2.2",
|
||||||
"eslint-plugin-jest": "26.7.0",
|
"eslint-plugin-jest": "26.8.5",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"jest": "^28.1.3",
|
"jest": "^28.1.3",
|
||||||
"prettier": "2.7.1",
|
"prettier": "2.7.1",
|
||||||
"rollup": "2.77.2",
|
"rollup": "2.78.1",
|
||||||
"rollup-plugin-styles": "^4.0.0",
|
"rollup-plugin-styles": "^4.0.0",
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"ts-jest": "^28.0.7",
|
"ts-jest": "^28.0.8",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.0",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.7.4"
|
||||||
},
|
},
|
||||||
|
@ -10,14 +10,14 @@
|
|||||||
"@rollup/plugin-commonjs": "22.0.2",
|
"@rollup/plugin-commonjs": "22.0.2",
|
||||||
"@rollup/plugin-node-resolve": "^13.3.0",
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
||||||
"@rollup/plugin-typescript": "8.3.4",
|
"@rollup/plugin-typescript": "8.3.4",
|
||||||
"rollup": "2.77.2",
|
"rollup": "2.78.1",
|
||||||
"rollup-plugin-dts": "^4.2.2",
|
"rollup-plugin-dts": "^4.2.2",
|
||||||
"rollup-plugin-peer-deps-external": "^2.2.4",
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.0",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
"aws-sdk": "2.1190.0",
|
"aws-sdk": "2.1199.0",
|
||||||
"models": "workspace:*",
|
"models": "workspace:*",
|
||||||
"next": "12.2.4"
|
"next": "12.2.5"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"aws-sdk": "^2.1152.0",
|
"aws-sdk": "^2.1152.0",
|
||||||
|
3181
pnpm-lock.yaml
generated
3181
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user