Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce test flakiness #8947

Merged
merged 4 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions app/gui2/e2e/actions.ts
Original file line number Diff line number Diff line change
@@ -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 ===
Expand All @@ -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))
}
2 changes: 1 addition & 1 deletion app/gui2/e2e/typesOnNodeHover.spec.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion app/gui2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions app/gui2/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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,
Expand Down
Loading