mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user