@iblai/iblai-js 1.13.0 → 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-layer/playwright/index.d.ts +4 -0
- package/dist/data-layer/playwright/screenshare-tab-helpers.d.ts +57 -0
- package/dist/data-layer/playwright/voice-tab-helpers.d.ts +194 -0
- package/dist/playwright/index.cjs +523 -2
- package/dist/playwright/index.cjs.map +1 -1
- package/dist/playwright/index.d.ts +253 -2
- package/dist/playwright/index.esm.js +485 -3
- package/dist/playwright/index.esm.js.map +1 -1
- package/dist/playwright/playwright/index.d.ts +4 -0
- package/dist/playwright/playwright/screenshare-tab-helpers.d.ts +57 -0
- package/dist/playwright/playwright/voice-tab-helpers.d.ts +194 -0
- package/dist/web-containers/playwright/index.d.ts +4 -0
- package/dist/web-containers/playwright/screenshare-tab-helpers.d.ts +57 -0
- package/dist/web-containers/playwright/voice-tab-helpers.d.ts +194 -0
- package/dist/web-containers/source/next/index.esm.js +908 -21
- package/dist/web-utils/playwright/index.d.ts +4 -0
- package/dist/web-utils/playwright/screenshare-tab-helpers.d.ts +57 -0
- package/dist/web-utils/playwright/voice-tab-helpers.d.ts +194 -0
- package/package.json +5 -5
|
@@ -23,6 +23,10 @@ export { getCurrentTenantShowPaywall, creditBalanceTrigger, creditBalancePanel,
|
|
|
23
23
|
export type { CreditBalancePlan } from './credit-balance-helpers';
|
|
24
24
|
export { PRIVACY_LABELS, isPrivacyTabVisible, switchToPrivacyTab, getPrivacyRouterSwitch, setPrivacyRouterEnabled, expectPrivacyRouterEnabled, expectPrivacyFieldsHidden, expectPrivacyFieldsVisible, selectPrivacyAction, setBlockMessage, getEntityChip, setEntitySelected, expectEntitySelected, getOutputFilterSwitch, setOutputFilterEnabled, expectOutputFilterEnabled, } from './privacy-tab-helpers';
|
|
25
25
|
export type { PrivacyAction, PrivacyEntity } from './privacy-tab-helpers';
|
|
26
|
+
export { VOICE_LABELS, isVoiceTabVisible, switchToVoiceTab, switchToVoiceSubTab, getVoiceProviderCard, selectVoiceProvider, expectVoiceProviderSelected, openMentorVoicePicker, openCallConfigVoicePicker, previewMentorVoiceInline, previewCallConfigVoiceInline, expectMentorVoiceTriggerShows, expectCallConfigVoiceTriggerShows, searchVoices, getVoiceRow, expectVoiceVisible, selectVoice, previewVoice, saveVoiceSettings, getCallConfigForm, expectCallConfigVisible, selectCallMode, setCallLanguage, selectLlmProvider, selectTtsProvider, selectSttProvider, expectTtsSelectDisabled, expectSttSelectDisabled, setUseFunctionCallingEnabled, setEnableVideo, saveCallConfig, resetCallConfig, } from './voice-tab-helpers';
|
|
27
|
+
export type { VoiceProvider, CallMode, TtsProvider, SttProvider, LlmProvider, } from './voice-tab-helpers';
|
|
28
|
+
export { SCREENSHARE_LABELS, isScreenShareTabVisible, switchToScreenShareTab, openScreenSharePromptEditor, setScreenSharePrompt, saveScreenSharePrompts, expectScreenShareDisabledHint, } from './screenshare-tab-helpers';
|
|
29
|
+
export type { ScreenSharePromptField } from './screenshare-tab-helpers';
|
|
26
30
|
export { billingPlanSection, billingCreditsSection, billingAutoRechargeSection, getBillingPlanLabel, getBillingAutoRechargeStatus, waitForBillingTabReady, expectBillingPlanSection, expectBillingCreditsSection, expectBillingAutoRechargeSection, expectBillingTabForFreePlan, expectBillingTabForTrialPlan, expectBillingTabForPremiumPlan, expectBillingTabForCurrentPlan, clickBillingUpgrade, clickBillingAddCredits, clickBillingManageBilling, clickBillingManageUsage, } from './billing-tab-helpers';
|
|
27
31
|
export type { BillingAutoRechargeStatus } from './billing-tab-helpers';
|
|
28
32
|
export { TASKS_LABELS, isTasksTabVisible, switchToTasksTab, getScheduleTaskButton, getSearchInput, getTaskRow, expectTotalTasks, expectCompletedTasks, expectFailedTasks, expectTasksEmpty, expectTaskInList, expectTaskNotInList, selectTaskInList, expectTaskStatus, searchTasks, openScheduleTaskDialog, scheduleTask, expectScheduleStartTimeInPastError, deleteTask, expectLogsForTask, expectNoLogsForSelectedTask, openFirstLogDetails, expectLogDetailsStatus, } from './tasks-tab-helpers';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Screen share tab helpers — Playwright bindings for the standalone
|
|
4
|
+
* `AgentScreenShareTab` component from `@iblai/web-containers`.
|
|
5
|
+
*
|
|
6
|
+
* The tab is a peer to Voice/LLM/Tools/etc in the edit-mentor modal.
|
|
7
|
+
* It only edits the two screensharing prompts on the mentor's
|
|
8
|
+
* CallConfiguration; the on/off toggle lives on the Settings tab.
|
|
9
|
+
*
|
|
10
|
+
* Selectors below use stable hooks only: `data-testid`, role + name,
|
|
11
|
+
* and label-based queries. No CSS class selectors.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SCREENSHARE_LABELS: {
|
|
14
|
+
readonly tabName: "Screen Share";
|
|
15
|
+
readonly headerTitle: "Screen Share";
|
|
16
|
+
readonly fields: {
|
|
17
|
+
readonly systemPrompt: "Instructions during screen sharing";
|
|
18
|
+
readonly proactivePrompt: "What the agent says when screen sharing starts";
|
|
19
|
+
};
|
|
20
|
+
readonly saveButton: "Save";
|
|
21
|
+
};
|
|
22
|
+
export type ScreenSharePromptField = 'systemPrompt' | 'proactivePrompt';
|
|
23
|
+
/**
|
|
24
|
+
* Returns false if the Screen share tab isn't currently rendered in
|
|
25
|
+
* the Edit Mentor dialog (e.g. the host hasn't registered it, or it's
|
|
26
|
+
* hidden by RBAC).
|
|
27
|
+
*/
|
|
28
|
+
export declare function isScreenShareTabVisible(page: Page): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* Switch to the Screen share top-level tab. Assumes the Edit Mentor
|
|
31
|
+
* dialog is open.
|
|
32
|
+
*/
|
|
33
|
+
export declare function switchToScreenShareTab(page: Page): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Open the inline prompt editor for one of the two screensharing
|
|
36
|
+
* prompts. Mirrors the Prompts tab pattern: each prompt is rendered as
|
|
37
|
+
* a card with an "Edit <label>" button that pops the rich-text modal.
|
|
38
|
+
*/
|
|
39
|
+
export declare function openScreenSharePromptEditor(scope: Page | Locator, field: ScreenSharePromptField): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Replace the prompt text inside the rich-text modal and confirm. The
|
|
42
|
+
* new value is written to local form state; call `saveScreenSharePrompts`
|
|
43
|
+
* afterwards to persist.
|
|
44
|
+
*/
|
|
45
|
+
export declare function setScreenSharePrompt(scope: Page | Locator, field: ScreenSharePromptField, text: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Click the tab's Save button to persist any pending prompt edits.
|
|
48
|
+
* Asserts the button is enabled first — a no-op call on a pristine
|
|
49
|
+
* tab would be a test bug.
|
|
50
|
+
*/
|
|
51
|
+
export declare function saveScreenSharePrompts(scope: Page | Locator): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Assert whether the amber off-state hint is shown. The hint renders
|
|
54
|
+
* when `enable_video` is false on the underlying CallConfiguration
|
|
55
|
+
* (or when no call_configuration exists yet).
|
|
56
|
+
*/
|
|
57
|
+
export declare function expectScreenShareDisabledHint(scope: Page | Locator, visible: boolean): Promise<void>;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Voice tab helpers — Playwright bindings for the `AgentVoiceTab` component
|
|
4
|
+
* from `@iblai/web-containers`.
|
|
5
|
+
*
|
|
6
|
+
* The Voice tab contains two sub-tabs:
|
|
7
|
+
* 1. "Voice" — provider + voice-picker, persisted via mentor settings
|
|
8
|
+
* 2. "Call Configuration" — TTS / STT / LLM / video stack, persisted via the
|
|
9
|
+
* `/call-configurations/` endpoint
|
|
10
|
+
*
|
|
11
|
+
* All UI strings mirror `AGENT_VOICE_TAB_LABELS` from
|
|
12
|
+
* `@iblai/web-containers/next`. If a consumer renames a label via the
|
|
13
|
+
* `labels` prop, override these constants per spec — don't edit this file.
|
|
14
|
+
*
|
|
15
|
+
* Selectors below use stable hooks only: `data-testid`, role + name, and
|
|
16
|
+
* label-based queries. No CSS class selectors anywhere — the underlying
|
|
17
|
+
* Tailwind classes are not part of the public contract.
|
|
18
|
+
*
|
|
19
|
+
* The helpers assume the Edit Mentor dialog is already open. Call
|
|
20
|
+
* `switchToVoiceTab(page)` first; from then on every helper accepts either
|
|
21
|
+
* the `Page` or the dialog `Locator`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const VOICE_LABELS: {
|
|
24
|
+
readonly tabName: "Voice";
|
|
25
|
+
readonly headerTitle: "Voice";
|
|
26
|
+
readonly subTabs: {
|
|
27
|
+
readonly voice: "Voice";
|
|
28
|
+
readonly callConfig: "Voice call";
|
|
29
|
+
};
|
|
30
|
+
readonly providers: {
|
|
31
|
+
readonly browser: "Browser";
|
|
32
|
+
readonly openai: "OpenAI";
|
|
33
|
+
readonly google: "Google";
|
|
34
|
+
};
|
|
35
|
+
readonly voicePickerLabel: {
|
|
36
|
+
readonly openai: "OpenAI Voice";
|
|
37
|
+
readonly google: "Google Voice";
|
|
38
|
+
};
|
|
39
|
+
readonly saveVoiceButton: RegExp;
|
|
40
|
+
readonly callConfigSaveCreate: "Save";
|
|
41
|
+
readonly callConfigSaveUpdate: "Save changes";
|
|
42
|
+
readonly callConfigResetButton: "Reset";
|
|
43
|
+
readonly callConfigFields: {
|
|
44
|
+
readonly mode: "Call style";
|
|
45
|
+
readonly language: "Spoken language";
|
|
46
|
+
readonly llmProvider: "AI provider";
|
|
47
|
+
readonly ttsProvider: "Text-to-speech provider";
|
|
48
|
+
readonly sttProvider: "Speech-to-text provider";
|
|
49
|
+
readonly useFunctionCalling: "Look things up only when needed";
|
|
50
|
+
readonly enableVideo: "Allow screen sharing on a call";
|
|
51
|
+
};
|
|
52
|
+
readonly modeOptions: {
|
|
53
|
+
readonly realtime: "Live conversation";
|
|
54
|
+
readonly inference: "Step-by-step";
|
|
55
|
+
};
|
|
56
|
+
readonly ttsOptions: {
|
|
57
|
+
readonly openai: "OpenAI";
|
|
58
|
+
readonly google: "Google";
|
|
59
|
+
readonly elevenlabs: "ElevenLabs";
|
|
60
|
+
};
|
|
61
|
+
readonly llmOptions: {
|
|
62
|
+
readonly openai: "OpenAI";
|
|
63
|
+
readonly google: "Google";
|
|
64
|
+
readonly anthropic: "Anthropic";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export type VoiceProvider = keyof typeof VOICE_LABELS.providers;
|
|
68
|
+
export type CallMode = keyof typeof VOICE_LABELS.modeOptions;
|
|
69
|
+
export type TtsProvider = keyof typeof VOICE_LABELS.ttsOptions;
|
|
70
|
+
export type SttProvider = TtsProvider;
|
|
71
|
+
export type LlmProvider = keyof typeof VOICE_LABELS.llmOptions;
|
|
72
|
+
/**
|
|
73
|
+
* Check whether the Voice tab is currently rendered in the Edit Mentor
|
|
74
|
+
* dialog. Returns false instead of throwing so consumers can guard
|
|
75
|
+
* conditionally rendered tabs.
|
|
76
|
+
*/
|
|
77
|
+
export declare function isVoiceTabVisible(page: Page): Promise<boolean>;
|
|
78
|
+
/**
|
|
79
|
+
* Switch to the Voice tab. Assumes the Edit Mentor dialog is open.
|
|
80
|
+
*/
|
|
81
|
+
export declare function switchToVoiceTab(page: Page): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Switch between the Voice / Voice call sub-tabs.
|
|
84
|
+
*
|
|
85
|
+
* Note: "Screen share" used to live here as a third sub-tab but is now
|
|
86
|
+
* a peer top-level tab in the edit-mentor modal. Use the helpers in
|
|
87
|
+
* `screenshare-tab-helpers.ts` for it.
|
|
88
|
+
*/
|
|
89
|
+
export declare function switchToVoiceSubTab(scope: Page | Locator, sub: 'voice' | 'callConfig'): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Locator for one of the three provider cards on the "Voice" sub-tab.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getVoiceProviderCard(scope: Page | Locator, provider: VoiceProvider): Locator;
|
|
94
|
+
/**
|
|
95
|
+
* Click a provider card. The picker below changes shape based on the
|
|
96
|
+
* selection (Browser → no picker; OpenAI / Google → searchable voice list).
|
|
97
|
+
*/
|
|
98
|
+
export declare function selectVoiceProvider(scope: Page | Locator, provider: VoiceProvider): Promise<void>;
|
|
99
|
+
export declare function expectVoiceProviderSelected(scope: Page | Locator, provider: VoiceProvider): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Open the modal voice picker for the active mentor-voice provider
|
|
102
|
+
* (OpenAI or Google). The trigger renders the currently-picked voice on
|
|
103
|
+
* the Voice sub-tab; clicking its "open" button opens a Dialog with
|
|
104
|
+
* the searchable + paginated picker inside.
|
|
105
|
+
*
|
|
106
|
+
* The trigger root container exposes `data-testid="mentor-voice-trigger"`,
|
|
107
|
+
* and the open button (inside it) is `mentor-voice-trigger-open`. The
|
|
108
|
+
* inline play button is `mentor-voice-trigger-preview` — see
|
|
109
|
+
* `previewMentorVoiceInline`.
|
|
110
|
+
*/
|
|
111
|
+
export declare function openMentorVoicePicker(scope: Page | Locator): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Open the modal voice picker inside the Call Configuration sub-tab.
|
|
114
|
+
* Only present when an LLM provider has been chosen.
|
|
115
|
+
*/
|
|
116
|
+
export declare function openCallConfigVoicePicker(scope: Page | Locator): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Click the inline Play button on the mentor-voice trigger to preview
|
|
119
|
+
* the currently-selected voice without opening the modal. Audio
|
|
120
|
+
* playback isn't deterministically observable from Playwright, so this
|
|
121
|
+
* just clicks and returns.
|
|
122
|
+
*/
|
|
123
|
+
export declare function previewMentorVoiceInline(scope: Page | Locator): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* Same as `previewMentorVoiceInline`, but for the Call Configuration
|
|
126
|
+
* voice trigger.
|
|
127
|
+
*/
|
|
128
|
+
export declare function previewCallConfigVoiceInline(scope: Page | Locator): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Assert that the trigger shows the given voice name (title-cased).
|
|
131
|
+
* Useful for verifying that a previously-saved voice loads correctly.
|
|
132
|
+
*/
|
|
133
|
+
export declare function expectMentorVoiceTriggerShows(scope: Page | Locator, voiceName: string): Promise<void>;
|
|
134
|
+
export declare function expectCallConfigVoiceTriggerShows(scope: Page | Locator, voiceName: string): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* Search the voice picker. Typing is debounced ~300ms inside the
|
|
137
|
+
* component, so callers usually want to assert on the eventual results
|
|
138
|
+
* (see `expectVoiceVisible`). When the picker lives inside the modal,
|
|
139
|
+
* scope to the dialog: `searchVoices(page.getByTestId('voice-picker-modal'), 'al')`.
|
|
140
|
+
*
|
|
141
|
+
* Targets the input via `data-testid="voice-picker-search"` — a stable
|
|
142
|
+
* hook that doesn't depend on the (overridable) placeholder copy and
|
|
143
|
+
* avoids ReDoS-shaped placeholder regexes.
|
|
144
|
+
*/
|
|
145
|
+
export declare function searchVoices(scope: Page | Locator, query: string): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Locator for an individual voice row in the picker. Rows are
|
|
148
|
+
* `role="radio"` with `aria-label` matching the voice name.
|
|
149
|
+
*/
|
|
150
|
+
export declare function getVoiceRow(scope: Page | Locator, voiceName: string): Locator;
|
|
151
|
+
export declare function expectVoiceVisible(scope: Page | Locator, voiceName: string): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Click a voice row to select it. Returns once the row reports
|
|
154
|
+
* aria-checked=true.
|
|
155
|
+
*/
|
|
156
|
+
export declare function selectVoice(scope: Page | Locator, voiceName: string): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Click the inline preview button next to a voice. Returns immediately —
|
|
159
|
+
* audio playback is async and not deterministically observable from
|
|
160
|
+
* Playwright.
|
|
161
|
+
*/
|
|
162
|
+
export declare function previewVoice(scope: Page | Locator, voiceName: string): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Click the Save button on the Voice sub-tab. Asserts the button is
|
|
165
|
+
* enabled first (a no-op on a pristine form would be a test bug).
|
|
166
|
+
*/
|
|
167
|
+
export declare function saveVoiceSettings(scope: Page | Locator): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Locator for the call configuration form, useful as a scope root for
|
|
170
|
+
* subsequent helpers.
|
|
171
|
+
*/
|
|
172
|
+
export declare function getCallConfigForm(scope: Page | Locator): Locator;
|
|
173
|
+
export declare function expectCallConfigVisible(scope: Page | Locator): Promise<void>;
|
|
174
|
+
/**
|
|
175
|
+
* Pick a call mode (realtime/inference). The TTS/STT selects below become
|
|
176
|
+
* disabled in realtime mode — assert via `expectTtsSelectDisabled` if your
|
|
177
|
+
* test cares.
|
|
178
|
+
*/
|
|
179
|
+
export declare function selectCallMode(scope: Page | Locator, mode: CallMode): Promise<void>;
|
|
180
|
+
export declare function setCallLanguage(scope: Page | Locator, code: string): Promise<void>;
|
|
181
|
+
export declare function selectLlmProvider(scope: Page | Locator, provider: LlmProvider): Promise<void>;
|
|
182
|
+
export declare function selectTtsProvider(scope: Page | Locator, provider: TtsProvider): Promise<void>;
|
|
183
|
+
export declare function selectSttProvider(scope: Page | Locator, provider: SttProvider): Promise<void>;
|
|
184
|
+
export declare function expectTtsSelectDisabled(scope: Page | Locator): Promise<void>;
|
|
185
|
+
export declare function expectSttSelectDisabled(scope: Page | Locator): Promise<void>;
|
|
186
|
+
export declare function setUseFunctionCallingEnabled(scope: Page | Locator, enabled: boolean): Promise<void>;
|
|
187
|
+
export declare function setEnableVideo(scope: Page | Locator, enabled: boolean): Promise<void>;
|
|
188
|
+
/**
|
|
189
|
+
* Click the call-config Save button. The label switches between
|
|
190
|
+
* "Create configuration" and "Save changes" depending on whether a config
|
|
191
|
+
* exists; we match either.
|
|
192
|
+
*/
|
|
193
|
+
export declare function saveCallConfig(scope: Page | Locator): Promise<void>;
|
|
194
|
+
export declare function resetCallConfig(scope: Page | Locator): Promise<void>;
|
|
@@ -23,6 +23,10 @@ export { getCurrentTenantShowPaywall, creditBalanceTrigger, creditBalancePanel,
|
|
|
23
23
|
export type { CreditBalancePlan } from './credit-balance-helpers';
|
|
24
24
|
export { PRIVACY_LABELS, isPrivacyTabVisible, switchToPrivacyTab, getPrivacyRouterSwitch, setPrivacyRouterEnabled, expectPrivacyRouterEnabled, expectPrivacyFieldsHidden, expectPrivacyFieldsVisible, selectPrivacyAction, setBlockMessage, getEntityChip, setEntitySelected, expectEntitySelected, getOutputFilterSwitch, setOutputFilterEnabled, expectOutputFilterEnabled, } from './privacy-tab-helpers';
|
|
25
25
|
export type { PrivacyAction, PrivacyEntity } from './privacy-tab-helpers';
|
|
26
|
+
export { VOICE_LABELS, isVoiceTabVisible, switchToVoiceTab, switchToVoiceSubTab, getVoiceProviderCard, selectVoiceProvider, expectVoiceProviderSelected, openMentorVoicePicker, openCallConfigVoicePicker, previewMentorVoiceInline, previewCallConfigVoiceInline, expectMentorVoiceTriggerShows, expectCallConfigVoiceTriggerShows, searchVoices, getVoiceRow, expectVoiceVisible, selectVoice, previewVoice, saveVoiceSettings, getCallConfigForm, expectCallConfigVisible, selectCallMode, setCallLanguage, selectLlmProvider, selectTtsProvider, selectSttProvider, expectTtsSelectDisabled, expectSttSelectDisabled, setUseFunctionCallingEnabled, setEnableVideo, saveCallConfig, resetCallConfig, } from './voice-tab-helpers';
|
|
27
|
+
export type { VoiceProvider, CallMode, TtsProvider, SttProvider, LlmProvider, } from './voice-tab-helpers';
|
|
28
|
+
export { SCREENSHARE_LABELS, isScreenShareTabVisible, switchToScreenShareTab, openScreenSharePromptEditor, setScreenSharePrompt, saveScreenSharePrompts, expectScreenShareDisabledHint, } from './screenshare-tab-helpers';
|
|
29
|
+
export type { ScreenSharePromptField } from './screenshare-tab-helpers';
|
|
26
30
|
export { billingPlanSection, billingCreditsSection, billingAutoRechargeSection, getBillingPlanLabel, getBillingAutoRechargeStatus, waitForBillingTabReady, expectBillingPlanSection, expectBillingCreditsSection, expectBillingAutoRechargeSection, expectBillingTabForFreePlan, expectBillingTabForTrialPlan, expectBillingTabForPremiumPlan, expectBillingTabForCurrentPlan, clickBillingUpgrade, clickBillingAddCredits, clickBillingManageBilling, clickBillingManageUsage, } from './billing-tab-helpers';
|
|
27
31
|
export type { BillingAutoRechargeStatus } from './billing-tab-helpers';
|
|
28
32
|
export { TASKS_LABELS, isTasksTabVisible, switchToTasksTab, getScheduleTaskButton, getSearchInput, getTaskRow, expectTotalTasks, expectCompletedTasks, expectFailedTasks, expectTasksEmpty, expectTaskInList, expectTaskNotInList, selectTaskInList, expectTaskStatus, searchTasks, openScheduleTaskDialog, scheduleTask, expectScheduleStartTimeInPastError, deleteTask, expectLogsForTask, expectNoLogsForSelectedTask, openFirstLogDetails, expectLogDetailsStatus, } from './tasks-tab-helpers';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Screen share tab helpers — Playwright bindings for the standalone
|
|
4
|
+
* `AgentScreenShareTab` component from `@iblai/web-containers`.
|
|
5
|
+
*
|
|
6
|
+
* The tab is a peer to Voice/LLM/Tools/etc in the edit-mentor modal.
|
|
7
|
+
* It only edits the two screensharing prompts on the mentor's
|
|
8
|
+
* CallConfiguration; the on/off toggle lives on the Settings tab.
|
|
9
|
+
*
|
|
10
|
+
* Selectors below use stable hooks only: `data-testid`, role + name,
|
|
11
|
+
* and label-based queries. No CSS class selectors.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SCREENSHARE_LABELS: {
|
|
14
|
+
readonly tabName: "Screen Share";
|
|
15
|
+
readonly headerTitle: "Screen Share";
|
|
16
|
+
readonly fields: {
|
|
17
|
+
readonly systemPrompt: "Instructions during screen sharing";
|
|
18
|
+
readonly proactivePrompt: "What the agent says when screen sharing starts";
|
|
19
|
+
};
|
|
20
|
+
readonly saveButton: "Save";
|
|
21
|
+
};
|
|
22
|
+
export type ScreenSharePromptField = 'systemPrompt' | 'proactivePrompt';
|
|
23
|
+
/**
|
|
24
|
+
* Returns false if the Screen share tab isn't currently rendered in
|
|
25
|
+
* the Edit Mentor dialog (e.g. the host hasn't registered it, or it's
|
|
26
|
+
* hidden by RBAC).
|
|
27
|
+
*/
|
|
28
|
+
export declare function isScreenShareTabVisible(page: Page): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* Switch to the Screen share top-level tab. Assumes the Edit Mentor
|
|
31
|
+
* dialog is open.
|
|
32
|
+
*/
|
|
33
|
+
export declare function switchToScreenShareTab(page: Page): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Open the inline prompt editor for one of the two screensharing
|
|
36
|
+
* prompts. Mirrors the Prompts tab pattern: each prompt is rendered as
|
|
37
|
+
* a card with an "Edit <label>" button that pops the rich-text modal.
|
|
38
|
+
*/
|
|
39
|
+
export declare function openScreenSharePromptEditor(scope: Page | Locator, field: ScreenSharePromptField): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Replace the prompt text inside the rich-text modal and confirm. The
|
|
42
|
+
* new value is written to local form state; call `saveScreenSharePrompts`
|
|
43
|
+
* afterwards to persist.
|
|
44
|
+
*/
|
|
45
|
+
export declare function setScreenSharePrompt(scope: Page | Locator, field: ScreenSharePromptField, text: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Click the tab's Save button to persist any pending prompt edits.
|
|
48
|
+
* Asserts the button is enabled first — a no-op call on a pristine
|
|
49
|
+
* tab would be a test bug.
|
|
50
|
+
*/
|
|
51
|
+
export declare function saveScreenSharePrompts(scope: Page | Locator): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Assert whether the amber off-state hint is shown. The hint renders
|
|
54
|
+
* when `enable_video` is false on the underlying CallConfiguration
|
|
55
|
+
* (or when no call_configuration exists yet).
|
|
56
|
+
*/
|
|
57
|
+
export declare function expectScreenShareDisabledHint(scope: Page | Locator, visible: boolean): Promise<void>;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Voice tab helpers — Playwright bindings for the `AgentVoiceTab` component
|
|
4
|
+
* from `@iblai/web-containers`.
|
|
5
|
+
*
|
|
6
|
+
* The Voice tab contains two sub-tabs:
|
|
7
|
+
* 1. "Voice" — provider + voice-picker, persisted via mentor settings
|
|
8
|
+
* 2. "Call Configuration" — TTS / STT / LLM / video stack, persisted via the
|
|
9
|
+
* `/call-configurations/` endpoint
|
|
10
|
+
*
|
|
11
|
+
* All UI strings mirror `AGENT_VOICE_TAB_LABELS` from
|
|
12
|
+
* `@iblai/web-containers/next`. If a consumer renames a label via the
|
|
13
|
+
* `labels` prop, override these constants per spec — don't edit this file.
|
|
14
|
+
*
|
|
15
|
+
* Selectors below use stable hooks only: `data-testid`, role + name, and
|
|
16
|
+
* label-based queries. No CSS class selectors anywhere — the underlying
|
|
17
|
+
* Tailwind classes are not part of the public contract.
|
|
18
|
+
*
|
|
19
|
+
* The helpers assume the Edit Mentor dialog is already open. Call
|
|
20
|
+
* `switchToVoiceTab(page)` first; from then on every helper accepts either
|
|
21
|
+
* the `Page` or the dialog `Locator`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const VOICE_LABELS: {
|
|
24
|
+
readonly tabName: "Voice";
|
|
25
|
+
readonly headerTitle: "Voice";
|
|
26
|
+
readonly subTabs: {
|
|
27
|
+
readonly voice: "Voice";
|
|
28
|
+
readonly callConfig: "Voice call";
|
|
29
|
+
};
|
|
30
|
+
readonly providers: {
|
|
31
|
+
readonly browser: "Browser";
|
|
32
|
+
readonly openai: "OpenAI";
|
|
33
|
+
readonly google: "Google";
|
|
34
|
+
};
|
|
35
|
+
readonly voicePickerLabel: {
|
|
36
|
+
readonly openai: "OpenAI Voice";
|
|
37
|
+
readonly google: "Google Voice";
|
|
38
|
+
};
|
|
39
|
+
readonly saveVoiceButton: RegExp;
|
|
40
|
+
readonly callConfigSaveCreate: "Save";
|
|
41
|
+
readonly callConfigSaveUpdate: "Save changes";
|
|
42
|
+
readonly callConfigResetButton: "Reset";
|
|
43
|
+
readonly callConfigFields: {
|
|
44
|
+
readonly mode: "Call style";
|
|
45
|
+
readonly language: "Spoken language";
|
|
46
|
+
readonly llmProvider: "AI provider";
|
|
47
|
+
readonly ttsProvider: "Text-to-speech provider";
|
|
48
|
+
readonly sttProvider: "Speech-to-text provider";
|
|
49
|
+
readonly useFunctionCalling: "Look things up only when needed";
|
|
50
|
+
readonly enableVideo: "Allow screen sharing on a call";
|
|
51
|
+
};
|
|
52
|
+
readonly modeOptions: {
|
|
53
|
+
readonly realtime: "Live conversation";
|
|
54
|
+
readonly inference: "Step-by-step";
|
|
55
|
+
};
|
|
56
|
+
readonly ttsOptions: {
|
|
57
|
+
readonly openai: "OpenAI";
|
|
58
|
+
readonly google: "Google";
|
|
59
|
+
readonly elevenlabs: "ElevenLabs";
|
|
60
|
+
};
|
|
61
|
+
readonly llmOptions: {
|
|
62
|
+
readonly openai: "OpenAI";
|
|
63
|
+
readonly google: "Google";
|
|
64
|
+
readonly anthropic: "Anthropic";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export type VoiceProvider = keyof typeof VOICE_LABELS.providers;
|
|
68
|
+
export type CallMode = keyof typeof VOICE_LABELS.modeOptions;
|
|
69
|
+
export type TtsProvider = keyof typeof VOICE_LABELS.ttsOptions;
|
|
70
|
+
export type SttProvider = TtsProvider;
|
|
71
|
+
export type LlmProvider = keyof typeof VOICE_LABELS.llmOptions;
|
|
72
|
+
/**
|
|
73
|
+
* Check whether the Voice tab is currently rendered in the Edit Mentor
|
|
74
|
+
* dialog. Returns false instead of throwing so consumers can guard
|
|
75
|
+
* conditionally rendered tabs.
|
|
76
|
+
*/
|
|
77
|
+
export declare function isVoiceTabVisible(page: Page): Promise<boolean>;
|
|
78
|
+
/**
|
|
79
|
+
* Switch to the Voice tab. Assumes the Edit Mentor dialog is open.
|
|
80
|
+
*/
|
|
81
|
+
export declare function switchToVoiceTab(page: Page): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Switch between the Voice / Voice call sub-tabs.
|
|
84
|
+
*
|
|
85
|
+
* Note: "Screen share" used to live here as a third sub-tab but is now
|
|
86
|
+
* a peer top-level tab in the edit-mentor modal. Use the helpers in
|
|
87
|
+
* `screenshare-tab-helpers.ts` for it.
|
|
88
|
+
*/
|
|
89
|
+
export declare function switchToVoiceSubTab(scope: Page | Locator, sub: 'voice' | 'callConfig'): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Locator for one of the three provider cards on the "Voice" sub-tab.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getVoiceProviderCard(scope: Page | Locator, provider: VoiceProvider): Locator;
|
|
94
|
+
/**
|
|
95
|
+
* Click a provider card. The picker below changes shape based on the
|
|
96
|
+
* selection (Browser → no picker; OpenAI / Google → searchable voice list).
|
|
97
|
+
*/
|
|
98
|
+
export declare function selectVoiceProvider(scope: Page | Locator, provider: VoiceProvider): Promise<void>;
|
|
99
|
+
export declare function expectVoiceProviderSelected(scope: Page | Locator, provider: VoiceProvider): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Open the modal voice picker for the active mentor-voice provider
|
|
102
|
+
* (OpenAI or Google). The trigger renders the currently-picked voice on
|
|
103
|
+
* the Voice sub-tab; clicking its "open" button opens a Dialog with
|
|
104
|
+
* the searchable + paginated picker inside.
|
|
105
|
+
*
|
|
106
|
+
* The trigger root container exposes `data-testid="mentor-voice-trigger"`,
|
|
107
|
+
* and the open button (inside it) is `mentor-voice-trigger-open`. The
|
|
108
|
+
* inline play button is `mentor-voice-trigger-preview` — see
|
|
109
|
+
* `previewMentorVoiceInline`.
|
|
110
|
+
*/
|
|
111
|
+
export declare function openMentorVoicePicker(scope: Page | Locator): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Open the modal voice picker inside the Call Configuration sub-tab.
|
|
114
|
+
* Only present when an LLM provider has been chosen.
|
|
115
|
+
*/
|
|
116
|
+
export declare function openCallConfigVoicePicker(scope: Page | Locator): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Click the inline Play button on the mentor-voice trigger to preview
|
|
119
|
+
* the currently-selected voice without opening the modal. Audio
|
|
120
|
+
* playback isn't deterministically observable from Playwright, so this
|
|
121
|
+
* just clicks and returns.
|
|
122
|
+
*/
|
|
123
|
+
export declare function previewMentorVoiceInline(scope: Page | Locator): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* Same as `previewMentorVoiceInline`, but for the Call Configuration
|
|
126
|
+
* voice trigger.
|
|
127
|
+
*/
|
|
128
|
+
export declare function previewCallConfigVoiceInline(scope: Page | Locator): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Assert that the trigger shows the given voice name (title-cased).
|
|
131
|
+
* Useful for verifying that a previously-saved voice loads correctly.
|
|
132
|
+
*/
|
|
133
|
+
export declare function expectMentorVoiceTriggerShows(scope: Page | Locator, voiceName: string): Promise<void>;
|
|
134
|
+
export declare function expectCallConfigVoiceTriggerShows(scope: Page | Locator, voiceName: string): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* Search the voice picker. Typing is debounced ~300ms inside the
|
|
137
|
+
* component, so callers usually want to assert on the eventual results
|
|
138
|
+
* (see `expectVoiceVisible`). When the picker lives inside the modal,
|
|
139
|
+
* scope to the dialog: `searchVoices(page.getByTestId('voice-picker-modal'), 'al')`.
|
|
140
|
+
*
|
|
141
|
+
* Targets the input via `data-testid="voice-picker-search"` — a stable
|
|
142
|
+
* hook that doesn't depend on the (overridable) placeholder copy and
|
|
143
|
+
* avoids ReDoS-shaped placeholder regexes.
|
|
144
|
+
*/
|
|
145
|
+
export declare function searchVoices(scope: Page | Locator, query: string): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Locator for an individual voice row in the picker. Rows are
|
|
148
|
+
* `role="radio"` with `aria-label` matching the voice name.
|
|
149
|
+
*/
|
|
150
|
+
export declare function getVoiceRow(scope: Page | Locator, voiceName: string): Locator;
|
|
151
|
+
export declare function expectVoiceVisible(scope: Page | Locator, voiceName: string): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Click a voice row to select it. Returns once the row reports
|
|
154
|
+
* aria-checked=true.
|
|
155
|
+
*/
|
|
156
|
+
export declare function selectVoice(scope: Page | Locator, voiceName: string): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Click the inline preview button next to a voice. Returns immediately —
|
|
159
|
+
* audio playback is async and not deterministically observable from
|
|
160
|
+
* Playwright.
|
|
161
|
+
*/
|
|
162
|
+
export declare function previewVoice(scope: Page | Locator, voiceName: string): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Click the Save button on the Voice sub-tab. Asserts the button is
|
|
165
|
+
* enabled first (a no-op on a pristine form would be a test bug).
|
|
166
|
+
*/
|
|
167
|
+
export declare function saveVoiceSettings(scope: Page | Locator): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Locator for the call configuration form, useful as a scope root for
|
|
170
|
+
* subsequent helpers.
|
|
171
|
+
*/
|
|
172
|
+
export declare function getCallConfigForm(scope: Page | Locator): Locator;
|
|
173
|
+
export declare function expectCallConfigVisible(scope: Page | Locator): Promise<void>;
|
|
174
|
+
/**
|
|
175
|
+
* Pick a call mode (realtime/inference). The TTS/STT selects below become
|
|
176
|
+
* disabled in realtime mode — assert via `expectTtsSelectDisabled` if your
|
|
177
|
+
* test cares.
|
|
178
|
+
*/
|
|
179
|
+
export declare function selectCallMode(scope: Page | Locator, mode: CallMode): Promise<void>;
|
|
180
|
+
export declare function setCallLanguage(scope: Page | Locator, code: string): Promise<void>;
|
|
181
|
+
export declare function selectLlmProvider(scope: Page | Locator, provider: LlmProvider): Promise<void>;
|
|
182
|
+
export declare function selectTtsProvider(scope: Page | Locator, provider: TtsProvider): Promise<void>;
|
|
183
|
+
export declare function selectSttProvider(scope: Page | Locator, provider: SttProvider): Promise<void>;
|
|
184
|
+
export declare function expectTtsSelectDisabled(scope: Page | Locator): Promise<void>;
|
|
185
|
+
export declare function expectSttSelectDisabled(scope: Page | Locator): Promise<void>;
|
|
186
|
+
export declare function setUseFunctionCallingEnabled(scope: Page | Locator, enabled: boolean): Promise<void>;
|
|
187
|
+
export declare function setEnableVideo(scope: Page | Locator, enabled: boolean): Promise<void>;
|
|
188
|
+
/**
|
|
189
|
+
* Click the call-config Save button. The label switches between
|
|
190
|
+
* "Create configuration" and "Save changes" depending on whether a config
|
|
191
|
+
* exists; we match either.
|
|
192
|
+
*/
|
|
193
|
+
export declare function saveCallConfig(scope: Page | Locator): Promise<void>;
|
|
194
|
+
export declare function resetCallConfig(scope: Page | Locator): Promise<void>;
|