enso/app/ide-desktop/client/tests/createNewProject.spec.ts
Adam Obuchowicz 86c59469d0
Increase timeout and vite version (#11492)
1. The electron test hit timeouts from time to time, probably because of slow response from the engine: increased timeout.
2. Unify vite version across packages.
2024-11-08 08:43:02 +00:00

33 lines
1.5 KiB
TypeScript

/** @file A test for basic flow of the application: open project and see if nodes appear. */
import { expect } from '@playwright/test'
import { electronTest, loginAsTestUser } from './electronTest'
electronTest('Create new project', async page => {
await loginAsTestUser(page)
await expect(page.getByRole('button', { name: 'New Project', exact: true })).toBeVisible()
await page.getByRole('button', { name: 'New Project', exact: true }).click()
await expect(page.locator('.GraphNode')).toHaveCount(1, { timeout: 60000 })
// We see the node type and visualization, so the engine is running the program
await expect(page.locator('.node-type')).toHaveText('Table', { timeout: 30000 })
await expect(page.locator('.TableVisualization')).toBeVisible({ timeout: 30000 })
await expect(page.locator('.TableVisualization')).toContainText('Welcome To Enso!')
// We can add new node and see suggestions.
await page.locator('.GraphNode').click()
await page.keyboard.press('Enter')
await expect(page.locator('.ComponentBrowser')).toBeVisible()
const entry = page.locator('.ComponentList .list-variant.selected .component', {
hasText: 'column_count',
})
await expect(entry).toBeVisible()
await entry.click()
await expect(page.locator('.GraphNode'), {}).toHaveCount(2)
await page.locator('.GraphNode', { hasText: 'column_count' }).click()
await page
.locator('.GraphNode', { hasText: 'column_count' })
.getByRole('button', { name: 'Visualization' })
.click()
})