@iblai/iblai-js 2.5.8 → 2.5.9

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.
@@ -0,0 +1,148 @@
1
+ import { Locator, Page } from '@playwright/test';
2
+ /**
3
+ * Profile History tab Playwright bindings (user profile modal > History).
4
+ *
5
+ * The tab has two sub-tabs:
6
+ * 1. **Conversations** — filter row (agent autocomplete, date range,
7
+ * sentiment, topic, Export), a two-column conversation list + transcript
8
+ * preview, and numbered pagination.
9
+ * 2. **Exports** — a table of previously generated `my-chat-history`
10
+ * reports with state badges and re-download actions.
11
+ *
12
+ * Anti-flake rules baked into every helper:
13
+ * - The profile dialog is captured ONCE via `getProfileDialog` — a
14
+ * `getByRole('dialog')` + `.filter(...)` pair — and every sub-element is
15
+ * resolved from that scoped locator. Page-level queries are used only for
16
+ * Radix portals (select dropdowns, toasts).
17
+ * - Selectors are role / aria-label / data-testid based only — no CSS
18
+ * classes, no `networkidle`; readiness is always "wait for the element".
19
+ */
20
+ export declare const HISTORY_TAB_LABELS: {
21
+ /** Tab name in the user profile modal sidebar. */
22
+ readonly tabName: "History";
23
+ readonly subTabs: {
24
+ readonly conversations: "Conversations";
25
+ readonly exports: "Exports";
26
+ };
27
+ readonly filters: {
28
+ /** Placeholder (and accessible name) of the agent autocomplete input. */
29
+ readonly searchAgents: "Search Agents";
30
+ readonly pickDateRange: "Pick a Date Range";
31
+ /** `aria-label` of the sentiment select trigger. */
32
+ readonly sentiment: "Filter by Sentiment";
33
+ /** `aria-label` of the topic select trigger. */
34
+ readonly topic: "Filter by Topic";
35
+ readonly export: "Export";
36
+ readonly exporting: "Exporting...";
37
+ };
38
+ readonly regions: {
39
+ /** `aria-label` of the conversation list region. */
40
+ readonly list: "Conversation list";
41
+ /** `aria-label` of the transcript preview region. */
42
+ readonly preview: "Conversation preview";
43
+ };
44
+ /** Per-conversation download button in the preview header. */
45
+ readonly download: "Download";
46
+ readonly emptyState: "No conversations found";
47
+ readonly selectPrompt: "Select a conversation to view details.";
48
+ readonly toasts: {
49
+ readonly exportReady: "Your chat history has been downloaded.";
50
+ readonly exportFailed: "Failed to export chat history. Please try again.";
51
+ };
52
+ readonly exports: {
53
+ readonly columns: {
54
+ readonly status: "Status";
55
+ readonly created: "Created";
56
+ readonly filters: "Filters";
57
+ readonly expires: "Expires";
58
+ };
59
+ readonly states: {
60
+ readonly completed: "Completed";
61
+ readonly processing: "Processing";
62
+ readonly pending: "Pending";
63
+ readonly failed: "Failed";
64
+ };
65
+ readonly empty: "No exports yet.";
66
+ };
67
+ };
68
+ export type HistorySubTab = 'Conversations' | 'Exports';
69
+ export type HistorySentiment = 'Positive' | 'Neutral' | 'Negative';
70
+ /**
71
+ * The user profile dialog, captured tag-first (`getByRole('dialog')`) and
72
+ * narrowed by a solid child — the History tab button — so it never matches
73
+ * a different dialog stacked on the page.
74
+ */
75
+ export declare function getProfileDialog(page: Page): Locator;
76
+ /**
77
+ * Open the History tab inside the (already open) profile dialog and wait
78
+ * for its Conversations sub-tab to render. Returns the scoped dialog
79
+ * locator every other helper should be handed.
80
+ */
81
+ export declare function openHistoryTab(page: Page): Promise<Locator>;
82
+ /**
83
+ * Switch between the Conversations and Exports sub-tabs, waiting for a
84
+ * stable landmark of the destination before returning.
85
+ */
86
+ export declare function switchHistorySubTab(dialog: Locator, subTab: HistorySubTab): Promise<void>;
87
+ export declare function getConversationList(dialog: Locator): Locator;
88
+ export declare function getConversationPreview(dialog: Locator): Locator;
89
+ /** Every conversation row in the list (each row is a `role="button"`). */
90
+ export declare function getConversationRows(dialog: Locator): Locator;
91
+ /**
92
+ * Wait for the conversation area to settle into one of its two valid
93
+ * states: at least one row rendered, or the empty state.
94
+ */
95
+ export declare function waitForConversations(dialog: Locator): Promise<void>;
96
+ /**
97
+ * Click a conversation row — by zero-based `index`, or the first row whose
98
+ * text contains `title` — then wait for the transcript preview to show its
99
+ * per-conversation Download button (the signal the messages have loaded).
100
+ */
101
+ export declare function selectConversation(dialog: Locator, options?: {
102
+ index?: number;
103
+ title?: string;
104
+ }): Promise<void>;
105
+ /**
106
+ * Download the currently previewed conversation as CSV (client-side file).
107
+ * Returns the Playwright `Download` so the test can assert on the file.
108
+ */
109
+ export declare function downloadConversationCsv(dialog: Locator): Promise<import("@playwright/test").Download>;
110
+ /**
111
+ * Type into the agent autocomplete and pick the result whose label matches
112
+ * `agentName`, then wait for the picker to collapse into its selected chip.
113
+ */
114
+ export declare function filterHistoryByAgent(dialog: Locator, agentName: string): Promise<void>;
115
+ /** Clear the agent filter chip and wait for the search input to return. */
116
+ export declare function clearHistoryAgentFilter(dialog: Locator): Promise<void>;
117
+ export declare function filterHistoryBySentiment(dialog: Locator, sentiment: HistorySentiment | 'All Sentiments'): Promise<void>;
118
+ export declare function filterHistoryByTopic(dialog: Locator, topic: string | 'All Topics'): Promise<void>;
119
+ /**
120
+ * Click Export on the Conversations sub-tab. The report generates
121
+ * server-side and downloads automatically when ready — pass the returned
122
+ * promise handling to `waitForHistoryExportDownload` for the full flow.
123
+ */
124
+ export declare function startHistoryExport(dialog: Locator): Promise<void>;
125
+ /**
126
+ * Full export flow: click Export, then wait for the report to finish
127
+ * polling and the browser download to fire. Report generation is a
128
+ * background task, so the timeout is generous by default.
129
+ */
130
+ export declare function exportHistoryAndWaitForDownload(dialog: Locator, { timeout }?: {
131
+ timeout?: number;
132
+ }): Promise<import("@playwright/test").Download>;
133
+ /** The Exports sub-tab's reports table. */
134
+ export declare function getExportsTable(dialog: Locator): Locator;
135
+ /**
136
+ * Rows of the Exports table matching a state badge label (e.g.
137
+ * `Completed`), each of which carries its own Download action when done.
138
+ */
139
+ export declare function getExportRowsByState(dialog: Locator, state: string): Locator;
140
+ /**
141
+ * Wait until at least one report row reaches the Completed state. Reports
142
+ * finish asynchronously, so the timeout is generous by default.
143
+ */
144
+ export declare function waitForCompletedExportRow(dialog: Locator, { timeout }?: {
145
+ timeout?: number;
146
+ }): Promise<Locator>;
147
+ /** Re-download a completed report from its Exports-table row. */
148
+ export declare function downloadExportedReport(dialog: Locator, row: Locator): Promise<import("@playwright/test").Download>;
@@ -44,5 +44,6 @@ export type { TaskRepeat, TaskStatus } from './tasks-tab-helpers';
44
44
  export * from './evaluation-tab-helpers';
