2022-01-28 09:42:31 +01:00
|
|
|
import test from '@playwright/test'
|
2022-10-06 08:33:46 +02:00
|
|
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
|
|
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
2022-06-11 07:27:38 +02:00
|
|
|
import { defaultGoogleAnalyticsOptions, IntegrationBlockType } from 'models'
|
2022-03-18 12:30:42 +01:00
|
|
|
import cuid from 'cuid'
|
2022-01-28 09:42:31 +01:00
|
|
|
|
2022-06-11 07:27:38 +02:00
|
|
|
test.describe('Google Analytics block', () => {
|
2022-01-28 09:42:31 +01:00
|
|
|
test('its configuration should work', async ({ page }) => {
|
2022-03-18 12:30:42 +01:00
|
|
|
const typebotId = cuid()
|
2022-01-28 09:42:31 +01:00
|
|
|
await createTypebots([
|
|
|
|
{
|
|
|
|
id: typebotId,
|
2022-06-11 07:27:38 +02:00
|
|
|
...parseDefaultGroupWithBlock({
|
|
|
|
type: IntegrationBlockType.GOOGLE_ANALYTICS,
|
2022-01-28 09:42:31 +01:00
|
|
|
options: defaultGoogleAnalyticsOptions,
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
])
|
|
|
|
|
|
|
|
await page.goto(`/typebots/${typebotId}/edit`)
|
|
|
|
await page.click('text=Configure...')
|
|
|
|
await page.fill('input[placeholder="G-123456..."]', 'G-VWX9WG1TNS')
|
|
|
|
await page.fill('input[placeholder="Example: Typebot"]', 'Typebot')
|
|
|
|
await page.fill(
|
|
|
|
'input[placeholder="Example: Submit email"]',
|
|
|
|
'Submit email'
|
|
|
|
)
|
|
|
|
await page.click('text=Advanced')
|
|
|
|
await page.fill('input[placeholder="Example: Campaign Z"]', 'Campaign Z')
|
|
|
|
await page.fill('input[placeholder="Example: 0"]', '0')
|
|
|
|
})
|
|
|
|
})
|