mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
test(e2e): onboarding-modes — select vault default and flip to a selectable STT provider (#4521)
This commit is contained in:
@@ -305,11 +305,17 @@ describe('Onboarding modes — Simple (Cloud) vs Advanced (Custom)', () => {
|
||||
await pause(400);
|
||||
await clickOnboardingNext();
|
||||
|
||||
// Step 8 — Custom Vault. Final step → Finish. VaultSetupStep auto-selects
|
||||
// "configure" and hides the choice cards for local sessions (the default
|
||||
// option is disabled when no cloud account backs the vault), so there is no
|
||||
// -default button to click — just advance.
|
||||
// Step 8 — Custom Vault. Final step → Finish. VaultSetupStep hides the
|
||||
// choice cards and auto-selects "configure" only for LOCAL sessions
|
||||
// (`defaultDisabled={isLocalSession}`); the E2E logs in via the cloud-auth
|
||||
// deep link, so the session is non-local — the choice cards ARE shown with
|
||||
// an enabled default, and the Finish button stays disabled (`choice === null`)
|
||||
// until one is picked. Select the default when the card is present; a local
|
||||
// session (cards hidden) just advances.
|
||||
expect(await testIdExists('onboarding-custom-vault-step', 10_000)).toBe(true);
|
||||
if (await testIdExists('onboarding-custom-vault-step-default', 2_000)) {
|
||||
await clickTestId('onboarding-custom-vault-step-default');
|
||||
}
|
||||
await pause(400);
|
||||
await clickOnboardingNext();
|
||||
|
||||
@@ -381,28 +387,39 @@ describe('Onboarding modes — Simple (Cloud) vs Advanced (Custom)', () => {
|
||||
expect(await testIdExists('stt-provider-select', 10_000)).toBe(true);
|
||||
|
||||
const before = readSectionString(readConfigToml(), 'local_ai', 'stt_provider');
|
||||
const want = before === 'whisper' ? 'cloud' : 'whisper';
|
||||
stepLog(`stt_provider before=${before ?? '<unset>'} → want=${want}`);
|
||||
|
||||
// Drive the same onChange path the user would. The `<option disabled>`
|
||||
// attribute blocks click/keyboard selection in the UI, but doesn't stop a
|
||||
// synthetic change event from React's perspective once we set `.value`.
|
||||
const dispatched = await browser.execute(next => {
|
||||
// Flip to a genuinely SELECTABLE provider. Local STT providers
|
||||
// (whisper/piper) render as `<option disabled>` in the CI container (no
|
||||
// local assets), so a synthetic change to them reverts and never persists —
|
||||
// asserting `stt_provider === 'whisper'` can never pass here. Pick an
|
||||
// enabled option whose value differs from the current selection and read
|
||||
// back the value the control actually committed to.
|
||||
const want = await browser.execute(() => {
|
||||
const el = document.querySelector<HTMLSelectElement>('[data-testid="stt-provider-select"]');
|
||||
if (!el) return false;
|
||||
if (!el) return null;
|
||||
const current = el.value;
|
||||
const candidate = Array.from(el.options).find(
|
||||
o => !o.disabled && o.value && o.value !== current
|
||||
);
|
||||
if (!candidate) return null;
|
||||
const setter = Object.getOwnPropertyDescriptor(
|
||||
window.HTMLSelectElement.prototype,
|
||||
'value'
|
||||
)?.set;
|
||||
if (setter) {
|
||||
setter.call(el, next);
|
||||
} else {
|
||||
el.value = next;
|
||||
}
|
||||
if (setter) setter.call(el, candidate.value);
|
||||
else el.value = candidate.value;
|
||||
el.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
return true;
|
||||
}, want);
|
||||
expect(dispatched).toBe(true);
|
||||
// A disabled option would revert; an enabled one sticks.
|
||||
return el.value === candidate.value ? candidate.value : null;
|
||||
});
|
||||
|
||||
if (!want) {
|
||||
stepLog(
|
||||
'No alternate selectable STT provider in this environment — skipping the provider-flip persistence assertion'
|
||||
);
|
||||
return;
|
||||
}
|
||||
stepLog(`stt_provider before=${before ?? '<unset>'} → want=${want}`);
|
||||
|
||||
// Voice Routing was decoupled into staged edit + explicit Save: the select's
|
||||
// onChange only stages `sttProvider` (VoicePanel `onSttProviderChange`);
|
||||
@@ -452,10 +469,13 @@ describe('Onboarding modes — Simple (Cloud) vs Advanced (Custom)', () => {
|
||||
await pause(400);
|
||||
await clickOnboardingNext();
|
||||
|
||||
// Step 8 — Custom Vault. Final step → Finish. VaultSetupStep auto-selects
|
||||
// "configure" and hides the choice cards for local sessions, so there is no
|
||||
// -default button to click — just advance.
|
||||
// Step 8 — Custom Vault. Final step → Finish. Choice cards are hidden/auto-
|
||||
// configured only for LOCAL sessions; the E2E's cloud-auth session shows the
|
||||
// cards with an enabled default that must be picked before Finish enables.
|
||||
expect(await testIdExists('onboarding-custom-vault-step', 10_000)).toBe(true);
|
||||
if (await testIdExists('onboarding-custom-vault-step-default', 2_000)) {
|
||||
await clickTestId('onboarding-custom-vault-step-default');
|
||||
}
|
||||
await pause(400);
|
||||
await clickOnboardingNext();
|
||||
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ Gespeicherte Workflows sind dauerhaft und trigger-gesteuert: sie feuern auf Zeit
|
||||
|
||||
## Beitragen aus dem Quellcode
|
||||
|
||||
Neu hier? Beginne mit [`CONTRIBUTING.md`](../CONTRIBUTING.md) für den Fork-/PR-Workflow und die lokalen Prüfbefehle, oder nutze den Copy-Paste-Prompt für KI-Coding-Agenten in [`CONTRIBUTING-BEGINNERS.md`](../CONTRIBUTING-BEGINNERS.md#optional-let-an-ai-coding-agent-guide-you). Der kurze Weg:
|
||||
Neu hier? Beginne mit [`CONTRIBUTING.md`](../CONTRIBUTING.md) für den Fork-/PR-Workflow und die lokalen Prüfbefehle, oder nutze den Copy-Paste-Prompt für KI-Coding-Agenten in [`CONTRIBUTING-BEGINNERS.md`](../CONTRIBUTING-BEGINNERS.md#optional--let-an-ai-coding-agent-guide-you). Der kurze Weg:
|
||||
|
||||
1. Installiere Git, Node.js 24+, pnpm 10.10.0, Rust 1.93.0 (`rustfmt` + `clippy`), CMake, Ninja, ripgrep sowie die plattformspezifischen Desktop-Build-Voraussetzungen.
|
||||
2. Forke und klone das Repo, führe dann `git submodule update --init --recursive` aus, bevor du `pnpm install` startest, damit die mitgelieferten Tauri/CEF-Quellen vorhanden sind.
|
||||
|
||||
@@ -156,7 +156,7 @@ n8n と Zapier に強くインスパイアされた[ワークフロー](https://
|
||||
|
||||
## ソースからのコントリビュート
|
||||
|
||||
新しいコントリビューターの方は、まず [`CONTRIBUTING.md`](../CONTRIBUTING.md) で fork/PR ワークフローとローカル検証コマンドを確認するか、[`CONTRIBUTING-BEGINNERS.md`](../CONTRIBUTING-BEGINNERS.md#optional-let-an-ai-coding-agent-guide-you) のコピー&ペーストできる AI エージェント向けプロンプトを使ってください。最短経路は以下のとおりです:
|
||||
新しいコントリビューターの方は、まず [`CONTRIBUTING.md`](../CONTRIBUTING.md) で fork/PR ワークフローとローカル検証コマンドを確認するか、[`CONTRIBUTING-BEGINNERS.md`](../CONTRIBUTING-BEGINNERS.md#optional--let-an-ai-coding-agent-guide-you) のコピー&ペーストできる AI エージェント向けプロンプトを使ってください。最短経路は以下のとおりです:
|
||||
|
||||
1. Git、Node.js 24+、pnpm 10.10.0、Rust 1.93.0(`rustfmt` + `clippy`)、CMake、Ninja、ripgrep、プラットフォーム向けデスクトップビルドの前提条件をインストールします。
|
||||
2. リポジトリを fork してクローンし、`pnpm install` の前に `git submodule update --init --recursive` を実行して、ベンダー化された Tauri/CEF のソースを取得します。
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ n8n과 Zapier에서 깊은 영감을 받은 [워크플로우](https://tinyhumans
|
||||
|
||||
## 소스에서 기여하기
|
||||
|
||||
새로운 기여자인가요? 포크/PR 워크플로우 및 로컬 검증 명령에 대해서는 [`CONTRIBUTING.md`](../CONTRIBUTING.md)에서 시작하거나, [`CONTRIBUTING-BEGINNERS.md`](../CONTRIBUTING-BEGINNERS.md#optional-let-an-ai-coding-agent-guide-you)의 복사-붙여넣기 AI 에이전트 프롬프트를 사용하세요. 빠른 경로는 다음과 같습니다.
|
||||
새로운 기여자인가요? 포크/PR 워크플로우 및 로컬 검증 명령에 대해서는 [`CONTRIBUTING.md`](../CONTRIBUTING.md)에서 시작하거나, [`CONTRIBUTING-BEGINNERS.md`](../CONTRIBUTING-BEGINNERS.md#optional--let-an-ai-coding-agent-guide-you)의 복사-붙여넣기 AI 에이전트 프롬프트를 사용하세요. 빠른 경로는 다음과 같습니다.
|
||||
|
||||
1. Git, Node.js 24+, pnpm 10.10.0, Rust 1.93.0(`rustfmt` + `clippy`), CMake, Ninja, ripgrep 및 플랫폼 데스크톱 빌드 필수 구성 요소를 설치합니다.
|
||||
2. 저장소를 포크하고 클론한 다음, `pnpm install` 전에 `git submodule update --init --recursive`를 실행하여 벤더링된 Tauri/CEF 소스가 존재하는지 확인합니다.
|
||||
|
||||
@@ -202,7 +202,7 @@ n8n اور Zapier سے گہرے متاثر، [ورک فلوز](https://tinyhuman
|
||||
|
||||
## سورس سے تعاون
|
||||
|
||||
نیا تعاون کنندہ؟ fork/PR ورک فلو اور مقامی تصدیقی کمانڈز کے لیے [`CONTRIBUTING.md`](../CONTRIBUTING.md) سے شروع کریں، یا [`CONTRIBUTING-BEGINNERS.md`](../CONTRIBUTING-BEGINNERS.md#optional-let-an-ai-coding-agent-guide-you) میں موجود کاپی پیسٹ AI-ایجنٹ پرامپٹ استعمال کریں۔ مختصر راستہ:
|
||||
نیا تعاون کنندہ؟ fork/PR ورک فلو اور مقامی تصدیقی کمانڈز کے لیے [`CONTRIBUTING.md`](../CONTRIBUTING.md) سے شروع کریں، یا [`CONTRIBUTING-BEGINNERS.md`](../CONTRIBUTING-BEGINNERS.md#optional--let-an-ai-coding-agent-guide-you) میں موجود کاپی پیسٹ AI-ایجنٹ پرامپٹ استعمال کریں۔ مختصر راستہ:
|
||||
|
||||
1. Git، Node.js 24+، pnpm 10.10.0، Rust 1.93.0 (`rustfmt` + `clippy`)، CMake، Ninja، ripgrep، اور پلیٹ فارم ڈیسک ٹاپ بلڈ کی ضروریات انسٹال کریں۔
|
||||
2. ریپو کو fork اور کلون کریں، پھر `pnpm install` سے پہلے `git submodule update --init --recursive` چلائیں تاکہ وینڈرڈ Tauri/CEF سورس موجود ہوں۔
|
||||
|
||||
@@ -156,7 +156,7 @@ OpenHuman 跳过了等待期。连接你的账户,让[自动拉取](https://ti
|
||||
|
||||
## 从源码贡献
|
||||
|
||||
新贡献者?从 [`CONTRIBUTING.md`](../CONTRIBUTING.md) 了解 fork/PR 工作流和本地验证命令,或使用 [`CONTRIBUTING-BEGINNERS.md`](../CONTRIBUTING-BEGINNERS.md#optional-let-an-ai-coding-agent-guide-you) 中可直接复制粘贴的 AI 智能体提示词。快速路径:
|
||||
新贡献者?从 [`CONTRIBUTING.md`](../CONTRIBUTING.md) 了解 fork/PR 工作流和本地验证命令,或使用 [`CONTRIBUTING-BEGINNERS.md`](../CONTRIBUTING-BEGINNERS.md#optional--let-an-ai-coding-agent-guide-you) 中可直接复制粘贴的 AI 智能体提示词。快速路径:
|
||||
|
||||
1. 安装 Git、Node.js 24+、pnpm 10.10.0、Rust 1.93.0(`rustfmt` + `clippy`)、CMake、Ninja、ripgrep,以及各平台桌面构建的前置依赖。
|
||||
2. Fork 并克隆仓库,然后运行 `git submodule update --init --recursive` 之后再执行 `pnpm install`,确保内置的 Tauri/CEF 源码就位。
|
||||
|
||||
Reference in New Issue
Block a user