Skip to content

AI-native design editor. Open-source Figma alternative.

test: open the editor before checking panel layouts (#1632)

Neil Derraugh9a7e2436cdc3
diff --git a/tests/e2e/app/menu.spec.ts b/tests/e2e/app/menu.spec.ts
index 4e31a5d8e..ad62a8854 100644
--- a/tests/e2e/app/menu.spec.ts
+++ b/tests/e2e/app/menu.spec.ts
@@ -19,7 +19,6 @@ test('File menu opens and shows items', async () => {
const items = await menu.locator('[role="menuitem"]').allTextContents()
expect(items.some((t) => t.includes('Open'))).toBe(true)
- expect(items.some((t) => t.includes('Open storage workspace'))).toBe(true)
expect(items.some((t) => t.includes('Save'))).toBe(true)
expect(items.some((t) => t.includes('Save as'))).toBe(true)
@@ -155,12 +154,3 @@ test('Zoom to fit via View menu works', async () => {
const zoomAfter = await getStoreStateNumber('zoom')
expect(zoomAfter).not.toBe(zoomBefore)
})
-
-test('Open storage workspace navigates from the File menu', async () => {
- await editor.page.getByRole('menuitem', { name: 'File', exact: true }).click()
- await editor.page.getByRole('menuitem', { name: 'Open storage workspace…' }).click()
-
- await expect(editor.page).toHaveURL(/\/$/)
- await expect(editor.page.getByTestId('recent-files-home')).toBeVisible()
- await expect(editor.page.getByRole('heading', { name: 'Storage workspace' })).toBeVisible()
-})
diff --git a/tests/e2e/app/unsaved-changes.spec.ts b/tests/e2e/app/unsaved-changes.spec.ts
index 56c623d80..644c74339 100644
--- a/tests/e2e/app/unsaved-changes.spec.ts
+++ b/tests/e2e/app/unsaved-changes.spec.ts
@@ -2,7 +2,7 @@ import { expect, test } from '#tests/e2e/fixtures'
import { CanvasHelper } from '#tests/helpers/canvas'
test.beforeEach(async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
await new CanvasHelper(page).waitForInit()
await page.evaluate(() => {
const store = window.openPencil?.getStore?.()
diff --git a/tests/e2e/autosave.spec.ts b/tests/e2e/autosave.spec.ts
index 8c07d06fd..bc9baf9dc 100644
--- a/tests/e2e/autosave.spec.ts
+++ b/tests/e2e/autosave.spec.ts
@@ -74,7 +74,7 @@ test('no autosave without file handle', async ({ browser, baseURL }) => {
deviceScaleFactor: 2
})
const freshPage = await context.newPage()
- await freshPage.goto('/')
+ await freshPage.goto('/?test')
const freshCanvas = new CanvasHelper(freshPage)
await freshCanvas.waitForInit()
diff --git a/tests/e2e/canvas/manipulation.spec.ts b/tests/e2e/canvas/manipulation.spec.ts
index 6c8c86b9b..979aa3d3e 100644
--- a/tests/e2e/canvas/manipulation.spec.ts
+++ b/tests/e2e/canvas/manipulation.spec.ts
@@ -11,7 +11,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
await canvas.clearCanvas()
diff --git a/tests/e2e/canvas/split-views.spec.ts b/tests/e2e/canvas/split-views.spec.ts
index 4f606e018..9f65aa446 100644
--- a/tests/e2e/canvas/split-views.spec.ts
+++ b/tests/e2e/canvas/split-views.spec.ts
@@ -4,7 +4,7 @@ import { CanvasHelper } from '#tests/helpers/canvas'
test.describe('split canvas views', () => {
test('splits, resizes, activates, and closes independent canvas views', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
await expect(page.locator('[data-slot="canvas-pane-header"]')).toHaveCount(0)
diff --git a/tests/e2e/chat/notifications.spec.ts b/tests/e2e/chat/notifications.spec.ts
index c0cca2cb2..448a7efe6 100644
--- a/tests/e2e/chat/notifications.spec.ts
+++ b/tests/e2e/chat/notifications.spec.ts
@@ -101,11 +101,11 @@ test('a finished reply notifies only when turned on and away, and its click show
.toBe('2')
// Another document and the Design tab are in view when the notification is clicked.
- // The tab bar starts with Home; the chat's document is the tab after it.
const tabs = page.getByTestId('tabbar-tab')
- const chatDocument = tabs.nth(1)
+ const chatDocument = tabs.first()
await expect(chatDocument).toHaveAttribute('aria-selected', 'true')
await page.getByTestId('tabbar-new').click()
+ await page.getByTestId('home-new-design').click()
await expect(tabs.last()).toHaveAttribute('aria-selected', 'true')
await chat.designTab.click()
await page.evaluate(() => document.dispatchEvent(new Event('notification-click')))
diff --git a/tests/e2e/code/sandbox.spec.ts b/tests/e2e/code/sandbox.spec.ts
index e0aeecf92..8d9b95efd 100644
--- a/tests/e2e/code/sandbox.spec.ts
+++ b/tests/e2e/code/sandbox.spec.ts
@@ -5,7 +5,7 @@ import type { evaluateDesignJSX as EvaluateDesignJSX } from '@/app/code/sandbox/
import { CanvasHelper } from '#tests/helpers/canvas'
test.beforeEach(async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
})
diff --git a/tests/e2e/color-picker/basic.spec.ts b/tests/e2e/color-picker/basic.spec.ts
index c798b19ae..e721c44eb 100644
--- a/tests/e2e/color-picker/basic.spec.ts
+++ b/tests/e2e/color-picker/basic.spec.ts
@@ -11,7 +11,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
})
diff --git a/tests/e2e/color-picker/history.spec.ts b/tests/e2e/color-picker/history.spec.ts
index 9fa19fce0..15d1d4bde 100644
--- a/tests/e2e/color-picker/history.spec.ts
+++ b/tests/e2e/color-picker/history.spec.ts
@@ -12,7 +12,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
})
diff --git a/tests/e2e/editor/auto-layout/basic.spec.ts b/tests/e2e/editor/auto-layout/basic.spec.ts
index 890c838a4..fa1230117 100644
--- a/tests/e2e/editor/auto-layout/basic.spec.ts
+++ b/tests/e2e/editor/auto-layout/basic.spec.ts
@@ -13,7 +13,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
await canvas.clearCanvas()
diff --git a/tests/e2e/editor/auto-layout/drag.spec.ts b/tests/e2e/editor/auto-layout/drag.spec.ts
index b69ad4a03..7ea866ecd 100644
--- a/tests/e2e/editor/auto-layout/drag.spec.ts
+++ b/tests/e2e/editor/auto-layout/drag.spec.ts
@@ -5,7 +5,7 @@ import { CanvasHelper } from '#tests/helpers/canvas'
test('dragging selected nested instance content reorders its auto-layout item', async ({
page
}) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
@@ -89,7 +89,7 @@ test('dragging selected nested instance content reorders its auto-layout item',
test('auto-layout drag does not show an insert indicator before order changes', async ({
page
}) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
diff --git a/tests/e2e/editor/auto-layout/padding-editor.spec.ts b/tests/e2e/editor/auto-layout/padding-editor.spec.ts
index e7a021ebb..00029dafd 100644
--- a/tests/e2e/editor/auto-layout/padding-editor.spec.ts
+++ b/tests/e2e/editor/auto-layout/padding-editor.spec.ts
@@ -81,7 +81,7 @@ async function frameGap(page: Page, frameId: string) {
}
test('double-clicking an auto-layout padding handle opens a scrub editor', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
await canvas.clearCanvas()
@@ -108,7 +108,7 @@ test('double-clicking an auto-layout padding handle opens a scrub editor', async
})
test('clicking the canvas closes the auto-layout padding editor', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
await canvas.clearCanvas()
@@ -127,7 +127,7 @@ test('clicking the canvas closes the auto-layout padding editor', async ({ page
})
test('auto-layout padding editor follows canvas pan while open', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
await canvas.clearCanvas()
@@ -158,7 +158,7 @@ test('auto-layout padding editor follows canvas pan while open', async ({ page }
test('double-clicking an auto-layout gap edits it like a padding, as in Figma', async ({
page
}) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
await canvas.clearCanvas()
@@ -185,7 +185,7 @@ test('double-clicking an auto-layout gap edits it like a padding, as in Figma',
test('selecting another layer closes the value editor and keeps the value it had', async ({
page
}) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
await canvas.clearCanvas()
@@ -210,7 +210,7 @@ test('selecting another layer closes the value editor and keeps the value it had
})
test('deleting the frame closes its value editor', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
await canvas.clearCanvas()
diff --git a/tests/e2e/editor/drag-performance.spec.ts b/tests/e2e/editor/drag-performance.spec.ts
index 7064c5560..640706deb 100644
--- a/tests/e2e/editor/drag-performance.spec.ts
+++ b/tests/e2e/editor/drag-performance.spec.ts
@@ -4,7 +4,7 @@ import { CanvasHelper } from '#tests/helpers/canvas'
import { measureInteraction } from '#tests/helpers/performance/interaction'
test('dragging a nested card uses repaint-only position previews', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
diff --git a/tests/e2e/editor/resize-performance.spec.ts b/tests/e2e/editor/resize-performance.spec.ts
index f38646344..571dfceef 100644
--- a/tests/e2e/editor/resize-performance.spec.ts
+++ b/tests/e2e/editor/resize-performance.spec.ts
@@ -4,7 +4,7 @@ import { CanvasHelper } from '#tests/helpers/canvas'
import { measureInteraction } from '#tests/helpers/performance/interaction'
test('resizing uses repaint-only previews until mouseup', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
diff --git a/tests/e2e/export/basic.spec.ts b/tests/e2e/export/basic.spec.ts
index ede0ad8f4..7b070c42b 100644
--- a/tests/e2e/export/basic.spec.ts
+++ b/tests/e2e/export/basic.spec.ts
@@ -14,7 +14,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
await page.setViewportSize({ width: 1440, height: 1100 })
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
await canvas.clearCanvas()
diff --git a/tests/e2e/fixtures.ts b/tests/e2e/fixtures.ts
index 545a06e69..8009a5fba 100644
--- a/tests/e2e/fixtures.ts
+++ b/tests/e2e/fixtures.ts
@@ -2,7 +2,7 @@ import { test, expect, type Locator, type Page } from '@playwright/test'
import { CanvasHelper } from '#tests/helpers/canvas'
-export function useEditorSetup(url = '/') {
+export function useEditorSetup(url = '/?test') {
let page: Page
let canvas: CanvasHelper
@@ -29,7 +29,7 @@ export function useEditorSetup(url = '/') {
}
}
-export function useEditorSetupWithClear(url = '/') {
+export function useEditorSetupWithClear(url = '/?test') {
const ctx = useEditorSetup(url)
test.beforeEach(async () => {
diff --git a/tests/e2e/fonts/picker.spec.ts b/tests/e2e/fonts/picker.spec.ts
index a553e07d4..63cbbd8a1 100644
--- a/tests/e2e/fonts/picker.spec.ts
+++ b/tests/e2e/fonts/picker.spec.ts
@@ -4,7 +4,7 @@ import { CanvasHelper } from '#tests/helpers/canvas'
import { mockGoogleFonts } from '#tests/helpers/fonts/google'
async function openTypographyForText(page: Page) {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
diff --git a/tests/e2e/fonts/settings.spec.ts b/tests/e2e/fonts/settings.spec.ts
index dd8a2b9bf..1a98098c8 100644
--- a/tests/e2e/fonts/settings.spec.ts
+++ b/tests/e2e/fonts/settings.spec.ts
@@ -5,7 +5,7 @@ import { CanvasHelper } from '#tests/helpers/canvas'
test('the font settings gear opens Settings › Fonts without desktop-only cache actions', async ({
page
}) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
diff --git a/tests/e2e/layers/drop-indicator.spec.ts b/tests/e2e/layers/drop-indicator.spec.ts
index 4492ce734..bf5947d6d 100644
--- a/tests/e2e/layers/drop-indicator.spec.ts
+++ b/tests/e2e/layers/drop-indicator.spec.ts
@@ -30,7 +30,7 @@ async function dragLayerAndObserveIndicator(
}
test('layer reorder exposes a visible drop indicator before dropping', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
@@ -58,7 +58,7 @@ test('layer reorder exposes a visible drop indicator before dropping', async ({
})
test('layer child drop exposes a visible container highlight before dropping', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
diff --git a/tests/e2e/layers/reorder.spec.ts b/tests/e2e/layers/reorder.spec.ts
index 2ebb223af..4c5226898 100644
--- a/tests/e2e/layers/reorder.spec.ts
+++ b/tests/e2e/layers/reorder.spec.ts
@@ -12,7 +12,7 @@ async function layerOrder(page: Page, parentId?: string) {
}
test('dragging layers reorders scene nodes', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
@@ -43,7 +43,7 @@ test('dragging layers reorders scene nodes', async ({ page }) => {
})
test('an auto layout lists and reorders its layers in flow order', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
@@ -71,7 +71,7 @@ test('an auto layout lists and reorders its layers in flow order', async ({ page
})
test('dragging a layer into a container expands it and shows the child', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
diff --git a/tests/e2e/layers/scroll.spec.ts b/tests/e2e/layers/scroll.spec.ts
index f4eeb28dc..125c7ff27 100644
--- a/tests/e2e/layers/scroll.spec.ts
+++ b/tests/e2e/layers/scroll.spec.ts
@@ -3,7 +3,7 @@ import { expect, test } from '@playwright/test'
import { CanvasHelper } from '#tests/helpers/canvas'
test('pages and layers panels scroll inside splitter panes', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
diff --git a/tests/e2e/layers/sticky.spec.ts b/tests/e2e/layers/sticky.spec.ts
index c16aa74ef..7b5c5cf48 100644
--- a/tests/e2e/layers/sticky.spec.ts
+++ b/tests/e2e/layers/sticky.spec.ts
@@ -5,7 +5,7 @@ import { layerDriver } from '#tests/helpers/canvas/layers'
/** A frame with enough children to scroll past its own row, expanded in the layers panel. */
async function scrolledFrame(page: Page) {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
diff --git a/tests/e2e/pages/theme-background.spec.ts b/tests/e2e/pages/theme-background.spec.ts
index 3fe26e37b..66ddfc3b8 100644
--- a/tests/e2e/pages/theme-background.spec.ts
+++ b/tests/e2e/pages/theme-background.spec.ts
@@ -7,7 +7,7 @@ const DARK = 0x1e / 255
const LIGHT = 0.96
async function openFresh(page: Page) {
- await page.goto('/')
+ await page.goto('/?test')
await page.getByTestId('canvas-element').and(page.locator('[data-ready="1"]')).waitFor()
await page.locator('#loader').waitFor({ state: 'detached' })
}
diff --git a/tests/e2e/panels/basic.spec.ts b/tests/e2e/panels/basic.spec.ts
index 92d7f00ef..64ac245e7 100644
--- a/tests/e2e/panels/basic.spec.ts
+++ b/tests/e2e/panels/basic.spec.ts
@@ -1,7 +1,7 @@
import { expect, test, useEditorSetup } from '#tests/e2e/fixtures'
import { expectDefined } from '#tests/helpers/assert'
-const editor = useEditorSetup()
+const editor = useEditorSetup('/?test')
test('layers panel resize increases width', async () => {
const panel = editor.page.getByTestId('layers-panel')
diff --git a/tests/e2e/panels/visual.spec.ts b/tests/e2e/panels/visual.spec.ts
index 106e31945..b4e84db19 100644
--- a/tests/e2e/panels/visual.spec.ts
+++ b/tests/e2e/panels/visual.spec.ts
@@ -9,7 +9,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
})
diff --git a/tests/e2e/properties/blend-modes.spec.ts b/tests/e2e/properties/blend-modes.spec.ts
index 8633e39a8..f4358555d 100644
--- a/tests/e2e/properties/blend-modes.spec.ts
+++ b/tests/e2e/properties/blend-modes.spec.ts
@@ -35,7 +35,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
;[firstId, secondId] = await page.evaluate(() => {
diff --git a/tests/e2e/properties/component-properties.spec.ts b/tests/e2e/properties/component-properties.spec.ts
index 6a3261799..61f9ed5e6 100644
--- a/tests/e2e/properties/component-properties.spec.ts
+++ b/tests/e2e/properties/component-properties.spec.ts
@@ -35,7 +35,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
instanceId = await page.evaluate(() => {
diff --git a/tests/e2e/properties/corner/bindings.spec.ts b/tests/e2e/properties/corner/bindings.spec.ts
index 6f0dd3f39..f7ab73e5d 100644
--- a/tests/e2e/properties/corner/bindings.spec.ts
+++ b/tests/e2e/properties/corner/bindings.spec.ts
@@ -8,7 +8,7 @@ const paths = ['topLeftRadius', 'topRightRadius', 'bottomRightRadius', 'bottomLe
test('collapsed equivalent corners preserve their shared token through expansion and edits', async ({
page
}) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
const id = await page.evaluate(() => {
diff --git a/tests/e2e/properties/corner/smoothing.spec.ts b/tests/e2e/properties/corner/smoothing.spec.ts
index bea46250d..4bbdb6032 100644
--- a/tests/e2e/properties/corner/smoothing.spec.ts
+++ b/tests/e2e/properties/corner/smoothing.spec.ts
@@ -10,7 +10,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
})
diff --git a/tests/e2e/properties/corner/stroke-toggles.spec.ts b/tests/e2e/properties/corner/stroke-toggles.spec.ts
index 66ebaad40..7c06d8a22 100644
--- a/tests/e2e/properties/corner/stroke-toggles.spec.ts
+++ b/tests/e2e/properties/corner/stroke-toggles.spec.ts
@@ -10,7 +10,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
})
diff --git a/tests/e2e/properties/shared-styles.spec.ts b/tests/e2e/properties/shared-styles.spec.ts
index 80fcf0ae7..422279dee 100644
--- a/tests/e2e/properties/shared-styles.spec.ts
+++ b/tests/e2e/properties/shared-styles.spec.ts
@@ -11,7 +11,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
targetId = await page.evaluate(() => {
diff --git a/tests/e2e/properties/stroke-geometry.spec.ts b/tests/e2e/properties/stroke-geometry.spec.ts
index e43249e68..25bc6c31a 100644
--- a/tests/e2e/properties/stroke-geometry.spec.ts
+++ b/tests/e2e/properties/stroke-geometry.spec.ts
@@ -10,7 +10,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
})
diff --git a/tests/e2e/recovery.spec.ts b/tests/e2e/recovery.spec.ts
index f339fbfe5..09d4d4e17 100644
--- a/tests/e2e/recovery.spec.ts
+++ b/tests/e2e/recovery.spec.ts
@@ -7,7 +7,7 @@ test('keeps recovery independent from cancelling an unsaved-document close', asy
}) => {
const context = await browser.newContext({ baseURL })
const page = await context.newPage()
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
diff --git a/tests/e2e/settings/ai-setup-first-run.spec.ts b/tests/e2e/settings/ai-setup-first-run.spec.ts
index 5787921e6..4011412d8 100644
--- a/tests/e2e/settings/ai-setup-first-run.spec.ts
+++ b/tests/e2e/settings/ai-setup-first-run.spec.ts
@@ -1,6 +1,5 @@
import { expect, test } from '@playwright/test'
-import { CanvasHelper } from '#tests/helpers/canvas'
import { waitForDemo } from '#tests/helpers/demo'
// `?test` suppresses the first-run offer, so these load the app as a person would, with none
@@ -9,15 +8,15 @@ test.use({ storageState: { cookies: [], origins: [] } })
test('a fresh install offers guided AI setup once and remembers skipping it', async ({ page }) => {
await page.goto('/')
- // The offer is made while the workspace starts, so it is open once the canvas is ready.
- await new CanvasHelper(page).waitForInit()
+ // The offer is made while the workspace starts, over Home, where a first run begins.
const setup = page.getByTestId('ai-setup-dialog')
await expect(setup.getByRole('heading', { name: 'Welcome to OpenPencil' })).toBeVisible()
+ await expect(page.getByTestId('recent-files-home')).toBeVisible()
await setup.getByRole('button', { name: 'Start designing' }).click()
await expect(setup).toHaveCount(0)
await page.reload()
- await new CanvasHelper(page).waitForInit()
+ await expect(page.getByTestId('recent-files-home')).toBeVisible()
await expect(setup).toHaveCount(0)
})
@@ -78,7 +77,7 @@ test.describe('an install with a configured model', () => {
test('never sees the first-run offer', async ({ page }) => {
await page.goto('/')
- await new CanvasHelper(page).waitForInit()
+ await expect(page.getByTestId('recent-files-home')).toBeVisible()
await expect(page.getByTestId('ai-setup-dialog')).toHaveCount(0)
})
})
diff --git a/tests/e2e/snap/guides.spec.ts b/tests/e2e/snap/guides.spec.ts
index 7c8a10315..6163610d3 100644
--- a/tests/e2e/snap/guides.spec.ts
+++ b/tests/e2e/snap/guides.spec.ts
@@ -11,7 +11,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
await canvas.clearCanvas()
diff --git a/tests/e2e/stroke-picker/basic.spec.ts b/tests/e2e/stroke-picker/basic.spec.ts
index 78444859b..df7f2fc72 100644
--- a/tests/e2e/stroke-picker/basic.spec.ts
+++ b/tests/e2e/stroke-picker/basic.spec.ts
@@ -44,7 +44,7 @@ async function getSelectedStroke(page: Page) {
test('stroke picker updates stroke color on a rectangle', async ({ page }) => {
const canvas = new CanvasHelper(page)
- await page.goto('/')
+ await page.goto('/?test')
await canvas.waitForInit()
await canvas.drawRect(120, 120, 180, 120)
@@ -66,7 +66,7 @@ test('stroke picker updates stroke color on a rectangle', async ({ page }) => {
test('stroke picker alpha slider updates stroke opacity and alpha', async ({ page }) => {
const canvas = new CanvasHelper(page)
- await page.goto('/')
+ await page.goto('/?test')
await canvas.waitForInit()
await canvas.drawRect(120, 120, 180, 120)
@@ -144,7 +144,7 @@ test('bound stroke picker is non-destructive, rolls back Escape, and detaches in
page
}) => {
const canvas = new CanvasHelper(page)
- await page.goto('/')
+ await page.goto('/?test')
await canvas.waitForInit()
await canvas.drawRect(120, 120, 180, 120)
await propertySection(page, 'Stroke').getByRole('button', { name: 'Add stroke' }).click()
diff --git a/tests/e2e/stroke-picker/gradient.spec.ts b/tests/e2e/stroke-picker/gradient.spec.ts
index fb97b5c20..07c23fa37 100644
--- a/tests/e2e/stroke-picker/gradient.spec.ts
+++ b/tests/e2e/stroke-picker/gradient.spec.ts
@@ -15,7 +15,7 @@ async function selectedStroke(page: Page) {
/** Until the stroke panel opened the fill picker, a stroke could only ever be one flat color. */
test('a stroke can be made a gradient and taken back to solid', async ({ page }) => {
const canvas = new CanvasHelper(page)
- await page.goto('/')
+ await page.goto('/?test')
await canvas.waitForInit()
await canvas.drawRect(120, 120, 180, 120)
diff --git a/tests/e2e/text/double-click-edit.spec.ts b/tests/e2e/text/double-click-edit.spec.ts
index 904893130..2a020a8c8 100644
--- a/tests/e2e/text/double-click-edit.spec.ts
+++ b/tests/e2e/text/double-click-edit.spec.ts
@@ -68,7 +68,7 @@ async function addFrameWithNestedText(page: Page) {
}
test('double-clicking top-level text enters text edit mode', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
@@ -83,7 +83,7 @@ test('double-clicking top-level text enters text edit mode', async ({ page }) =>
})
test('single-clicking another text switches text edit target', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
@@ -99,7 +99,7 @@ test('single-clicking another text switches text edit target', async ({ page })
})
test('double-click drill enters nested text edit mode', async ({ page }) => {
- await page.goto('/')
+ await page.goto('/?test')
const canvas = new CanvasHelper(page)
await canvas.waitForInit()
canvas.errors.length = 0
diff --git a/tests/e2e/text/formatting.spec.ts b/tests/e2e/text/formatting.spec.ts
index ee74e89f6..3c43f8c52 100644
--- a/tests/e2e/text/formatting.spec.ts
+++ b/tests/e2e/text/formatting.spec.ts
@@ -11,7 +11,7 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- await page.goto('/')
+ await page.goto('/?test')
canvas = new CanvasHelper(page)
await canvas.waitForInit()
await canvas.clearCanvas()
diff --git a/tests/helpers/chat/harness.ts b/tests/helpers/chat/harness.ts
index 357df6591..a7451cebf 100644
--- a/tests/helpers/chat/harness.ts
+++ b/tests/helpers/chat/harness.ts
@@ -36,7 +36,7 @@ export class ChatHarness {
}
async open(): Promise<void> {
- await this.page.goto('/')
+ await this.page.goto('/?test')
await this.page.evaluate(async () => {
const themeModulePath = '/src/app/shell/theme.ts'
const themeModule = await import(themeModulePath)