2
0
Files
bot/apps/viewer/playwright/tests/hugeBlock.spec.ts
Baptiste Arnaud d84f99074d feat(results): Brand new Results table
- Resizable columns
- Hide / Show columns
- Reorganize columns
- Expand result
2022-07-01 17:21:11 +02:00

29 lines
1.3 KiB
TypeScript

import test, { expect } from '@playwright/test'
import path from 'path'
import { importTypebotInDatabase } from '../services/database'
import { typebotViewer } from '../services/selectorUtils'
import cuid from 'cuid'
test('should work as expected', async ({ page }) => {
const typebotId = cuid()
await importTypebotInDatabase(
path.join(__dirname, '../fixtures/typebots/hugeGroup.json'),
{ id: typebotId, publicId: `${typebotId}-public` }
)
await page.goto(`/${typebotId}-public`)
await typebotViewer(page).locator('input').fill('Baptiste')
await typebotViewer(page).locator('input').press('Enter')
await typebotViewer(page).locator('input').fill('26')
await typebotViewer(page).locator('input').press('Enter')
await typebotViewer(page).locator('button >> text=Yes').click()
await page.goto(`http://localhost:3000/typebots/${typebotId}/results`)
await expect(page.locator('text="Baptiste"')).toBeVisible()
await expect(page.locator('text="26"')).toBeVisible()
await expect(page.locator('text="Yes"')).toBeVisible()
await page.hover('tbody > tr')
await page.click('button >> text="Open"')
await expect(page.locator('text="Baptiste" >> nth=1')).toBeVisible()
await expect(page.locator('text="26" >> nth=1')).toBeVisible()
await expect(page.locator('text="Yes" >> nth=1')).toBeVisible()
})