diff --git a/app/gui2/e2e/actions.ts b/app/gui2/e2e/actions.ts index 374cd08c56ff0..c2fe8164ee20e 100644 --- a/app/gui2/e2e/actions.ts +++ b/app/gui2/e2e/actions.ts @@ -1,4 +1,6 @@ -import { type Page } from '@playwright/test' +import { expect, type Page } from '@playwright/test' +import * as customExpect from './customExpect' +import * as locate from './locate' // ================= // === goToGraph === @@ -7,5 +9,7 @@ import { type Page } from '@playwright/test' /** Perform a successful login. */ export async function goToGraph(page: Page) { await page.goto('/') - // Originally this clicked the play button but for now that is out of scope. + await expect(page.locator('.App')).toBeVisible() + // Wait until nodes are loaded. + await customExpect.toExist(locate.graphNode(page)) } diff --git a/app/gui2/e2e/typesOnNodeHover.spec.ts b/app/gui2/e2e/typesOnNodeHover.spec.ts index 736f0fc960bcc..23ba744217317 100644 --- a/app/gui2/e2e/typesOnNodeHover.spec.ts +++ b/app/gui2/e2e/typesOnNodeHover.spec.ts @@ -1,4 +1,4 @@ -import { expect, Locator, Page, test } from '@playwright/test' +import { expect, test, type Locator, type Page } from '@playwright/test' import assert from 'assert' import * as actions from './actions' import { mockExpressionUpdate } from './expressionUpdates' diff --git a/app/gui2/package.json b/app/gui2/package.json index 19aef9310749a..403d3c88c7aba 100644 --- a/app/gui2/package.json +++ b/app/gui2/package.json @@ -12,7 +12,7 @@ "build": "npm --workspace enso-dashboard run compile && run-p typecheck build-only", "build:cloud": "cross-env CLOUD_BUILD=true npm run build", "preview": "vite preview", - "test": "vitest run && playwright test --reporter=html", + "test": "vitest run && playwright test", "test:unit": "vitest", "test:e2e": "playwright test", "story:dev": "histoire dev", diff --git a/app/gui2/playwright.config.ts b/app/gui2/playwright.config.ts index 1e316c2819587..34ac1008dc9ca 100644 --- a/app/gui2/playwright.config.ts +++ b/app/gui2/playwright.config.ts @@ -39,7 +39,6 @@ export default defineConfig({ forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, ...(process.env.CI ? { workers: 1 } : {}), - reporter: 'line', expect: { timeout: 5000, toHaveScreenshot: { threshold: 0 }, @@ -110,7 +109,10 @@ export default defineConfig({ env: { E2E: 'true', }, - command: `npx vite build && npx vite preview --port ${PORT} --strictPort`, + command: + process.env.CI || process.env.PROD + ? `npx vite build && npx vite preview --port ${PORT} --strictPort` + : `npx vite dev --port ${PORT}`, // Build from scratch apparently can take a while on CI machines. timeout: 120 * 1000, port: PORT,