add electron e2e harness and regression coverage (#697)

This commit is contained in:
Lingxuan Zuo
2026-03-28 15:34:20 +08:00
committed by GitHub
Unverified
parent 514a6c4112
commit 2668082809
22 changed files with 535 additions and 78 deletions

View File

@@ -192,13 +192,13 @@ export function Models() {
const usageLoading = isGatewayRunning && fetchState.status === 'loading';
return (
<div className="flex flex-col -m-6 dark:bg-background h-[calc(100vh-2.5rem)] overflow-hidden">
<div data-testid="models-page" className="flex flex-col -m-6 dark:bg-background h-[calc(100vh-2.5rem)] overflow-hidden">
<div className="w-full max-w-5xl mx-auto flex flex-col h-full p-10 pt-16">
{/* Header */}
<div className="flex flex-col md:flex-row md:items-start justify-between mb-12 shrink-0 gap-4">
<div>
<h1 className="text-5xl md:text-6xl font-serif text-foreground mb-3 font-normal tracking-tight" style={{ fontFamily: 'Georgia, Cambria, "Times New Roman", Times, serif' }}>
<h1 data-testid="models-page-title" className="text-5xl md:text-6xl font-serif text-foreground mb-3 font-normal tracking-tight" style={{ fontFamily: 'Georgia, Cambria, "Times New Roman", Times, serif' }}>
{t('dashboard:models.title')}
</h1>
<p className="text-[17px] text-foreground/70 font-medium">

View File

@@ -448,7 +448,7 @@ export function Settings() {
};
return (
<div className="flex flex-col -m-6 dark:bg-background h-[calc(100vh-2.5rem)] overflow-hidden">
<div data-testid="settings-page" className="flex flex-col -m-6 dark:bg-background h-[calc(100vh-2.5rem)] overflow-hidden">
<div className="w-full max-w-5xl mx-auto flex flex-col h-full p-10 pt-16">
{/* Header */}
@@ -612,6 +612,7 @@ export function Settings() {
</p>
</div>
<Switch
data-testid="settings-dev-mode-switch"
checked={devModeUnlocked}
onCheckedChange={setDevModeUnlocked}
/>
@@ -638,8 +639,8 @@ export function Settings() {
{devModeUnlocked && (
<>
<Separator className="bg-black/5 dark:bg-white/5" />
<div>
<h2 className="text-3xl font-serif text-foreground mb-6 font-normal tracking-tight" style={{ fontFamily: 'Georgia, Cambria, "Times New Roman", Times, serif' }}>
<div data-testid="settings-developer-section">
<h2 data-testid="settings-developer-title" className="text-3xl font-serif text-foreground mb-6 font-normal tracking-tight" style={{ fontFamily: 'Georgia, Cambria, "Times New Roman", Times, serif' }}>
{t('developer.title')}
</h2>
<div className="space-y-8">
@@ -756,6 +757,7 @@ export function Settings() {
</p>
<div className="flex flex-wrap gap-2">
<Input
data-testid="settings-developer-gateway-token"
readOnly
value={controlUiInfo?.token || ''}
placeholder={t('developer.tokenUnavailable')}

View File

@@ -200,7 +200,7 @@ export function Setup() {
return (
<div className="flex h-screen flex-col overflow-hidden bg-background text-foreground">
<div data-testid="setup-page" className="flex h-screen flex-col overflow-hidden bg-background text-foreground">
<TitleBar />
<div className="flex-1 overflow-auto">
{/* Progress Indicator */}
@@ -293,11 +293,11 @@ export function Setup() {
</div>
<div className="flex gap-2">
{!isLastStep && safeStepIndex !== STEP.RUNTIME && (
<Button variant="ghost" onClick={handleSkip}>
<Button data-testid="setup-skip-button" variant="ghost" onClick={handleSkip}>
{t('nav.skipSetup')}
</Button>
)}
<Button onClick={handleNext} disabled={!canProceed}>
<Button data-testid="setup-next-button" onClick={handleNext} disabled={!canProceed}>
{isLastStep ? (
t('nav.getStarted')
) : (
@@ -324,7 +324,7 @@ function WelcomeContent() {
const { language, setLanguage } = useSettingsStore();
return (
<div className="text-center space-y-4">
<div data-testid="setup-welcome-step" className="text-center space-y-4">
<div className="mb-4 flex justify-center">
<img src={clawxIcon} alt="ClawX" className="h-16 w-16" />
</div>