2
0

perf(e2e): ️ Migrate to Playwright

This commit is contained in:
Baptiste Arnaud
2022-01-28 09:42:31 +01:00
parent c5aaa323d1
commit 73f277fce7
145 changed files with 3104 additions and 2346 deletions

View File

@ -0,0 +1,44 @@
import test, { expect } from '@playwright/test'
import path from 'path'
import { typebotViewer } from '../../services/selectorUtils'
import { importTypebotInDatabase } from '../../services/database'
const typebotId = 'set-variable-step'
test.describe('Set variable step', () => {
test('its configuration should work', async ({ page, context }) => {
await importTypebotInDatabase(
path.join(__dirname, '../../fixtures/typebots/logic/setVariable.json'),
{
id: typebotId,
}
)
await page.goto(`/typebots/${typebotId}/edit`)
await page.click('text=Type a number...')
await page.fill('input[placeholder="Select a variable"]', 'Num')
await page.click('text=Create "Num"')
await page.click('text=Click to edit... >> nth = 0')
await page.fill('input[placeholder="Select a variable"]', 'Total')
await page.click('text=Create "Total"')
await page.fill('textarea', '1000 * {{Num}}')
await page.click('text=Click to edit...')
await page.fill('input[placeholder="Select a variable"]', 'Custom var')
await page.click('text=Create "Custom var"')
await page.fill('textarea', 'Custom value')
await page.click('text=Preview')
await typebotViewer(page)
.locator('input[placeholder="Type a number..."]')
.fill('365')
await typebotViewer(page).locator('text=Send').click()
await expect(
typebotViewer(page).locator('text=Total: 365000')
).toBeVisible()
await expect(
typebotViewer(page).locator('text=Custom var: Custom value')
).toBeVisible()
})
})