mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
enhance spec editor and worktree tests for improved reliability
- Updated spec editor persistence test to wait for loading state and content updates. - Improved worktree integration test to ensure worktree button visibility and selected state after creation. - Refactored getEditorContent function to ensure CodeMirror content is fully loaded before retrieval.
This commit is contained in:
@@ -60,12 +60,16 @@ export async function navigateToSpecEditor(page: Page): Promise<void> {
|
||||
|
||||
/**
|
||||
* Get the CodeMirror editor content
|
||||
* Waits for CodeMirror to be ready and returns the content
|
||||
*/
|
||||
export async function getEditorContent(page: Page): Promise<string> {
|
||||
// CodeMirror uses a contenteditable div with class .cm-content
|
||||
const content = await page
|
||||
.locator('[data-testid="spec-editor"] .cm-content')
|
||||
.textContent();
|
||||
// Wait for it to be visible and then read its textContent
|
||||
const contentElement = page.locator('[data-testid="spec-editor"] .cm-content');
|
||||
await contentElement.waitFor({ state: "visible", timeout: 10000 });
|
||||
|
||||
// Read the content - CodeMirror should have updated its DOM by now
|
||||
const content = await contentElement.textContent();
|
||||
return content || "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user