@iblai/iblai-js 1.26.8 → 1.26.10
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/security/index.d.ts +1 -0
- package/dist/data-layer/security/next.d.ts +1 -0
- package/dist/playwright/security/index.d.ts +1 -0
- package/dist/playwright/security/next.d.ts +1 -0
- package/dist/security/data-layer/index.d.ts +1 -0
- package/dist/security/index.d.ts +1 -0
- package/dist/security/index.esm.js +2 -0
- package/dist/security/index.esm.js.map +1 -0
- package/dist/security/index.js +13 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/next.d.ts +1 -0
- package/dist/security/next.esm.js +2 -0
- package/dist/security/next.esm.js.map +1 -0
- package/dist/security/next.js +13 -0
- package/dist/security/next.js.map +1 -0
- package/dist/security/playwright/audit-log-helpers.d.ts +119 -0
- package/dist/security/playwright/auth-flow-builder.d.ts +13 -0
- package/dist/security/playwright/auth-helpers.d.ts +10 -0
- package/dist/security/playwright/auth-setup.d.ts +34 -0
- package/dist/security/playwright/billing-tab-helpers.d.ts +88 -0
- package/dist/security/playwright/chat-privacy-helpers.d.ts +127 -0
- package/dist/security/playwright/claw-sandbox-helpers.d.ts +266 -0
- package/dist/security/playwright/credit-balance-helpers.d.ts +73 -0
- package/dist/security/playwright/custom-reporter.d.ts +12 -0
- package/dist/security/playwright/env-config.d.ts +24 -0
- package/dist/security/playwright/evaluation-tab-helpers.d.ts +396 -0
- package/dist/security/playwright/helpers.d.ts +11 -0
- package/dist/security/playwright/index.d.ts +39 -0
- package/dist/security/playwright/logger.d.ts +3 -0
- package/dist/security/playwright/lti-tab-helpers.d.ts +270 -0
- package/dist/security/playwright/mail-client.d.ts +46 -0
- package/dist/security/playwright/memory-test-helpers.d.ts +66 -0
- package/dist/security/playwright/navigation.d.ts +26 -0
- package/dist/security/playwright/page-helpers.d.ts +38 -0
- package/dist/security/playwright/playwright-config.d.ts +81 -0
- package/dist/security/playwright/privacy-tab-helpers.d.ts +95 -0
- package/dist/security/playwright/report-download.d.ts +71 -0
- package/dist/security/playwright/screenshare-tab-helpers.d.ts +57 -0
- package/dist/security/playwright/shared-test-helpers.d.ts +37 -0
- package/dist/security/playwright/tasks-tab-helpers.d.ts +177 -0
- package/dist/security/playwright/voice-tab-helpers.d.ts +194 -0
- package/dist/security/security/index.d.ts +1 -0
- package/dist/security/security/next.d.ts +1 -0
- package/dist/security/web-containers/index.d.ts +1 -0
- package/dist/security/web-containers/next.d.ts +1 -0
- package/dist/security/web-containers/sso.d.ts +1 -0
- package/dist/security/web-utils/auth.d.ts +1 -0
- package/dist/security/web-utils/index.d.ts +1 -0
- package/dist/web-containers/security/index.d.ts +1 -0
- package/dist/web-containers/security/next.d.ts +1 -0
- package/dist/web-containers/source/index.esm.js +10 -8
- package/dist/web-containers/source/next/index.esm.js +10 -8
- package/dist/web-utils/security/index.d.ts +1 -0
- package/dist/web-utils/security/next.d.ts +1 -0
- package/package.json +14 -4
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Page } from '@playwright/test';
|
|
2
|
+
export interface ReportDownloadOptions {
|
|
3
|
+
/** Base URL of the SPA (e.g. https://mentor.ibl.ai) */
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
/** Platform key extracted from or expected in the URL */
|
|
6
|
+
platformKey: string;
|
|
7
|
+
/** Report name extracted from or expected in the URL */
|
|
8
|
+
reportName: string;
|
|
9
|
+
/** Timeout for waiting on phase transitions (default: 60000ms) */
|
|
10
|
+
timeout?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Build the expected report download page URL.
|
|
14
|
+
* Format: <baseUrl>/reports/<platformKey>/<reportName>
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildReportUrl(baseUrl: string, platformKey: string, reportName: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Parse platform_key and report_name from the current page URL.
|
|
19
|
+
* Expected format: .../reports/<platform_key>/<report_name>
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseReportUrlParams(url: string): {
|
|
22
|
+
platformKey: string;
|
|
23
|
+
reportName: string;
|
|
24
|
+
} | null;
|
|
25
|
+
/**
|
|
26
|
+
* Navigate to the report download page and verify the URL matches the expected format.
|
|
27
|
+
*/
|
|
28
|
+
export declare function navigateToReportDownload(page: Page, options: ReportDownloadOptions): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Verify the report download page is showing the "Preparing" phase.
|
|
31
|
+
*/
|
|
32
|
+
export declare function verifyPreparingPhase(page: Page, options?: {
|
|
33
|
+
timeout?: number;
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Wait for and verify the report transitions to the "downloading" phase.
|
|
37
|
+
*/
|
|
38
|
+
export declare function verifyDownloadingPhase(page: Page, options?: {
|
|
39
|
+
timeout?: number;
|
|
40
|
+
}): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Wait for and verify the report transitions to the "done" phase.
|
|
43
|
+
*/
|
|
44
|
+
export declare function verifyDonePhase(page: Page, options?: {
|
|
45
|
+
timeout?: number;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Wait for and verify the report transitions to the "error" phase.
|
|
49
|
+
*/
|
|
50
|
+
export declare function verifyErrorPhase(page: Page, options?: {
|
|
51
|
+
timeout?: number;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Verify the "Back Home" button is visible and click it.
|
|
55
|
+
*/
|
|
56
|
+
export declare function clickBackHome(page: Page): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Click the "Download Again" button (only visible in done phase).
|
|
59
|
+
* Skips silently if the button is not visible.
|
|
60
|
+
*/
|
|
61
|
+
export declare function clickDownloadAgain(page: Page): Promise<boolean>;
|
|
62
|
+
/**
|
|
63
|
+
* Click the manual download link (only visible in downloading phase).
|
|
64
|
+
*/
|
|
65
|
+
export declare function clickManualDownloadLink(page: Page): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Full flow: navigate to report download page and wait for download to complete.
|
|
68
|
+
* Falls back to verifying the error phase if the download does not succeed.
|
|
69
|
+
* Returns the resulting phase: 'done' or 'error'.
|
|
70
|
+
*/
|
|
71
|
+
export declare function waitForReportDownload(page: Page, options: ReportDownloadOptions): Promise<'done' | 'error'>;
|
|
@@ -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,37 @@
|
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
|
+
export declare function inviteUserTest(page: Page, inviteModal: Locator): Promise<void>;
|
|
3
|
+
export declare function navigateToAccountComponent(page: Page, profileBtn: Locator): Promise<Locator>;
|
|
4
|
+
/**
|
|
5
|
+
* Click a report card's primary action and confirm the date-range picker, so callers
|
|
6
|
+
* always end up in the post-generation state.
|
|
7
|
+
*
|
|
8
|
+
* Prefers the "Regenerate report" button when present (completed reports) because the plain
|
|
9
|
+
* "Download report" button on a completed card re-downloads the existing URL and skips the
|
|
10
|
+
* picker. When no Regenerate button exists, clicks "Download report" — which on a
|
|
11
|
+
* non-completed card also opens the picker.
|
|
12
|
+
*
|
|
13
|
+
* Either way we wait for the picker and click Generate/Regenerate to start the report.
|
|
14
|
+
*/
|
|
15
|
+
export declare function triggerReportFromCard(page: Page, card: Locator): Promise<void>;
|
|
16
|
+
export declare function navigateToDataReports(page: Page): Promise<void>;
|
|
17
|
+
export declare function shouldDisplayReportCards(page: Page, REPORT_CARDS: {
|
|
18
|
+
name: string;
|
|
19
|
+
ariaLabel: string;
|
|
20
|
+
description: string;
|
|
21
|
+
expectsCsvEditor: boolean;
|
|
22
|
+
}[]): Promise<void>;
|
|
23
|
+
export declare function shouldOpenCSVEditorDialog(page: Page): Promise<void>;
|
|
24
|
+
export declare function shouldDisplayCSVInEditableTableFormat(page: Page): Promise<void>;
|
|
25
|
+
export declare function shouldAllowEditingCellValuesInCSVEditor(page: Page): Promise<void>;
|
|
26
|
+
export declare function shouldAddNewRowWhenClickingAddRowButton(page: Page): Promise<void>;
|
|
27
|
+
export declare function shouldSaveEditedCSVAndTriggerDownload(page: Page): Promise<void>;
|
|
28
|
+
export declare function shouldCloseCSVEditorWithoutSavingWhenClickingCancel(page: Page): Promise<void>;
|
|
29
|
+
export declare function shouldCloseCSVEditorWhenClickingCloseButton(page: Page): Promise<void>;
|
|
30
|
+
export declare function shouldVerifyCSVEditorDialogAccessibility(page: Page): Promise<void>;
|
|
31
|
+
export declare function shouldOpenCSVEditorForUserMetadataReport(page: Page): Promise<void>;
|
|
32
|
+
export declare function shouldDirectlyDownloadChatHistoryReportWithoutCSVEditor(page: Page): Promise<void>;
|
|
33
|
+
export declare function shouldDisableOtherDownloadButtonsWhileGeneratingReport(page: Page): Promise<void>;
|
|
34
|
+
export declare function shouldShowCombiningReportsDialog(page: Page): Promise<void>;
|
|
35
|
+
export declare function shouldCancelCombiningReports(page: Page): Promise<void>;
|
|
36
|
+
export declare function shouldHaveCombinedReportDataTestIds(page: Page): Promise<void>;
|
|
37
|
+
export declare function shouldCombineRecommendationReports(page: Page): Promise<void>;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Tasks tab helpers — Playwright bindings for the `AgentTasksTab`
|
|
4
|
+
* component from `@iblai/web-containers`.
|
|
5
|
+
*
|
|
6
|
+
* All UI strings below mirror `AGENT_TASKS_TAB_LABELS` from
|
|
7
|
+
* `@iblai/web-containers/next`. If a consumer renames a label via the
|
|
8
|
+
* `labels` prop, override these constants per spec — don't edit this file.
|
|
9
|
+
*
|
|
10
|
+
* The helpers assume the Edit Mentor dialog is already open. Call
|
|
11
|
+
* `switchToTasksTab(page)` first; from then on, every helper accepts
|
|
12
|
+
* either the `Page` or the dialog `Locator`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const TASKS_LABELS: {
|
|
15
|
+
readonly tabName: "Tasks";
|
|
16
|
+
readonly headerTitle: "Tasks";
|
|
17
|
+
readonly headerDescription: "Configure automated tasks for your mentor.";
|
|
18
|
+
readonly toolbar: {
|
|
19
|
+
readonly searchPlaceholder: "Search all tasks...";
|
|
20
|
+
readonly selectDate: "Select date";
|
|
21
|
+
readonly scheduleTask: "Schedule Task";
|
|
22
|
+
};
|
|
23
|
+
readonly metrics: {
|
|
24
|
+
readonly total: "Total Tasks";
|
|
25
|
+
readonly completed: "Completed";
|
|
26
|
+
readonly failed: "Failed";
|
|
27
|
+
};
|
|
28
|
+
/** Status badges displayed on each task row. */
|
|
29
|
+
readonly status: {
|
|
30
|
+
readonly completed: "Completed";
|
|
31
|
+
readonly failed: "Failed";
|
|
32
|
+
readonly running: "Running";
|
|
33
|
+
readonly scheduled: "Scheduled";
|
|
34
|
+
readonly disabled: "Disabled";
|
|
35
|
+
};
|
|
36
|
+
readonly list: {
|
|
37
|
+
readonly selectHint: "Select a task to view its run logs.";
|
|
38
|
+
readonly repeatOnce: "Once";
|
|
39
|
+
readonly deleteTask: "Delete task";
|
|
40
|
+
};
|
|
41
|
+
readonly logs: {
|
|
42
|
+
readonly title: "Task Logs";
|
|
43
|
+
readonly selectPrompt: "Select a task on the left to view its run logs.";
|
|
44
|
+
readonly noLogs: "No run logs for this task yet.";
|
|
45
|
+
readonly loading: "Loading logs...";
|
|
46
|
+
readonly forTask: "Logs for";
|
|
47
|
+
};
|
|
48
|
+
readonly states: {
|
|
49
|
+
readonly loading: "Loading tasks...";
|
|
50
|
+
readonly empty: "No tasks scheduled.";
|
|
51
|
+
};
|
|
52
|
+
readonly scheduleDialog: {
|
|
53
|
+
/** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
|
|
54
|
+
readonly dialogName: "schedule-task";
|
|
55
|
+
readonly taskName: "Task Name";
|
|
56
|
+
readonly taskNamePlaceholder: "Enter task name";
|
|
57
|
+
readonly taskPrompt: "Task Prompt";
|
|
58
|
+
readonly taskPromptPlaceholder: "Enter task prompt";
|
|
59
|
+
readonly time: "Time";
|
|
60
|
+
readonly repeat: "Repeat";
|
|
61
|
+
readonly notifyByEmail: "Notify me by email";
|
|
62
|
+
readonly schedule: "Schedule Task";
|
|
63
|
+
readonly scheduling: "Scheduling...";
|
|
64
|
+
readonly cancel: "Cancel";
|
|
65
|
+
readonly dontRepeat: "Don't repeat";
|
|
66
|
+
readonly daily: "Daily";
|
|
67
|
+
readonly weekly: "Weekly";
|
|
68
|
+
readonly monthly: "Monthly";
|
|
69
|
+
readonly startTimeInPast: "Start time must be in the future.";
|
|
70
|
+
};
|
|
71
|
+
readonly deleteDialog: {
|
|
72
|
+
/** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
|
|
73
|
+
readonly dialogName: "delete-task";
|
|
74
|
+
readonly title: "Delete Task";
|
|
75
|
+
readonly delete: "Delete Task";
|
|
76
|
+
readonly deleting: "Deleting...";
|
|
77
|
+
readonly cancel: "Cancel";
|
|
78
|
+
};
|
|
79
|
+
readonly logDetails: {
|
|
80
|
+
/** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
|
|
81
|
+
readonly dialogName: "log-details";
|
|
82
|
+
readonly title: "Log Details";
|
|
83
|
+
readonly status: "Status";
|
|
84
|
+
readonly createdAt: "Created";
|
|
85
|
+
readonly startTime: "Started";
|
|
86
|
+
readonly endTime: "Ended";
|
|
87
|
+
readonly output: "Output";
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/** The four repeat cadences accepted by `scheduleTask`. */
|
|
91
|
+
export type TaskRepeat = "don't-repeat" | 'daily' | 'weekly' | 'monthly';
|
|
92
|
+
/** Possible status badges on a task row. */
|
|
93
|
+
export type TaskStatus = keyof typeof TASKS_LABELS.status;
|
|
94
|
+
/**
|
|
95
|
+
* Check whether the Tasks tab is currently rendered in the Edit Mentor
|
|
96
|
+
* dialog. Returns false instead of throwing so callers can guard
|
|
97
|
+
* conditionally rendered tabs (e.g. permission-gated).
|
|
98
|
+
*/
|
|
99
|
+
export declare function isTasksTabVisible(page: Page): Promise<boolean>;
|
|
100
|
+
/**
|
|
101
|
+
* Switch to the Tasks tab. Assumes the Edit Mentor dialog is open. After
|
|
102
|
+
* the click we wait for the unique "Schedule Task" button before
|
|
103
|
+
* returning, so callers can rely on the panel being interactive.
|
|
104
|
+
*/
|
|
105
|
+
export declare function switchToTasksTab(page: Page): Promise<void>;
|
|
106
|
+
/** Locator for the "Schedule Task" toolbar button (opens the dialog). */
|
|
107
|
+
export declare function getScheduleTaskButton(scope: Page | Locator): Locator;
|
|
108
|
+
/** Locator for the task list's search input. */
|
|
109
|
+
export declare function getSearchInput(scope: Page | Locator): Locator;
|
|
110
|
+
/**
|
|
111
|
+
* Locator for a task row by its title. We scope to the click-target
|
|
112
|
+
* `role="button"` rendered by `TaskList` so callers can `.click()` to
|
|
113
|
+
* select, or chain `.getByRole('button', { name: 'Delete task' })` to
|
|
114
|
+
* delete.
|
|
115
|
+
*/
|
|
116
|
+
export declare function getTaskRow(scope: Page | Locator, taskName: string): Locator;
|
|
117
|
+
export declare function expectTotalTasks(scope: Page | Locator, n: number): Promise<void>;
|
|
118
|
+
export declare function expectCompletedTasks(scope: Page | Locator, n: number): Promise<void>;
|
|
119
|
+
export declare function expectFailedTasks(scope: Page | Locator, n: number): Promise<void>;
|
|
120
|
+
export declare function expectTasksEmpty(scope: Page | Locator): Promise<void>;
|
|
121
|
+
export declare function expectTaskInList(scope: Page | Locator, taskName: string): Promise<void>;
|
|
122
|
+
export declare function expectTaskNotInList(scope: Page | Locator, taskName: string): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Click a task row to select it. Marks the row's `aria-pressed=true` and
|
|
125
|
+
* the logs panel rebinds to that task.
|
|
126
|
+
*/
|
|
127
|
+
export declare function selectTaskInList(scope: Page | Locator, taskName: string): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Assert that a given task's status badge matches the expected status.
|
|
130
|
+
*/
|
|
131
|
+
export declare function expectTaskStatus(scope: Page | Locator, taskName: string, status: TaskStatus): Promise<void>;
|
|
132
|
+
/** Type into the search input. Returns once the input value matches. */
|
|
133
|
+
export declare function searchTasks(scope: Page | Locator, query: string): Promise<void>;
|
|
134
|
+
/**
|
|
135
|
+
* Locator for the Schedule Task dialog itself. Scoping in-dialog queries to
|
|
136
|
+
* this avoids clashing with the toolbar's "Schedule Task" button, which
|
|
137
|
+
* shares an accessible name with the dialog's submit button.
|
|
138
|
+
*/
|
|
139
|
+
export declare function getScheduleTaskDialog(scope: Page | Locator): Locator;
|
|
140
|
+
/** Open the Schedule Task dialog and wait for it to be interactive. */
|
|
141
|
+
export declare function openScheduleTaskDialog(scope: Page | Locator): Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* End-to-end: open the dialog, fill the form, click Schedule, and wait
|
|
144
|
+
* for it to close.
|
|
145
|
+
*
|
|
146
|
+
* `time` is an HTML `<input type="time">` string ("HH:mm", 24-hour). If
|
|
147
|
+
* the chosen date is today and the chosen time is in the past, the
|
|
148
|
+
* dialog will block submission — choose accordingly.
|
|
149
|
+
*/
|
|
150
|
+
export declare function scheduleTask(scope: Page | Locator, opts: {
|
|
151
|
+
name: string;
|
|
152
|
+
prompt?: string;
|
|
153
|
+
time: string;
|
|
154
|
+
repeat?: TaskRepeat;
|
|
155
|
+
notifyByEmail?: boolean;
|
|
156
|
+
}): Promise<void>;
|
|
157
|
+
/** Asserts the in-dialog past-time error is currently shown. */
|
|
158
|
+
export declare function expectScheduleStartTimeInPastError(scope: Page | Locator): Promise<void>;
|
|
159
|
+
export declare function getDeleteTaskDialog(scope: Page | Locator): Locator;
|
|
160
|
+
/**
|
|
161
|
+
* Click the trash icon on a task row and confirm the delete in the
|
|
162
|
+
* follow-up dialog.
|
|
163
|
+
*/
|
|
164
|
+
export declare function deleteTask(scope: Page | Locator, taskName: string): Promise<void>;
|
|
165
|
+
export declare function getLogDetailsDialog(scope: Page | Locator): Locator;
|
|
166
|
+
/**
|
|
167
|
+
* Wait for the logs panel to finish loading and assert that the selected
|
|
168
|
+
* task name is shown in the header.
|
|
169
|
+
*/
|
|
170
|
+
export declare function expectLogsForTask(scope: Page | Locator, taskName: string): Promise<void>;
|
|
171
|
+
export declare function expectNoLogsForSelectedTask(scope: Page | Locator): Promise<void>;
|
|
172
|
+
/**
|
|
173
|
+
* Click the first log entry under the selected task to open the log
|
|
174
|
+
* details modal. Returns once the dialog title is visible.
|
|
175
|
+
*/
|
|
176
|
+
export declare function openFirstLogDetails(scope: Page | Locator): Promise<void>;
|
|
177
|
+
export declare function expectLogDetailsStatus(scope: Page | Locator, status: 'success' | 'error' | 'running' | string): 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>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@iblai/web-utils/security';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@iblai/web-utils/security/next';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@iblai/web-containers';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@iblai/web-containers/next';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@iblai/web-containers/sso';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@iblai/web-utils/auth';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@iblai/web-utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@iblai/web-utils/security';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@iblai/web-utils/security/next';
|