enso/app/ide-desktop/client/tests/createNewProject.spec.ts
Adam Obuchowicz c7cc5f0be0
Run integration in CI. (#11198)
Added a step for packaging IDE which runs integration tests.

This is an additional step, not a job, because here I'm sure the package will exist and won't be built unnecessarily twice. Technically I could make a job downloading it from GH action, but didn't want to invest time to rust scripts. Once Bazel will be fully introduced, the integration test will be improved.

# Important Notes
Fixes #8487
2024-10-03 13:41:22 +00:00

35 lines
1.5 KiB
TypeScript

/** @file A test for basic flow of the application: open project and see if nodes appear. */
/* eslint-disable @typescript-eslint/no-magic-numbers */
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: 30000 })
// We see the node type and visualization, so the engine is running the program
await expect(page.locator('.node-type')).toHaveText('Table')
await expect(page.locator('.TableVisualization')).toBeVisible()
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()
})