Skip to content

Commit

Permalink
ci: 💚 Improve linked typebot test robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Apr 4, 2022
1 parent 5903120 commit f6b5189
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions apps/builder/playwright/tests/logic/typebotLink.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@ test('should be configurable', async ({ page }) => {
const linkedTypebotId = cuid()
await importTypebotInDatabase(
path.join(__dirname, '../../fixtures/typebots/logic/linkTypebots/1.json'),
{ id: typebotId }
{ id: typebotId, name: 'My link typebot 1' }
)
await importTypebotInDatabase(
path.join(__dirname, '../../fixtures/typebots/logic/linkTypebots/2.json'),
{ id: linkedTypebotId }
{ id: linkedTypebotId, name: 'My link typebot 2' }
)

await page.goto(`/typebots/${typebotId}/edit`)
await page.click('text=Configure...')
await page.click('input[placeholder="Select a typebot"]')
await page.click('text=Another typebot')
await expect(page.locator('input[value="Another typebot"]')).toBeVisible()
await page.click('text=My link typebot 2')
await expect(page.locator('input[value="My link typebot 2"]')).toBeVisible()
await page.click('[aria-label="Navigate to typebot"]')
await expect(page).toHaveURL(
`/typebots/${linkedTypebotId}/edit?parentId=${typebotId}`
)
await page.click('[aria-label="Navigate back"]')
await expect(page).toHaveURL(`/typebots/${typebotId}/edit`)
await page.click('text=Jump in Another typebot')
await expect(page.locator('input[value="Another typebot"]')).toBeVisible()
await page.click('text=Jump in My link typebot 2')
await expect(page.locator('input[value="My link typebot 2"]')).toBeVisible()
await page.click('input[placeholder="Select a block"]')
await page.click('text=Block #2')

await page.click('text=Preview')
await expect(typebotViewer(page).locator('text=Second block')).toBeVisible()

await page.click('[aria-label="Close"]')
await page.click('text=Jump to Block #2 in Another typebot')
await page.click('text=Jump to Block #2 in My link typebot 2')
await page.click('input[value="Block #2"]', { clickCount: 3 })
await page.press('input[value="Block #2"]', 'Backspace')
await page.click('button >> text=Start')
Expand All @@ -47,10 +47,10 @@ test('should be configurable', async ({ page }) => {
await expect(typebotViewer(page).locator('text=Hello there!')).toBeVisible()

await page.click('[aria-label="Close"]')
await page.click('text=Jump to Start in Another typebot')
await page.click('input[value="Another typebot"]', { clickCount: 3 })
await page.press('input[value="Another typebot"]', 'Backspace')
await page.click('button >> text=My typebot')
await page.click('text=Jump to Start in My link typebot 2')
await page.click('input[value="My link typebot 2"]', { clickCount: 3 })
await page.press('input[value="My link typebot 2"]', 'Backspace')
await page.click('button >> text=My link typebot 1')
await page.click('input[placeholder="Select a block"]', {
clickCount: 3,
})
Expand Down

0 comments on commit f6b5189

Please sign in to comment.