mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-19 10:43:08 +00:00
Merge main into massive-terminal-upgrade
Resolves merge conflicts: - apps/server/src/routes/terminal/common.ts: Keep randomBytes import, use @automaker/utils for createLogger - apps/ui/eslint.config.mjs: Use main's explicit globals list with XMLHttpRequest and MediaQueryListEvent additions - apps/ui/src/components/views/terminal-view.tsx: Keep our terminal improvements (killAllSessions, beforeunload, better error handling) - apps/ui/src/config/terminal-themes.ts: Keep our search highlight colors for all themes - apps/ui/src/store/app-store.ts: Keep our terminal settings persistence improvements (merge function) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Page, Locator } from "@playwright/test";
|
||||
import { clickElement } from "../core/interactions";
|
||||
import { navigateToSpec } from "../navigation/views";
|
||||
import { Page, Locator } from '@playwright/test';
|
||||
import { clickElement } from '../core/interactions';
|
||||
import { navigateToSpec } from '../navigation/views';
|
||||
|
||||
/**
|
||||
* Get the spec editor element
|
||||
@@ -20,10 +20,7 @@ export async function getSpecEditorContent(page: Page): Promise<string> {
|
||||
/**
|
||||
* Set the spec editor content
|
||||
*/
|
||||
export async function setSpecEditorContent(
|
||||
page: Page,
|
||||
content: string
|
||||
): Promise<void> {
|
||||
export async function setSpecEditorContent(page: Page, content: string): Promise<void> {
|
||||
const editor = await getSpecEditor(page);
|
||||
await editor.fill(content);
|
||||
}
|
||||
@@ -32,14 +29,14 @@ export async function setSpecEditorContent(
|
||||
* Click the save spec button
|
||||
*/
|
||||
export async function clickSaveSpec(page: Page): Promise<void> {
|
||||
await clickElement(page, "save-spec");
|
||||
await clickElement(page, 'save-spec');
|
||||
}
|
||||
|
||||
/**
|
||||
* Click the reload spec button
|
||||
*/
|
||||
export async function clickReloadSpec(page: Page): Promise<void> {
|
||||
await clickElement(page, "reload-spec");
|
||||
await clickElement(page, 'reload-spec');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,7 +44,7 @@ export async function clickReloadSpec(page: Page): Promise<void> {
|
||||
*/
|
||||
export async function getDisplayedSpecPath(page: Page): Promise<string | null> {
|
||||
const specView = page.locator('[data-testid="spec-view"]');
|
||||
const pathElement = specView.locator("p.text-muted-foreground").first();
|
||||
const pathElement = specView.locator('p.text-muted-foreground').first();
|
||||
return await pathElement.textContent();
|
||||
}
|
||||
|
||||
@@ -60,13 +57,17 @@ 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();
|
||||
return content || "";
|
||||
// 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 || '';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,14 +82,14 @@ export async function setEditorContent(page: Page, content: string): Promise<voi
|
||||
await page.waitForTimeout(200);
|
||||
|
||||
// Select all content (Cmd+A on Mac, Ctrl+A on others)
|
||||
const isMac = process.platform === "darwin";
|
||||
await page.keyboard.press(isMac ? "Meta+a" : "Control+a");
|
||||
const isMac = process.platform === 'darwin';
|
||||
await page.keyboard.press(isMac ? 'Meta+a' : 'Control+a');
|
||||
|
||||
// Wait for selection
|
||||
await page.waitForTimeout(100);
|
||||
|
||||
// Delete the selected content first
|
||||
await page.keyboard.press("Backspace");
|
||||
await page.keyboard.press('Backspace');
|
||||
|
||||
// Wait for deletion
|
||||
await page.waitForTimeout(100);
|
||||
@@ -111,7 +112,7 @@ export async function clickSaveButton(page: Page): Promise<void> {
|
||||
await page.waitForFunction(
|
||||
() => {
|
||||
const btn = document.querySelector('[data-testid="save-spec"]');
|
||||
return btn?.textContent?.includes("Saved");
|
||||
return btn?.textContent?.includes('Saved');
|
||||
},
|
||||
{ timeout: 5000 }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user