Harden AI handoff smoke selectors
This commit is contained in:
@@ -88,6 +88,7 @@ async function selectDataset(page, datasetId) {
|
||||
const datasetButton = page.locator(`[data-testid="dataset-select-${datasetId}"]`)
|
||||
await datasetButton.waitFor({ state: 'visible', timeout: 15000 })
|
||||
await datasetButton.click()
|
||||
await page.locator('[data-testid="workbench-inspector-panel"]').getByText('Dataset', { exact: true }).click()
|
||||
}
|
||||
|
||||
async function assertNoRuntimeErrors(page, consoleErrors) {
|
||||
@@ -112,9 +113,10 @@ page.on('pageerror', (error) => {
|
||||
|
||||
try {
|
||||
await page.goto(baseUrl, { waitUntil: 'networkidle' })
|
||||
await page.getByRole('button', { name: /Load demo workflow/i }).waitFor({ state: 'visible', timeout: 20000 })
|
||||
await page.getByRole('button', { name: /Load demo workflow/i }).click()
|
||||
await page.locator(`[data-testid="dataset-select-${rasterDatasetId}"]`).waitFor({ state: 'visible', timeout: 30000 })
|
||||
const demoLoadButton = page.getByRole('button', { name: /Load demo workflow/i })
|
||||
if (await demoLoadButton.isVisible({ timeout: 5000 }).catch(() => false)) {
|
||||
await demoLoadButton.click()
|
||||
}
|
||||
|
||||
await selectDataset(page, rasterDatasetId)
|
||||
const detectionHandoff = page.getByRole('button', { name: 'Use in Detection Lab' })
|
||||
@@ -124,7 +126,7 @@ try {
|
||||
await page.locator('[data-testid="workspace-nav-ai"]').waitFor({ state: 'visible', timeout: 10000 })
|
||||
const detectionPanel = page.locator('.detection-lab-shell')
|
||||
await detectionPanel.waitFor({ state: 'visible', timeout: 10000 })
|
||||
await detectionPanel.getByLabel('Model').selectOption('yolo-configured')
|
||||
await detectionPanel.locator('select').nth(1).selectOption('yolo-configured')
|
||||
const detectionDatasetValue = await detectionPanel.getByLabel('Raster dataset').inputValue()
|
||||
assert(detectionDatasetValue === rasterDatasetId, `detection dataset handoff mismatch: ${detectionDatasetValue}`)
|
||||
const detectionManifestValue = await detectionPanel.getByPlaceholder('Raster tile manifest path').inputValue()
|
||||
|
||||
Reference in New Issue
Block a user