2
0

feat(dashboard): Add lead generation template

While creating the template I also made sure to fix and improve everything I stumble upon
This commit is contained in:
Baptiste Arnaud
2022-02-07 07:13:16 +01:00
parent 524ef0812c
commit 1f320c5d99
20 changed files with 397 additions and 46 deletions

View File

@ -0,0 +1,29 @@
import test, { expect } from '@playwright/test'
import path from 'path'
import { typebotViewer } from '../services/selectorUtils'
test.describe.parallel('Templates page', () => {
test('From scratch should create a blank typebot', async ({ page }) => {
await page.goto('/typebots/create')
await page.click('text=Start from scratch')
await expect(page).toHaveURL(new RegExp(`/edit`))
})
test('From file should import correctly', async ({ page }) => {
await page.goto('/typebots/create')
await page.click('[data-testid="more-button"]')
await page.setInputFiles(
'input[type="file"]',
path.join(__dirname, '../fixtures/typebots/singleChoiceTarget.json')
)
await expect(page).toHaveURL(new RegExp(`/edit`))
})
test('Templates should be previewable and usable', async ({ page }) => {
await page.goto('/typebots/create')
await page.click('[aria-label="Preview"] >> nth=0')
await expect(typebotViewer(page).locator('text=Hi!')).toBeVisible()
await page.click('text=Use this template')
await expect(page).toHaveURL(new RegExp(`/edit`))
})
})