feat: 工作目录支持页面内目录浏览器

This commit is contained in:
2026-10-24 23:20:20 +08:00
parent dd7612bc74
commit e555610037
15 changed files with 1154 additions and 16 deletions
+19 -1
View File
@@ -73,7 +73,25 @@ test('manages a task and reads a real run log', async ({ page, request }) => {
})
const workingDir = createVenvFixture()
await newTaskDialog.getByLabel(/项目工作目录/).fill(workingDir)
const workingDirInput = newTaskDialog.getByLabel(/项目工作目录/)
// Cron 预览是异步渲染的,等它稳定后再点击,避免点击坐标在弹窗重排中失效。
await expect(newTaskDialog.locator('.cron-run-item').first()).toBeVisible()
await newTaskDialog.getByRole('button', { name: '选择文件夹…' }).click()
const directoryPicker = page.getByRole('dialog', { name: '选择项目工作目录' })
await expect(directoryPicker).toBeVisible()
const directoryPathInput = directoryPicker.getByLabel('目录路径')
await directoryPathInput.fill(workingDir)
await directoryPathInput.press('Enter')
await expect(
directoryPicker.getByRole('button', { name: '使用此目录' }),
).toBeEnabled()
await page.screenshot({
path: 'test-results/dashboard-directory-picker.png',
fullPage: true,
})
await directoryPicker.getByRole('button', { name: '使用此目录' }).click()
await expect(directoryPicker).toBeHidden()
await expect(workingDirInput).toHaveValue(workingDir)
await expect(
newTaskDialog.locator('.env-status-badge.ok code'),
).toHaveText('.venv\\Scripts\\python.exe')