45
45
  export * from './lti-tab-helpers';
46
46
  export * from './human-support-tab-helpers';
47
+ export * from './history-tab-helpers';
47
48
  export { createPlaywrightConfig, generateProjectConfig, generateBrowserSetupProjects, getBrowserKey, } from './playwright-config';
48
49
  export type { PlatformConfig, CreatePlaywrightConfigOptions } from './playwright-config';
@@ -131,6 +131,14 @@ export declare function toggleUserMemoryAdminSetting(page: Page, popup: Locator,
131
131
  /**
132
132
  * Filter the agents table to one agent via the autocomplete: types the name,
133
133
  * clicks the matching option, and gates on the selected chip rendering.
134
+ *
135
+ * Retries with progressively shorter PREFIXES of the name. The options come
136
+ * from a debounced server-side mentors search whose response RTK Query
137
+ * caches per search term — so when a just-created mentor hasn't reached the
138
+ * search backend yet, the first (empty) response keeps being served from
139
+ * cache for as long as the typed term stays the same, and waiting on the
140
+ * DOM alone can never recover. Each shorter prefix is a DISTINCT term that
141
+ * forces a fresh fetch, and still matches the mentor server-side.
134
142
  */
135
143
  export declare function filterAgentMemories(page: Page, agentName: string): Promise<void>;
136
144
  /** Clear the agents autocomplete filter (back to the full agents list). */