test(e2e): repair investigation textarea selectors

This commit is contained in:
2026-08-15 13:55:59 +01:00
parent a599922d9f
commit 2561b5d720
5 changed files with 38 additions and 36 deletions
+7 -7
View File
@@ -44,7 +44,7 @@ test("provider error: analyse returns failure → error panel visible alongside
window.__MOCK_SCENARIO = "error";
});
const textarea = page.locator("textarea[placeholder*=Describe]");
const textarea = page.locator('[data-testid="scenario-textarea"]');
await textarea.fill(PROVIDER_ERROR.centralStatement);
await page.getByRole("button", { name: "Analyse" }).click();
@@ -73,7 +73,7 @@ test("provider error during update turn: error panel appears after answer submit
window.__MOCK_SCENARIO = ""; // normal default for start
});
const textarea = page.locator("textarea[placeholder*=Describe]");
const textarea = page.locator('[data-testid="scenario-textarea"]');
await textarea.fill(INVESTIGATION_SCENARIOS[0].centralStatement);
await page.getByRole("button", { name: "Analyse" }).click();
@@ -86,7 +86,7 @@ test("provider error during update turn: error panel appears after answer submit
});
// Submit an answer to trigger the update call (which will now get error)
const answerTextarea = page.locator('textarea[placeholder*=Answer]');
const answerTextarea = page.locator('[data-testid="response-textarea"]');
if (await answerTextarea.isVisible({ timeout: 3000 })) {
await answerTextarea.fill("Some answer that should fail");
await page.getByRole("button", { name: "Update situation" }).click();
@@ -109,7 +109,7 @@ test("malformed response during start: error state visible, workspace still rend
window.__MOCK_SCENARIO = "error";
});
const textarea = page.locator("textarea[placeholder*=Describe]");
const textarea = page.locator('[data-testid="scenario-textarea"]');
await textarea.fill(MALFORMED_RESPONSE.centralStatement);
await page.getByRole("button", { name: "Analyse" }).click();
@@ -136,7 +136,7 @@ test("recovery state persists via sessionStorage after error response", async ({
window.__MOCK_SCENARIO = "error";
});
const textarea = page.locator("textarea[placeholder*=Describe]");
const textarea = page.locator('[data-testid="scenario-textarea"]');
await textarea.fill(PROVIDER_ERROR.centralStatement);
await page.getByRole("button", { name: "Analyse" }).click();
@@ -167,7 +167,7 @@ test("multiple successive errors maintain UI state without crash", async ({ page
window.__MOCK_SCENARIO = "error";
});
const textarea = page.locator("textarea[placeholder*=Describe]");
const textarea = page.locator('[data-testid="scenario-textarea"]');
await textarea.fill(PROVIDER_ERROR.centralStatement);
// First analyse call
@@ -177,7 +177,7 @@ test("multiple successive errors maintain UI state without crash", async ({ page
await expect(page.locator('[data-testid="reasoning-workspace"]')).toBeVisible();
// If there's an answer textarea, try another update (also errors)
const answerTextarea = page.locator('textarea[placeholder*=Answer]');
const answerTextarea = page.locator('[data-testid="response-textarea"]');
if (await answerTextarea.isVisible({ timeout: 2000 })) {
await answerTextarea.fill("Second attempt");
await page.getByRole("button", { name: "Update situation" }).click();