refactor: improve context view tests by utilizing utility functions

- Replaced direct element locators with utility functions for better readability and maintainability in context view tests.
- Removed unnecessary wait statements and replaced them with appropriate utility functions to enhance test reliability.
- Streamlined the verification process for file visibility and content loading, ensuring tests are more efficient and easier to understand.
This commit is contained in:
Kacper
2025-12-15 02:49:08 +01:00
parent b998d253bb
commit caae869501
2 changed files with 37 additions and 66 deletions

View File

@@ -144,9 +144,6 @@ export async function selectContextFile(
const fileButton = await getByTestId(page, `context-file-${filename}`);
await fileButton.waitFor({ state: "visible", timeout });
// Small delay to ensure React has finished rendering the file list
await page.waitForTimeout(200);
// Use JavaScript click to ensure React onClick handler fires
await fileButton.evaluate((el) => (el as HTMLButtonElement).click());