@iblai/iblai-js 2.76.0 → 2.77.0

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.
Files changed (207) hide show
  1. package/dist/data-layer/playwright/evaluation-tab-helpers.d.ts +181 -68
  2. package/dist/playwright/index.cjs +414 -164
  3. package/dist/playwright/index.cjs.map +1 -1
  4. package/dist/playwright/index.d.ts +181 -69
  5. package/dist/playwright/index.esm.js +407 -165
  6. package/dist/playwright/index.esm.js.map +1 -1
  7. package/dist/playwright/playwright/evaluation-tab-helpers.d.ts +181 -68
  8. package/dist/security/playwright/evaluation-tab-helpers.d.ts +181 -68
  9. package/dist/web-containers/playwright/evaluation-tab-helpers.d.ts +181 -68
  10. package/dist/web-containers/source/activity-empty-state.js +2 -2
  11. package/dist/web-containers/source/activity-empty-state.js.map +1 -1
  12. package/dist/web-containers/source/activity-tab/activity-empty-state.js +2 -2
  13. package/dist/web-containers/source/activity-tab/activity-empty-state.js.map +1 -1
  14. package/dist/web-containers/source/add-items-modal.js +26 -91
  15. package/dist/web-containers/source/add-items-modal.js.map +1 -1
  16. package/dist/web-containers/source/benchmark-combobox.js +2 -2
  17. package/dist/web-containers/source/benchmark-combobox.js.map +1 -1
  18. package/dist/web-containers/source/benchmark-items-modal.js +28 -7
  19. package/dist/web-containers/source/benchmark-items-modal.js.map +1 -1
  20. package/dist/web-containers/source/benchmarks/add-items-modal.js +26 -91
  21. package/dist/web-containers/source/benchmarks/add-items-modal.js.map +1 -1
  22. package/dist/web-containers/source/benchmarks/benchmark-items-modal.js +28 -7
  23. package/dist/web-containers/source/benchmarks/benchmark-items-modal.js.map +1 -1
  24. package/dist/web-containers/source/benchmarks/create-benchmark-modal.js +166 -20
  25. package/dist/web-containers/source/benchmarks/create-benchmark-modal.js.map +1 -1
  26. package/dist/web-containers/source/benchmarks/delete-item-confirm.js +10 -9
  27. package/dist/web-containers/source/benchmarks/delete-item-confirm.js.map +1 -1
  28. package/dist/web-containers/source/benchmarks/evals-ui.js +39 -0
  29. package/dist/web-containers/source/benchmarks/evals-ui.js.map +1 -0
  30. package/dist/web-containers/source/benchmarks/index.js +30 -11
  31. package/dist/web-containers/source/benchmarks/index.js.map +1 -1
  32. package/dist/web-containers/source/benchmarks/qa-form.js +233 -0
  33. package/dist/web-containers/source/benchmarks/qa-form.js.map +1 -0
  34. package/dist/web-containers/source/components/activity-tab/activity-empty-state.js +2 -2
  35. package/dist/web-containers/source/components/activity-tab/activity-empty-state.js.map +1 -1
  36. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js +2 -2
  37. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
  38. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
  39. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
  40. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
  41. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  42. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
  43. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
  44. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/index.js +68 -37
  45. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/index.js.map +1 -1
  46. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js +68 -46
  47. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js.map +1 -1
  48. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js +13 -6
  49. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
  50. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js +16 -7
  51. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
  52. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js +14 -1
  53. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js.map +1 -1
  54. package/dist/web-containers/source/components/platform-sidebar/index.js +2 -0
  55. package/dist/web-containers/source/components/platform-sidebar/index.js.map +1 -1
  56. package/dist/web-containers/source/components/profile/benchmarks/add-items-modal.js +26 -91
  57. package/dist/web-containers/source/components/profile/benchmarks/add-items-modal.js.map +1 -1
  58. package/dist/web-containers/source/components/profile/benchmarks/benchmark-items-modal.js +28 -7
  59. package/dist/web-containers/source/components/profile/benchmarks/benchmark-items-modal.js.map +1 -1
  60. package/dist/web-containers/source/components/profile/benchmarks/create-benchmark-modal.js +166 -20
  61. package/dist/web-containers/source/components/profile/benchmarks/create-benchmark-modal.js.map +1 -1
  62. package/dist/web-containers/source/components/profile/benchmarks/delete-item-confirm.js +10 -9
  63. package/dist/web-containers/source/components/profile/benchmarks/delete-item-confirm.js.map +1 -1
  64. package/dist/web-containers/source/components/profile/benchmarks/evals-ui.js +39 -0
  65. package/dist/web-containers/source/components/profile/benchmarks/evals-ui.js.map +1 -0
  66. package/dist/web-containers/source/components/profile/benchmarks/index.js +30 -11
  67. package/dist/web-containers/source/components/profile/benchmarks/index.js.map +1 -1
  68. package/dist/web-containers/source/components/profile/benchmarks/qa-form.js +233 -0
  69. package/dist/web-containers/source/components/profile/benchmarks/qa-form.js.map +1 -0
  70. package/dist/web-containers/source/components/rich-text-editor.js +24 -3
  71. package/dist/web-containers/source/components/rich-text-editor.js.map +1 -1
  72. package/dist/web-containers/source/create-benchmark-modal.js +166 -20
  73. package/dist/web-containers/source/create-benchmark-modal.js.map +1 -1
  74. package/dist/web-containers/source/delete-experiment-modal.js +6 -6
  75. package/dist/web-containers/source/delete-experiment-modal.js.map +1 -1
  76. package/dist/web-containers/source/delete-item-confirm.js +10 -9
  77. package/dist/web-containers/source/delete-item-confirm.js.map +1 -1
  78. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js +2 -2
  79. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
  80. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
  81. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
  82. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
  83. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  84. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
  85. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
  86. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/index.js +68 -37
  87. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/index.js.map +1 -1
  88. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/labels.js +68 -46
  89. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/labels.js.map +1 -1
  90. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js +13 -6
  91. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
  92. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js +16 -7
  93. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
  94. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/utils.js +14 -1
  95. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/utils.js.map +1 -1
  96. package/dist/web-containers/source/en.json.js +100 -74
  97. package/dist/web-containers/source/en.json.js.map +1 -1
  98. package/dist/web-containers/source/es.json.js +81 -55
  99. package/dist/web-containers/source/es.json.js.map +1 -1
  100. package/dist/web-containers/source/evals-ui.js +39 -0
  101. package/dist/web-containers/source/evals-ui.js.map +1 -0
  102. package/dist/web-containers/source/evaluate-llm-picker.js +7 -6
  103. package/dist/web-containers/source/evaluate-llm-picker.js.map +1 -1
  104. package/dist/web-containers/source/evaluation-tab/benchmark-combobox.js +2 -2
  105. package/dist/web-containers/source/evaluation-tab/benchmark-combobox.js.map +1 -1
  106. package/dist/web-containers/source/evaluation-tab/delete-experiment-modal.js +6 -6
  107. package/dist/web-containers/source/evaluation-tab/delete-experiment-modal.js.map +1 -1
  108. package/dist/web-containers/source/evaluation-tab/evaluate-llm-picker.js +7 -6
  109. package/dist/web-containers/source/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  110. package/dist/web-containers/source/evaluation-tab/experiment-detail-modal.js +51 -43
  111. package/dist/web-containers/source/evaluation-tab/experiment-detail-modal.js.map +1 -1
  112. package/dist/web-containers/source/evaluation-tab/index.js +68 -37
  113. package/dist/web-containers/source/evaluation-tab/index.js.map +1 -1
  114. package/dist/web-containers/source/evaluation-tab/labels.js +68 -46
  115. package/dist/web-containers/source/evaluation-tab/labels.js.map +1 -1
  116. package/dist/web-containers/source/evaluation-tab/llm-judge-modal.js +13 -6
  117. package/dist/web-containers/source/evaluation-tab/llm-judge-modal.js.map +1 -1
  118. package/dist/web-containers/source/evaluation-tab/start-experiment-modal.js +16 -7
  119. package/dist/web-containers/source/evaluation-tab/start-experiment-modal.js.map +1 -1
  120. package/dist/web-containers/source/evaluation-tab/utils.js +14 -1
  121. package/dist/web-containers/source/evaluation-tab/utils.js.map +1 -1
  122. package/dist/web-containers/source/experiment-detail-modal.js +51 -43
  123. package/dist/web-containers/source/experiment-detail-modal.js.map +1 -1
  124. package/dist/web-containers/source/fr.json.js +82 -56
  125. package/dist/web-containers/source/fr.json.js.map +1 -1
  126. package/dist/web-containers/source/i18n/messages/en.json.js +100 -74
  127. package/dist/web-containers/source/i18n/messages/en.json.js.map +1 -1
  128. package/dist/web-containers/source/i18n/messages/es.json.js +81 -55
  129. package/dist/web-containers/source/i18n/messages/es.json.js.map +1 -1
  130. package/dist/web-containers/source/i18n/messages/fr.json.js +82 -56
  131. package/dist/web-containers/source/i18n/messages/fr.json.js.map +1 -1
  132. package/dist/web-containers/source/i18n/messages/zh.json.js +71 -45
  133. package/dist/web-containers/source/i18n/messages/zh.json.js.map +1 -1
  134. package/dist/web-containers/source/llm-judge-modal.js +13 -6
  135. package/dist/web-containers/source/llm-judge-modal.js.map +1 -1
  136. package/dist/web-containers/source/messages/en.json.js +100 -74
  137. package/dist/web-containers/source/messages/en.json.js.map +1 -1
  138. package/dist/web-containers/source/messages/es.json.js +81 -55
  139. package/dist/web-containers/source/messages/es.json.js.map +1 -1
  140. package/dist/web-containers/source/messages/fr.json.js +82 -56
  141. package/dist/web-containers/source/messages/fr.json.js.map +1 -1
  142. package/dist/web-containers/source/messages/zh.json.js +71 -45
  143. package/dist/web-containers/source/messages/zh.json.js.map +1 -1
  144. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js +2 -2
  145. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
  146. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
  147. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
  148. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
  149. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  150. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
  151. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
  152. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/index.js +68 -37
  153. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/index.js.map +1 -1
  154. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js +68 -46
  155. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js.map +1 -1
  156. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js +13 -6
  157. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
  158. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js +16 -7
  159. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
  160. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js +14 -1
  161. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js.map +1 -1
  162. package/dist/web-containers/source/platform-sidebar/index.js +2 -0
  163. package/dist/web-containers/source/platform-sidebar/index.js.map +1 -1
  164. package/dist/web-containers/source/profile/benchmarks/add-items-modal.js +26 -91
  165. package/dist/web-containers/source/profile/benchmarks/add-items-modal.js.map +1 -1
  166. package/dist/web-containers/source/profile/benchmarks/benchmark-items-modal.js +28 -7
  167. package/dist/web-containers/source/profile/benchmarks/benchmark-items-modal.js.map +1 -1
  168. package/dist/web-containers/source/profile/benchmarks/create-benchmark-modal.js +166 -20
  169. package/dist/web-containers/source/profile/benchmarks/create-benchmark-modal.js.map +1 -1
  170. package/dist/web-containers/source/profile/benchmarks/delete-item-confirm.js +10 -9
  171. package/dist/web-containers/source/profile/benchmarks/delete-item-confirm.js.map +1 -1
  172. package/dist/web-containers/source/profile/benchmarks/evals-ui.js +39 -0
  173. package/dist/web-containers/source/profile/benchmarks/evals-ui.js.map +1 -0
  174. package/dist/web-containers/source/profile/benchmarks/index.js +30 -11
  175. package/dist/web-containers/source/profile/benchmarks/index.js.map +1 -1
  176. package/dist/web-containers/source/profile/benchmarks/qa-form.js +233 -0
  177. package/dist/web-containers/source/profile/benchmarks/qa-form.js.map +1 -0
  178. package/dist/web-containers/source/qa-form.js +233 -0
  179. package/dist/web-containers/source/qa-form.js.map +1 -0
  180. package/dist/web-containers/source/rich-text-editor.js +24 -3
  181. package/dist/web-containers/source/rich-text-editor.js.map +1 -1
  182. package/dist/web-containers/source/start-experiment-modal.js +16 -7
  183. package/dist/web-containers/source/start-experiment-modal.js.map +1 -1
  184. package/dist/web-containers/source/tabs/evaluation-tab/benchmark-combobox.js +2 -2
  185. package/dist/web-containers/source/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
  186. package/dist/web-containers/source/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
  187. package/dist/web-containers/source/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
  188. package/dist/web-containers/source/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
  189. package/dist/web-containers/source/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  190. package/dist/web-containers/source/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
  191. package/dist/web-containers/source/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
  192. package/dist/web-containers/source/tabs/evaluation-tab/index.js +68 -37
  193. package/dist/web-containers/source/tabs/evaluation-tab/index.js.map +1 -1
  194. package/dist/web-containers/source/tabs/evaluation-tab/labels.js +68 -46
  195. package/dist/web-containers/source/tabs/evaluation-tab/labels.js.map +1 -1
  196. package/dist/web-containers/source/tabs/evaluation-tab/llm-judge-modal.js +13 -6
  197. package/dist/web-containers/source/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
  198. package/dist/web-containers/source/tabs/evaluation-tab/start-experiment-modal.js +16 -7
  199. package/dist/web-containers/source/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
  200. package/dist/web-containers/source/tabs/evaluation-tab/utils.js +14 -1
  201. package/dist/web-containers/source/tabs/evaluation-tab/utils.js.map +1 -1
  202. package/dist/web-containers/source/tsconfig.build.tsbuildinfo +1 -1
  203. package/dist/web-containers/source/web-containers/tsconfig.build.tsbuildinfo +1 -1
  204. package/dist/web-containers/source/zh.json.js +71 -45
  205. package/dist/web-containers/source/zh.json.js.map +1 -1
  206. package/dist/web-utils/playwright/evaluation-tab-helpers.d.ts +181 -68
  207. package/package.json +4 -4
@@ -6830,12 +6830,18 @@ async function expectLogDetailsStatus(scope, status) {
6830
6830
  * `aria-labelledby` win the accessible-name computation — and then resolve
6831
6831
  * every in-dialog control from that scoped locator. This matters here more
6832
6832
  * than usual:
6833
- * - the toolbar "New Evaluation" / "Manage benchmarks" buttons share their
6834
- * text with the dialog titles they open;
6835
- * - the LLM-judge dialog's title AND submit button both read "Evaluate";
6836
- * - dialogs nest three deep (Manage benchmarks → benchmark items → add
6837
- * Q&A), and the add-Q&A dialog has Manual / CSV Upload sub-tabs whose
6838
- * footers each have their own Cancel button.
6833
+ * - "New Evaluation", "Manage Benchmarks", "New Benchmark" and "New Review"
6834
+ * are each both a button and the title of the dialog it opens;
6835
+ * - "Add Q&A" is a button on the Evals tab and in a benchmark's Q&A dialog,
6836
+ * and starts the title of the dialog both open;
6837
+ * - dialogs nest three deep (Manage Benchmarks → benchmark Q&A → Add Q&A),
6838
+ * and the New Benchmark and Add Q&A dialogs hold the same Manual / CSV
6839
+ * Upload form;
6840
+ * - the New Benchmark dialog is two steps with their own tabs (Details,
6841
+ * Q&A), so its Q&A step is a tabpanel around the form's own tabpanels.
6842
+ *
6843
+ * Every form label has an info button named "More info about <label>", so a
6844
+ * field is looked up by its label with `exact: true`.
6839
6845
  *
6840
6846
  * The helpers assume the Edit Mentor dialog is already open. Call
6841
6847
  * `switchToEvaluationTab(page)` first; from then on, every helper accepts
@@ -6859,10 +6865,18 @@ const EVALS_LABELS = {
6859
6865
  actions: {
6860
6866
  newExperiment: 'New Evaluation',
6861
6867
  manageBenchmarks: 'Manage Benchmarks',
6862
- viewResults: 'View results',
6863
- evaluate: 'New review',
6868
+ /** The no-benchmarks empty state's button; opens the New Benchmark dialog. */
6869
+ newBenchmark: 'New Benchmark',
6870
+ /** The tab's own button for a benchmark with no Q&A; opens the Add Q&A dialog. */
6871
+ addQa: 'Add Q&A',
6872
+ viewResults: 'View Results',
6873
+ evaluate: 'New Review',
6864
6874
  exportCsv: 'Export CSV',
6865
- checkStatus: 'Check status',
6875
+ checkStatus: 'Check Status',
6876
+ /** Accessible description of View Results / New Review / Export CSV until the evaluation completes. */
6877
+ notReadyHint: 'Available once the evaluation completes',
6878
+ /** Accessible description of the same three items on an evaluation that failed. */
6879
+ failedHint: 'Not available because the evaluation failed',
6866
6880
  delete: 'Delete',
6867
6881
  },
6868
6882
  checkStatusToast: {
@@ -6870,35 +6884,67 @@ const EVALS_LABELS = {
6870
6884
  completed: 'Evaluation completed',
6871
6885
  failed: 'Evaluation failed',
6872
6886
  },
6873
- emptyBenchmarks: 'No benchmarks yet. Use "Manage Benchmarks" above to create one.',
6887
+ emptyBenchmarks: 'Your organization has no benchmarks yet. Create one to evaluate this agent.',
6888
+ /** `data-testid` on the no-benchmarks empty state (sentence + "New Benchmark"). */
6889
+ noBenchmarksTestId: 'evaluation-no-benchmarks',
6890
+ /** Shown for a benchmark with no Q&A, and as the hover text of the disabled "New Evaluation". */
6891
+ emptyQa: 'This benchmark has no Q&A yet. Add at least one question to run an evaluation.',
6892
+ /** `data-testid` on the empty state of a benchmark with no Q&A and no evaluations. */
6893
+ noQaEmptyTestId: 'evaluation-no-qa-empty',
6894
+ /** `data-testid` on the line above the runs table of a benchmark with evaluations but no Q&A. */
6895
+ noQaNoticeTestId: 'evaluation-no-qa-notice',
6896
+ /** Accessible name of every dialog's own close (X) button. */
6897
+ dialogClose: 'Close',
6874
6898
  startDialog: {
6875
6899
  /** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
6876
6900
  dialogName: 'start-evaluation',
6877
- experimentNameLabel: 'Evaluation name',
6901
+ experimentNameLabel: 'Evaluation Name',
6878
6902
  cancel: 'Cancel',
6879
6903
  start: 'Start Evaluation',
6904
+ /** Toast after a start; `{name}` is the evaluation's name. */
6905
+ successToast: 'Evaluation started: {name}',
6880
6906
  },
6881
6907
  manageBenchmarksDialog: {
6882
6908
  /** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
6883
6909
  dialogName: 'manage-benchmarks',
6910
+ title: 'Manage Benchmarks',
6884
6911
  searchAriaLabel: 'Search benchmarks',
6885
6912
  newBenchmark: 'New Benchmark',
6886
6913
  empty: 'No benchmarks found',
6914
+ emptyNone: 'Your organization has no benchmarks yet.',
6887
6915
  },
6888
6916
  createBenchmarkDialog: {
6889
6917
  /** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
6890
6918
  dialogName: 'create-benchmark',
6919
+ /** Step tab (`role="tab"`) holding Name and Description. */
6920
+ detailsTab: 'Details',
6921
+ /** Step tab holding the Manual / CSV Upload form (labels under `addItemsDialog`); disabled until Name has text. */
6922
+ qaTab: 'Q&A',
6891
6923
  nameLabel: 'Name',
6924
+ /** Under Name (`role="alert"`) when "Next" or "Create" refuses a name that could never be opened again. */
6925
+ nameInvalid: 'Name cannot contain a slash (/) or be made only of dots.',
6926
+ /** Under Name (`role="alert"`) when "Create" finds a benchmark that already has this name; the dialog goes back to Details. */
6927
+ nameTaken: 'A benchmark with this name already exists. Enter a different name.',
6892
6928
  descriptionLabel: 'Description',
6929
+ /** `data-testid` on the note at the top of the Q&A step. */
6930
+ qaHintTestId: 'benchmark-qa-hint',
6931
+ qaHint: 'You can skip this and add Q&A later. A benchmark needs at least one question before you can run an evaluation.',
6893
6932
  cancel: 'Cancel',
6933
+ /** The Details step's button; disabled until Name has text. */
6934
+ next: 'Next',
6935
+ /** The Q&A step's button; works with or without Q&A. */
6894
6936
  create: 'Create',
6937
+ /** Toast for a benchmark created without Q&A. With Q&A it reads "Benchmark created with N Q&A pairs". */
6938
+ successToastNoQa: 'Benchmark created. Add Q&A before you run an evaluation.',
6895
6939
  },
6896
6940
  benchmarkItemsDialog: {
6897
6941
  /** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
6898
6942
  dialogName: 'benchmark-items',
6943
+ /** Column headers of the Q&A table. Below 640px the ANSWER column is hidden and each answer sits under its question. */
6944
+ columns: ['QUESTION', 'ANSWER', 'ACTIONS'],
6899
6945
  addItems: 'Add Q&A',
6900
6946
  deleteItemAriaLabel: 'Delete Q&A',
6901
- empty: 'No Q&A in this benchmark yet',
6947
+ empty: 'This benchmark has no Q&A yet.',
6902
6948
  },
6903
6949
  addItemsDialog: {
6904
6950
  /** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
@@ -6907,10 +6953,12 @@ const EVALS_LABELS = {
6907
6953
  csvTab: 'CSV Upload',
6908
6954
  questionLabel: 'Question',
6909
6955
  answerLabel: 'Answer',
6910
- addRow: 'Add row',
6911
- removeRowAriaLabel: 'Remove row',
6956
+ addRow: 'Add Row',
6957
+ removeRowAriaLabel: 'Remove Row',
6912
6958
  add: 'Add',
6913
- csvFileLabel: 'CSV file',
6959
+ csvFileLabel: 'CSV File',
6960
+ /** Under CSV File (`role="alert"`) for a file whose first row has no `input` column; the submit button is disabled. */
6961
+ csvNoInputColumn: 'The first row of this file needs a column named "input". Download the sample CSV to see the format.',
6914
6962
  upload: 'Upload',
6915
6963
  cancel: 'Cancel',
6916
6964
  },
@@ -6924,14 +6972,14 @@ const EVALS_LABELS = {
6924
6972
  /** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
6925
6973
  dialogName: 'evaluation-detail',
6926
6974
  refreshAriaLabel: 'Refresh',
6927
- newReview: 'New review',
6928
- waitingHint: 'Waiting for the evaluation to produce traces. This page auto-refreshes.',
6975
+ newReview: 'New Review',
6976
+ waitingHint: 'Waiting for the first responses. This page refreshes by itself.',
6929
6977
  noScoresHint: 'No scores yet',
6930
- scoreNameLabel: 'Score name',
6978
+ scoreNameLabel: 'Score Name',
6931
6979
  scoreValueLabel: 'Value',
6932
6980
  scoreCommentLabel: 'Comment',
6933
6981
  addScore: 'Add',
6934
- removeScoreAriaLabel: 'Remove score',
6982
+ removeScoreAriaLabel: 'Delete Score',
6935
6983
  reviewsHeading: 'Reviews',
6936
6984
  reviewDetailsAriaLabel: 'Toggle review details',
6937
6985
  reviewStatus: {
@@ -6944,12 +6992,13 @@ const EVALS_LABELS = {
6944
6992
  judgeDialog: {
6945
6993
  /** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
6946
6994
  dialogName: 'llm-judge',
6995
+ title: 'New Review',
6947
6996
  criteriaLabel: 'Criteria',
6948
- scoreNameLabel: 'Score name',
6949
- maxConcurrencyLabel: 'Max concurrency',
6997
+ scoreNameLabel: 'Score Name',
6998
+ maxConcurrencyLabel: 'Max Concurrency',
6950
6999
  selectorAriaLabel: 'LLM Model Selector',
6951
7000
  cancel: 'Cancel',
6952
- submit: 'Evaluate',
7001
+ submit: 'Start Review',
6953
7002
  },
6954
7003
  llmPickerDialog: {
6955
7004
  /** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
@@ -6961,6 +7010,8 @@ const EVALS_LABELS = {
6961
7010
  deleteDialog: {
6962
7011
  /** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
6963
7012
  dialogName: 'delete-evaluation',
7013
+ /** The dialog's question; `{runName}` is the evaluation's name. */
7014
+ confirmation: 'Are you sure you want to delete the evaluation "{runName}"? This action cannot be undone.',
6964
7015
  cancel: 'Cancel',
6965
7016
  confirm: 'Delete',
6966
7017
  },
@@ -6982,6 +7033,15 @@ function escapeRegExp(value) {
6982
7033
  function dialogByName(scope, dialogName) {
6983
7034
  return asPage$3(scope).locator(`[role="dialog"][aria-label="${dialogName}"]`);
6984
7035
  }
7036
+ /**
7037
+ * A toast showing `text`. A string must be the toast's whole text, case
7038
+ * included. Scoped to the toast itself, because the same words can sit
7039
+ * elsewhere on the page (a disabled row action's hidden reason ends in
7040
+ * "the evaluation failed").
7041
+ */
7042
+ function getToast(scope, text) {
7043
+ return asPage$3(scope).locator('[data-sonner-toast]').getByText(text, { exact: true });
7044
+ }
6985
7045
  // ── Tab navigation ─────────────────────────────────────────────────────
6986
7046
  /**
6987
7047
  * Check whether the Evals tab is rendered in the Edit Mentor dialog.
@@ -7000,14 +7060,14 @@ async function isEvaluationTabVisible(page) {
7000
7060
  }
7001
7061
  /**
7002
7062
  * Switch to the Evals tab. Assumes the Edit Mentor dialog is open. Waits
7003
- * for the toolbar "Manage benchmarks" button (unique to this pane) before
7063
+ * for the toolbar "Manage Benchmarks" button (unique to this pane) before
7004
7064
  * returning, so callers can rely on the panel being interactive.
7005
7065
  */
7006
7066
  async function switchToEvaluationTab(page) {
7007
7067
  const tab = page.getByRole('tab', { name: EVALS_LABELS.tabName, exact: true });
7008
7068
  await test$1.expect(tab).toBeVisible({ timeout: 10000 });
7009
7069
  await tab.click();
7010
- await test$1.expect(page.getByRole('button', { name: EVALS_LABELS.actions.manageBenchmarks })).toBeVisible({ timeout: 10000 });
7070
+ await test$1.expect(page.getByRole('button', { name: EVALS_LABELS.actions.manageBenchmarks, exact: true })).toBeVisible({ timeout: 10000 });
7011
7071
  logger.info('Switched to Evals tab');
7012
7072
  }
7013
7073
  // ── Toolbar: benchmark picker + action buttons ─────────────────────────
@@ -7023,7 +7083,7 @@ function getBenchmarkComboboxDropdown(scope) {
7023
7083
  function getNewEvaluationButton(scope) {
7024
7084
  return scope.getByRole('button', { name: EVALS_LABELS.actions.newExperiment, exact: true });
7025
7085
  }
7026
- /** Locator for the toolbar "Manage benchmarks" button (opens the benchmarks dialog). */
7086
+ /** Locator for the toolbar "Manage Benchmarks" button (opens the benchmarks dialog). */
7027
7087
  function getManageBenchmarksButton(scope) {
7028
7088
  return scope.getByRole('button', { name: EVALS_LABELS.actions.manageBenchmarks, exact: true });
7029
7089
  }
@@ -7054,9 +7114,53 @@ async function selectBenchmark(scope, benchmarkName, opts = {}) {
7054
7114
  await expectSelectedBenchmark(scope, benchmarkName);
7055
7115
  logger.info(`Selected benchmark: ${benchmarkName}`);
7056
7116
  }
7057
- /** Assert the "no benchmarks yet" empty notice is shown in the tab body. */
7117
+ /** Locator for the empty state an organization with no benchmarks sees (sentence + "New Benchmark"). */
7118
+ function getNoBenchmarksEmptyState(scope) {
7119
+ return scope.getByTestId(EVALS_LABELS.noBenchmarksTestId);
7120
+ }
7121
+ /** Assert the no-benchmarks empty state says so and offers "New Benchmark". */
7058
7122
  async function expectNoBenchmarksNotice(scope) {
7059
- await test$1.expect(scope.getByText(EVALS_LABELS.emptyBenchmarks)).toBeVisible({ timeout: 10000 });
7123
+ const emptyState = getNoBenchmarksEmptyState(scope);
7124
+ await test$1.expect(emptyState).toContainText(EVALS_LABELS.emptyBenchmarks, { timeout: 10000 });
7125
+ await test$1.expect(emptyState.getByRole('button', { name: EVALS_LABELS.actions.newBenchmark, exact: true })).toBeVisible();
7126
+ }
7127
+ /**
7128
+ * Locator for what the tab shows when the selected benchmark has no Q&A: the
7129
+ * empty state when it has no evaluations either, or the line above the runs
7130
+ * table when it has. Both hold the same sentence and the same "Add Q&A" button.
7131
+ */
7132
+ function getNoQaPrompt(scope) {
7133
+ return scope
7134
+ .getByTestId(EVALS_LABELS.noQaEmptyTestId)
7135
+ .or(scope.getByTestId(EVALS_LABELS.noQaNoticeTestId));
7136
+ }
7137
+ /**
7138
+ * Assert the selected benchmark cannot be evaluated for lack of Q&A: the tab
7139
+ * says why and offers "Add Q&A", and "New Evaluation" is disabled with the
7140
+ * same sentence as its hover text.
7141
+ */
7142
+ async function expectBenchmarkNeedsQa(scope) {
7143
+ const prompt = getNoQaPrompt(scope);
7144
+ await test$1.expect(prompt).toContainText(EVALS_LABELS.emptyQa, { timeout: 15000 });
7145
+ await test$1.expect(prompt.getByRole('button', { name: EVALS_LABELS.actions.addQa, exact: true })).toBeVisible();
7146
+ const newEvaluation = getNewEvaluationButton(scope);
7147
+ await test$1.expect(newEvaluation).toBeDisabled();
7148
+ // A disabled button ignores the pointer, so the hover text hangs on the span wrapped around it.
7149
+ await newEvaluation.locator('xpath=..').hover();
7150
+ await test$1.expect(asPage$3(scope).getByRole('tooltip', { name: EVALS_LABELS.emptyQa, exact: true })).toBeVisible({ timeout: 5000 });
7151
+ }
7152
+ /**
7153
+ * Click the tab's own "Add Q&A" button (shown only while the selected
7154
+ * benchmark has no Q&A) and wait for the Add Q&A dialog. Returns the dialog;
7155
+ * continue with `addQaPairsManually` or `uploadQaCsv`.
7156
+ */
7157
+ async function openAddQaFromEvalsTab(scope) {
7158
+ await getNoQaPrompt(scope)
7159
+ .getByRole('button', { name: EVALS_LABELS.actions.addQa, exact: true })
7160
+ .click();
7161
+ const dialog = getAddItemsDialog(scope);
7162
+ await test$1.expect(dialog.getByRole('tab', { name: EVALS_LABELS.addItemsDialog.manualTab, exact: true })).toBeVisible({ timeout: 10000 });
7163
+ return dialog;
7060
7164
  }
7061
7165
  // ── Runs table ─────────────────────────────────────────────────────────
7062
7166
  /**
@@ -7075,11 +7179,9 @@ async function expectRunInTable(scope, runName) {
7075
7179
  async function expectRunNotInTable(scope, runName) {
7076
7180
  await test$1.expect(getRunRow(scope, runName)).toBeHidden({ timeout: 15000 });
7077
7181
  }
7078
- /** Assert the status badge on a run's row (badge text is upper-cased by the UI). */
7182
+ /** Assert the status on a run's row, read from the `data-status` of its status icon. */
7079
7183
  async function expectRunStatus(scope, runName, status) {
7080
- await test$1.expect(getRunRow(scope, runName).getByText(status, { exact: true })).toBeVisible({
7081
- timeout: 15000,
7082
- });
7184
+ await test$1.expect(getRunRow(scope, runName).locator(`[data-status="${status.toLowerCase()}"]`)).toBeVisible({ timeout: 15000 });
7083
7185
  }
7084
7186
  /** Assert the empty-state row shown when the selected benchmark has no runs for this agent. */
7085
7187
  async function expectRunsTableEmpty(scope, benchmarkName) {
@@ -7099,12 +7201,15 @@ async function openRunActionsMenu(scope, runName) {
7099
7201
  return menu;
7100
7202
  }
7101
7203
  /**
7102
- * Row action: "View results" — opens the evaluation detail dialog.
7204
+ * Row action: "View Results" — opens the evaluation detail dialog.
7103
7205
  * Only enabled once the run is COMPLETED. Returns the scoped detail dialog.
7104
7206
  */
7105
7207
  async function openRunResults(scope, runName) {
7106
7208
  const menu = await openRunActionsMenu(scope, runName);
7107
- const item = menu.getByRole('menuitem', { name: EVALS_LABELS.actions.viewResults });
7209
+ const item = menu.getByRole('menuitem', {
7210
+ name: EVALS_LABELS.actions.viewResults,
7211
+ exact: true,
7212
+ });
7108
7213
  await test$1.expect(item).toBeEnabled({ timeout: 5000 });
7109
7214
  await item.click();
7110
7215
  const dialog = getEvaluationDetailDialog(scope);
@@ -7113,12 +7218,12 @@ async function openRunResults(scope, runName) {
7113
7218
  return dialog;
7114
7219
  }
7115
7220
  /**
7116
- * Row action: "New review" — opens the LLM-judge dialog for the run.
7221
+ * Row action: "New Review" — opens the New Review (LLM-judge) dialog for the run.
7117
7222
  * Only enabled once the run is COMPLETED. Returns the scoped judge dialog.
7118
7223
  */
7119
7224
  async function openNewReviewForRun(scope, runName) {
7120
7225
  const menu = await openRunActionsMenu(scope, runName);
7121
- const item = menu.getByRole('menuitem', { name: EVALS_LABELS.actions.evaluate });
7226
+ const item = menu.getByRole('menuitem', { name: EVALS_LABELS.actions.evaluate, exact: true });
7122
7227
  await test$1.expect(item).toBeEnabled({ timeout: 5000 });
7123
7228
  await item.click();
7124
7229
  const dialog = getLlmJudgeDialog(scope);
@@ -7126,25 +7231,27 @@ async function openNewReviewForRun(scope, runName) {
7126
7231
  return dialog;
7127
7232
  }
7128
7233
  /**
7129
- * Row action: "Check status" — triggers a fresh status fetch and waits for
7234
+ * Row action: "Check Status" — triggers a fresh status fetch and waits for
7130
7235
  * the outcome toast. Returns which toast appeared. The menu stays open by
7131
7236
  * design (the item prevents default), so we close it with Escape.
7237
+ *
7238
+ * Safe to call again right away: it first waits for an earlier check's toast
7239
+ * to go, since that one can read the same as the next.
7132
7240
  */
7133
7241
  async function checkRunStatus(scope, runName) {
7134
7242
  const page = asPage$3(scope);
7135
- const menu = await openRunActionsMenu(scope, runName);
7136
- await menu.getByRole('menuitem', { name: EVALS_LABELS.actions.checkStatus }).click();
7137
7243
  const toasts = EVALS_LABELS.checkStatusToast;
7138
- const toast = page
7139
- .getByText(new RegExp(`${toasts.pending}|${toasts.completed}|${toasts.failed}`))
7140
- .first();
7244
+ const toast = getToast(scope, new RegExp(`^(${toasts.pending}|${toasts.completed}|${toasts.failed})$`));
7245
+ await test$1.expect(toast).toHaveCount(0, { timeout: 15000 });
7246
+ const menu = await openRunActionsMenu(scope, runName);
7247
+ await menu.getByRole('menuitem', { name: EVALS_LABELS.actions.checkStatus, exact: true }).click();
7141
7248
  await test$1.expect(toast).toBeVisible({ timeout: 15000 });
7142
7249
  const text = (await toast.innerText()).trim();
7143
7250
  await page.keyboard.press('Escape');
7144
7251
  await test$1.expect(menu).toBeHidden({ timeout: 5000 });
7145
- if (text.includes(toasts.completed))
7252
+ if (text === toasts.completed)
7146
7253
  return 'completed';
7147
- if (text.includes(toasts.failed))
7254
+ if (text === toasts.failed)
7148
7255
  return 'failed';
7149
7256
  return 'pending';
7150
7257
  }
@@ -7155,7 +7262,7 @@ async function checkRunStatus(scope, runName) {
7155
7262
  async function exportRunCsv(scope, runName) {
7156
7263
  const page = asPage$3(scope);
7157
7264
  const menu = await openRunActionsMenu(scope, runName);
7158
- const item = menu.getByRole('menuitem', { name: EVALS_LABELS.actions.exportCsv });
7265
+ const item = menu.getByRole('menuitem', { name: EVALS_LABELS.actions.exportCsv, exact: true });
7159
7266
  await test$1.expect(item).toBeEnabled({ timeout: 5000 });
7160
7267
  const downloadPromise = page.waitForEvent('download', { timeout: 30000 });
7161
7268
  await item.click();
@@ -7172,33 +7279,43 @@ function getStartEvaluationDialog(scope) {
7172
7279
  async function openStartEvaluationDialog(scope) {
7173
7280
  await getNewEvaluationButton(scope).click();
7174
7281
  const dialog = getStartEvaluationDialog(scope);
7175
- await test$1.expect(dialog.getByLabel(EVALS_LABELS.startDialog.experimentNameLabel)).toBeVisible({
7176
- timeout: 10000,
7177
- });
7282
+ await test$1.expect(dialog.getByLabel(EVALS_LABELS.startDialog.experimentNameLabel, { exact: true })).toBeVisible({ timeout: 10000 });
7178
7283
  return dialog;
7179
7284
  }
7180
7285
  /**
7181
7286
  * End-to-end: open the "New Evaluation" dialog, optionally name the run,
7182
- * submit, and wait for the dialog to close. When `name` is omitted the
7183
- * backend auto-generates one.
7287
+ * submit, and wait for the dialog to close and for the toast that names the
7288
+ * started evaluation. When `name` is omitted the backend auto-generates one.
7184
7289
  */
7185
7290
  async function startEvaluation(scope, opts = {}) {
7291
+ var _a;
7186
7292
  const dialog = await openStartEvaluationDialog(scope);
7187
7293
  if (opts.name !== undefined) {
7188
- await dialog.getByLabel(EVALS_LABELS.startDialog.experimentNameLabel).fill(opts.name);
7294
+ await dialog
7295
+ .getByLabel(EVALS_LABELS.startDialog.experimentNameLabel, { exact: true })
7296
+ .fill(opts.name);
7189
7297
  }
7190
7298
  // Scoped to the dialog: "Start Evaluation" is unique today, but the toolbar
7191
7299
  // "New Evaluation" trigger sits right behind the overlay — never query the page.
7192
- const submit = dialog.getByRole('button', { name: EVALS_LABELS.startDialog.start });
7300
+ const submit = dialog.getByRole('button', {
7301
+ name: EVALS_LABELS.startDialog.start,
7302
+ exact: true,
7303
+ });
7193
7304
  await test$1.expect(submit).toBeEnabled({ timeout: 5000 });
7194
7305
  await submit.click();
7195
7306
  await test$1.expect(dialog).toBeHidden({ timeout: 15000 });
7307
+ // Checked here, right after the dialog closes: the toast is gone within seconds.
7308
+ const started = EVALS_LABELS.startDialog.successToast;
7309
+ const typedName = (_a = opts.name) === null || _a === void 0 ? void 0 : _a.trim();
7310
+ await test$1.expect(getToast(scope, typedName
7311
+ ? started.replace('{name}', () => typedName)
7312
+ : new RegExp(`^${escapeRegExp(started.replace('{name}', ''))}`))).toBeVisible({ timeout: 10000 });
7196
7313
  logger.info(`Started evaluation${opts.name ? `: ${opts.name}` : ''}`);
7197
7314
  }
7198
7315
  /** Cancel out of the start dialog and wait for it to close. */
7199
7316
  async function cancelStartEvaluation(scope) {
7200
7317
  const dialog = getStartEvaluationDialog(scope);
7201
- await dialog.getByRole('button', { name: EVALS_LABELS.startDialog.cancel }).click();
7318
+ await dialog.getByRole('button', { name: EVALS_LABELS.startDialog.cancel, exact: true }).click();
7202
7319
  await test$1.expect(dialog).toBeHidden({ timeout: 5000 });
7203
7320
  }
7204
7321
  // ── Delete evaluation dialog ───────────────────────────────────────────
@@ -7207,33 +7324,41 @@ function getDeleteEvaluationDialog(scope) {
7207
7324
  return dialogByName(scope, EVALS_LABELS.deleteDialog.dialogName);
7208
7325
  }
7209
7326
  /**
7210
- * Delete a run from its row actions menu and confirm in the follow-up
7211
- * dialog. The confirm button ("Delete") shares its name with the menu item
7212
- * that opened the dialog, so the confirm click MUST stay dialog-scoped.
7327
+ * Click "Delete" in a run's row actions menu and wait for the confirm dialog
7328
+ * to ask about that run by name. Returns the dialog.
7213
7329
  */
7214
- async function deleteEvaluation(scope, runName) {
7330
+ async function openDeleteEvaluationDialog(scope, runName) {
7215
7331
  const menu = await openRunActionsMenu(scope, runName);
7216
- await menu.getByRole('menuitem', { name: EVALS_LABELS.actions.delete }).click();
7332
+ await menu.getByRole('menuitem', { name: EVALS_LABELS.actions.delete, exact: true }).click();
7217
7333
  const dialog = getDeleteEvaluationDialog(scope);
7218
- const confirm = dialog.getByRole('button', { name: EVALS_LABELS.deleteDialog.confirm });
7219
- await test$1.expect(confirm).toBeVisible({ timeout: 5000 });
7220
- await confirm.click();
7334
+ await test$1.expect(dialog).toContainText(EVALS_LABELS.deleteDialog.confirmation.replace('{runName}', () => runName), { timeout: 5000 });
7335
+ return dialog;
7336
+ }
7337
+ /**
7338
+ * Delete a run from its row actions menu and confirm in the follow-up
7339
+ * dialog, which names the run. The confirm button ("Delete") shares its name
7340
+ * with the menu item that opened the dialog, so the confirm click MUST stay
7341
+ * dialog-scoped.
7342
+ */
7343
+ async function deleteEvaluation(scope, runName) {
7344
+ const dialog = await openDeleteEvaluationDialog(scope, runName);
7345
+ await dialog
7346
+ .getByRole('button', { name: EVALS_LABELS.deleteDialog.confirm, exact: true })
7347
+ .click();
7221
7348
  await test$1.expect(dialog).toBeHidden({ timeout: 15000 });
7222
7349
  logger.info(`Deleted evaluation: ${runName}`);
7223
7350
  }
7224
7351
  /** Open the delete confirm from the row menu, then cancel out of it. */
7225
7352
  async function cancelDeleteEvaluation(scope, runName) {
7226
- const menu = await openRunActionsMenu(scope, runName);
7227
- await menu.getByRole('menuitem', { name: EVALS_LABELS.actions.delete }).click();
7228
- const dialog = getDeleteEvaluationDialog(scope);
7229
- await dialog.getByRole('button', { name: EVALS_LABELS.deleteDialog.cancel }).click();
7353
+ const dialog = await openDeleteEvaluationDialog(scope, runName);
7354
+ await dialog.getByRole('button', { name: EVALS_LABELS.deleteDialog.cancel, exact: true }).click();
7230
7355
  await test$1.expect(dialog).toBeHidden({ timeout: 5000 });
7231
7356
  }
7232
- // ── LLM-judge ("Evaluate") dialog ──────────────────────────────────────
7357
+ // ── New Review (LLM-judge) dialog ──────────────────────────────────────
7233
7358
  /**
7234
- * Locator for the LLM-judge dialog. Scoped by aria-label — its title AND its
7235
- * submit button both read "Evaluate", and it can be stacked on top of the
7236
- * evaluation-detail dialog.
7359
+ * Locator for the New Review (LLM-judge) dialog. Scoped by aria-label — its
7360
+ * title is also the name of the row action and of the detail-dialog button
7361
+ * that open it, and it can be stacked on top of the evaluation-detail dialog.
7237
7362
  */
7238
7363
  function getLlmJudgeDialog(scope) {
7239
7364
  return dialogByName(scope, EVALS_LABELS.judgeDialog.dialogName);
@@ -7275,15 +7400,18 @@ async function selectJudgeLlm(scope, providerName, modelName) {
7275
7400
  async function submitLlmJudge(scope, opts) {
7276
7401
  const dialog = getLlmJudgeDialog(scope);
7277
7402
  await test$1.expect(dialog).toBeVisible({ timeout: 10000 });
7278
- await dialog.getByLabel(EVALS_LABELS.judgeDialog.criteriaLabel).fill(opts.criteria);
7279
- await dialog.getByLabel(EVALS_LABELS.judgeDialog.scoreNameLabel).fill(opts.scoreName);
7403
+ await dialog
7404
+ .getByLabel(EVALS_LABELS.judgeDialog.criteriaLabel, { exact: true })
7405
+ .fill(opts.criteria);
7406
+ await dialog
7407
+ .getByLabel(EVALS_LABELS.judgeDialog.scoreNameLabel, { exact: true })
7408
+ .fill(opts.scoreName);
7280
7409
  if (opts.maxConcurrency !== undefined) {
7281
7410
  await dialog
7282
- .getByLabel(EVALS_LABELS.judgeDialog.maxConcurrencyLabel)
7411
+ .getByLabel(EVALS_LABELS.judgeDialog.maxConcurrencyLabel, { exact: true })
7283
7412
  .fill(String(opts.maxConcurrency));
7284
7413
  }
7285
7414
  await selectJudgeLlm(scope, opts.provider, opts.model);
7286
- // Dialog-scoped on purpose: the dialog title is also "Evaluate".
7287
7415
  const submit = dialog.getByRole('button', { name: EVALS_LABELS.judgeDialog.submit, exact: true });
7288
7416
  await test$1.expect(submit).toBeEnabled({ timeout: 5000 });
7289
7417
  await submit.click();
@@ -7293,7 +7421,7 @@ async function submitLlmJudge(scope, opts) {
7293
7421
  /** Cancel out of the judge dialog and wait for it to close. */
7294
7422
  async function cancelLlmJudge(scope) {
7295
7423
  const dialog = getLlmJudgeDialog(scope);
7296
- await dialog.getByRole('button', { name: EVALS_LABELS.judgeDialog.cancel }).click();
7424
+ await dialog.getByRole('button', { name: EVALS_LABELS.judgeDialog.cancel, exact: true }).click();
7297
7425
  await test$1.expect(dialog).toBeHidden({ timeout: 5000 });
7298
7426
  }
7299
7427
  // ── Evaluation detail dialog ───────────────────────────────────────────
@@ -7311,7 +7439,7 @@ async function refreshEvaluationDetail(scope) {
7311
7439
  await refresh.click();
7312
7440
  await test$1.expect(refresh).toBeEnabled({ timeout: 15000 });
7313
7441
  }
7314
- /** Open the LLM-judge dialog from the detail dialog's "New review" CTA. Returns the judge dialog. */
7442
+ /** Open the New Review dialog from the detail dialog's "New Review" button. Returns the judge dialog. */
7315
7443
  async function openNewReviewFromDetail(scope) {
7316
7444
  const dialog = getEvaluationDetailDialog(scope);
7317
7445
  const cta = dialog.getByRole('button', {
@@ -7324,7 +7452,7 @@ async function openNewReviewFromDetail(scope) {
7324
7452
  await test$1.expect(judgeDialog).toBeVisible({ timeout: 10000 });
7325
7453
  return judgeDialog;
7326
7454
  }
7327
- /** Assert the detail dialog is still waiting for traces (auto-refreshing hint). */
7455
+ /** Assert the detail dialog is still waiting for the first responses (it refreshes by itself). */
7328
7456
  async function expectDetailWaitingForTraces(scope) {
7329
7457
  await test$1.expect(getEvaluationDetailDialog(scope).getByText(EVALS_LABELS.detailDialog.waitingHint)).toBeVisible({ timeout: 10000 });
7330
7458
  }
@@ -7342,7 +7470,9 @@ function getTraceRow(scope, questionText) {
7342
7470
  async function expandTrace(scope, questionText) {
7343
7471
  await getTraceRow(scope, questionText).click();
7344
7472
  // The manual-score form only exists on the expanded trace.
7345
- await test$1.expect(getEvaluationDetailDialog(scope).getByLabel(EVALS_LABELS.detailDialog.scoreNameLabel)).toBeVisible({ timeout: 10000 });
7473
+ await test$1.expect(getEvaluationDetailDialog(scope).getByLabel(EVALS_LABELS.detailDialog.scoreNameLabel, {
7474
+ exact: true,
7475
+ })).toBeVisible({ timeout: 10000 });
7346
7476
  }
7347
7477
  /**
7348
7478
  * Add a manual score to the currently expanded trace. `value` must be
@@ -7350,10 +7480,16 @@ async function expandTrace(scope, questionText) {
7350
7480
  */
7351
7481
  async function addManualScore(scope, opts) {
7352
7482
  const dialog = getEvaluationDetailDialog(scope);
7353
- await dialog.getByLabel(EVALS_LABELS.detailDialog.scoreNameLabel).fill(opts.name);
7354
- await dialog.getByLabel(EVALS_LABELS.detailDialog.scoreValueLabel).fill(String(opts.value));
7483
+ await dialog
7484
+ .getByLabel(EVALS_LABELS.detailDialog.scoreNameLabel, { exact: true })
7485
+ .fill(opts.name);
7486
+ await dialog
7487
+ .getByLabel(EVALS_LABELS.detailDialog.scoreValueLabel, { exact: true })
7488
+ .fill(String(opts.value));
7355
7489
  if (opts.comment !== undefined) {
7356
- await dialog.getByLabel(EVALS_LABELS.detailDialog.scoreCommentLabel).fill(opts.comment);
7490
+ await dialog
7491
+ .getByLabel(EVALS_LABELS.detailDialog.scoreCommentLabel, { exact: true })
7492
+ .fill(opts.comment);
7357
7493
  }
7358
7494
  await dialog
7359
7495
  .getByRole('button', { name: EVALS_LABELS.detailDialog.addScore, exact: true })
@@ -7367,7 +7503,7 @@ async function expectTraceScore(scope, scoreName) {
7367
7503
  }
7368
7504
  /**
7369
7505
  * Remove a score chip from the expanded trace. The chip's trash button
7370
- * carries `aria-label="Remove score"`; we scope through the chip matched by
7506
+ * carries `aria-label="Delete Score"`; we scope through the chip matched by
7371
7507
  * score name so multiple chips can't cross-match.
7372
7508
  */
7373
7509
  async function removeTraceScore(scope, scoreName) {
@@ -7413,22 +7549,33 @@ async function expandReview(scope, scoreName) {
7413
7549
  await row.click();
7414
7550
  await test$1.expect(row).toHaveAttribute('aria-expanded', 'true', { timeout: 5000 });
7415
7551
  }
7416
- /** Close the detail dialog via Escape and wait for it to be gone. */
7552
+ /** Close the detail dialog with its Close button and wait for it to be gone. */
7417
7553
  async function closeEvaluationDetailDialog(scope) {
7418
- const dialog = getEvaluationDetailDialog(scope);
7419
- await asPage$3(scope).keyboard.press('Escape');
7554
+ await closeDialogByButton(getEvaluationDetailDialog(scope));
7555
+ }
7556
+ // ── Manage Benchmarks dialog (embedded tenant Benchmarks) ──────────────
7557
+ /**
7558
+ * Close a dialog with its own Close (X) button. Not Escape: closing a child
7559
+ * dialog hands focus back to the icon button that opened it, which opens that
7560
+ * button's tooltip, and the next Escape then closes only the tooltip. The
7561
+ * detail dialog can also drop an Escape while it refreshes itself.
7562
+ */
7563
+ async function closeDialogByButton(dialog) {
7564
+ await dialog.getByRole('button', { name: EVALS_LABELS.dialogClose, exact: true }).click();
7420
7565
  await test$1.expect(dialog).toBeHidden({ timeout: 10000 });
7421
7566
  }
7422
- // ── Manage benchmarks dialog (embedded tenant Benchmarks) ──────────────
7423
- /** Locator for the "Manage benchmarks" dialog. Scoped by aria-label — its title collides with the toolbar button that opens it. */
7567
+ /** Locator for the "Manage Benchmarks" dialog. Scoped by aria-label — its title collides with the toolbar button that opens it. */
7424
7568
  function getManageBenchmarksDialog(scope) {
7425
7569
  return dialogByName(scope, EVALS_LABELS.manageBenchmarksDialog.dialogName);
7426
7570
  }
7427
- /** Open the Manage benchmarks dialog from the toolbar and wait for its table UI. Returns the scoped dialog. */
7571
+ /** Open the Manage Benchmarks dialog from the toolbar and wait for its toolbar. Returns the scoped dialog. */
7428
7572
  async function openManageBenchmarksDialog(scope) {
7429
7573
  await getManageBenchmarksButton(scope).click();
7430
7574
  const dialog = getManageBenchmarksDialog(scope);
7431
- await test$1.expect(dialog.getByRole('button', { name: EVALS_LABELS.manageBenchmarksDialog.newBenchmark })).toBeVisible({ timeout: 10000 });
7575
+ await test$1.expect(dialog.getByRole('button', {
7576
+ name: EVALS_LABELS.manageBenchmarksDialog.newBenchmark,
7577
+ exact: true,
7578
+ })).toBeVisible({ timeout: 10000 });
7432
7579
  return dialog;
7433
7580
  }
7434
7581
  /** Type into the benchmarks search input (aria-label "Search benchmarks") inside the manage dialog. */
@@ -7441,65 +7588,187 @@ async function searchBenchmarks(scope, query) {
7441
7588
  async function expectBenchmarkListed(scope, benchmarkName) {
7442
7589
  await test$1.expect(getManageBenchmarksDialog(scope).getByText(benchmarkName, { exact: true }).first()).toBeVisible({ timeout: 15000 });
7443
7590
  }
7591
+ /**
7592
+ * Show the Manual or CSV Upload tab of the Q&A form inside `dialog` and
7593
+ * return its panel. The panel is looked up by its tab's name, because the New
7594
+ * Benchmark dialog's Q&A step is a tabpanel around this one.
7595
+ */
7596
+ async function showQaFormTab(dialog, subTab) {
7597
+ const tabName = subTab === 'manual'
7598
+ ? EVALS_LABELS.addItemsDialog.manualTab
7599
+ : EVALS_LABELS.addItemsDialog.csvTab;
7600
+ const tab = dialog.getByRole('tab', { name: tabName, exact: true });
7601
+ await tab.click();
7602
+ await test$1.expect(tab).toHaveAttribute('data-state', 'active', { timeout: 5000 });
7603
+ const panel = dialog.getByRole('tabpanel', { name: tabName, exact: true });
7604
+ await test$1.expect(panel).toBeVisible({ timeout: 5000 });
7605
+ return panel;
7606
+ }
7607
+ /** Type one Q&A pair per row on the Manual tab of the Q&A form inside `dialog`, adding rows as needed. */
7608
+ async function fillQaRows(dialog, pairs) {
7609
+ const panel = await showQaFormTab(dialog, 'manual');
7610
+ for (let i = 0; i < pairs.length; i++) {
7611
+ if (i > 0) {
7612
+ await panel
7613
+ .getByRole('button', { name: EVALS_LABELS.addItemsDialog.addRow, exact: true })
7614
+ .click();
7615
+ }
7616
+ const question = panel
7617
+ .getByLabel(EVALS_LABELS.addItemsDialog.questionLabel, { exact: true })
7618
+ .nth(i);
7619
+ await test$1.expect(question).toBeVisible({ timeout: 5000 });
7620
+ await question.fill(pairs[i].question);
7621
+ const answer = pairs[i].answer;
7622
+ if (answer !== undefined) {
7623
+ await panel
7624
+ .getByLabel(EVALS_LABELS.addItemsDialog.answerLabel, { exact: true })
7625
+ .nth(i)
7626
+ .fill(answer);
7627
+ }
7628
+ }
7629
+ }
7630
+ /** Choose a CSV file on the CSV Upload tab of the Q&A form inside `dialog`. */
7631
+ async function chooseQaCsv(dialog, csvPath) {
7632
+ const panel = await showQaFormTab(dialog, 'csv');
7633
+ await panel
7634
+ .getByLabel(EVALS_LABELS.addItemsDialog.csvFileLabel, { exact: true })
7635
+ .setInputFiles(csvPath);
7636
+ }
7637
+ // ── New Benchmark dialog ───────────────────────────────────────────────
7444
7638
  /** Locator for the "New Benchmark" dialog. Scoped by aria-label — its title collides with the button that opens it. */
7445
7639
  function getCreateBenchmarkDialog(scope) {
7446
7640
  return dialogByName(scope, EVALS_LABELS.createBenchmarkDialog.dialogName);
7447
7641
  }
7448
7642
  /**
7449
- * Create a benchmark from inside the manage dialog: open "New Benchmark",
7450
- * fill the form, submit, and wait for both the dialog to close and the new
7451
- * row to appear.
7643
+ * Click "New Benchmark" in the open Manage Benchmarks dialog and wait for the
7644
+ * New Benchmark dialog on its Details step. Returns the dialog.
7452
7645
  */
7453
- async function createBenchmark(scope, opts) {
7454
- const manageDialog = getManageBenchmarksDialog(scope);
7455
- await manageDialog
7456
- .getByRole('button', { name: EVALS_LABELS.manageBenchmarksDialog.newBenchmark })
7646
+ async function openCreateBenchmarkDialog(scope) {
7647
+ await getManageBenchmarksDialog(scope)
7648
+ .getByRole('button', { name: EVALS_LABELS.manageBenchmarksDialog.newBenchmark, exact: true })
7457
7649
  .click();
7458
7650
  const dialog = getCreateBenchmarkDialog(scope);
7459
- await dialog.getByLabel(EVALS_LABELS.createBenchmarkDialog.nameLabel).fill(opts.name);
7651
+ await test$1.expect(dialog.getByLabel(EVALS_LABELS.createBenchmarkDialog.nameLabel, { exact: true })).toBeVisible({ timeout: 10000 });
7652
+ return dialog;
7653
+ }
7654
+ /**
7655
+ * Click "Next" on the Details step of the open New Benchmark dialog and wait
7656
+ * for the Q&A step: its tab active and its note showing. "Next" is disabled
7657
+ * until Name has text. Returns the dialog.
7658
+ */
7659
+ async function goToBenchmarkQaStep(scope) {
7660
+ const labels = EVALS_LABELS.createBenchmarkDialog;
7661
+ const dialog = getCreateBenchmarkDialog(scope);
7662
+ await dialog.getByRole('button', { name: labels.next, exact: true }).click();
7663
+ await test$1.expect(dialog.getByRole('tab', { name: labels.qaTab, exact: true })).toHaveAttribute('data-state', 'active', { timeout: 5000 });
7664
+ // The Q&A step stays mounted while Details shows, so the note is checked for being on screen.
7665
+ const hint = dialog.getByTestId(labels.qaHintTestId);
7666
+ await test$1.expect(hint).toBeVisible({ timeout: 5000 });
7667
+ await test$1.expect(hint).toHaveText(labels.qaHint);
7668
+ return dialog;
7669
+ }
7670
+ // A CSV's count is not known here, and a large one is written with separators ("1,000").
7671
+ const CREATED_FROM_CSV_TOAST = /^Benchmark created with \S+ Q&A pairs?$/;
7672
+ /**
7673
+ * Fill both steps of the open New Benchmark dialog, submit, and wait for it to
7674
+ * close and for the toast that fits what was created.
7675
+ */
7676
+ async function submitCreateBenchmark(scope, opts) {
7677
+ var _a;
7678
+ const labels = EVALS_LABELS.createBenchmarkDialog;
7679
+ const dialog = getCreateBenchmarkDialog(scope);
7680
+ await dialog.getByLabel(labels.nameLabel, { exact: true }).fill(opts.name);
7460
7681
  if (opts.description !== undefined) {
7461
- await dialog
7462
- .getByLabel(EVALS_LABELS.createBenchmarkDialog.descriptionLabel)
7463
- .fill(opts.description);
7682
+ await dialog.getByLabel(labels.descriptionLabel, { exact: true }).fill(opts.description);
7683
+ }
7684
+ await goToBenchmarkQaStep(scope);
7685
+ const qaPairs = (_a = opts.qaPairs) !== null && _a !== void 0 ? _a : [];
7686
+ let createdToast = labels.successToastNoQa;
7687
+ if (opts.csvPath !== undefined) {
7688
+ await chooseQaCsv(dialog, opts.csvPath);
7689
+ createdToast = CREATED_FROM_CSV_TOAST;
7690
+ }
7691
+ else if (qaPairs.length > 0) {
7692
+ await fillQaRows(dialog, qaPairs);
7693
+ // The form leaves out a row whose question is blank.
7694
+ const saved = qaPairs.filter((pair) => pair.question.trim()).length;
7695
+ if (saved > 0) {
7696
+ createdToast = `Benchmark created with ${saved} Q&A pair${saved === 1 ? '' : 's'}`;
7697
+ }
7464
7698
  }
7465
- const submit = dialog.getByRole('button', {
7466
- name: EVALS_LABELS.createBenchmarkDialog.create,
7467
- exact: true,
7468
- });
7699
+ const submit = dialog.getByRole('button', { name: labels.create, exact: true });
7469
7700
  await test$1.expect(submit).toBeEnabled({ timeout: 5000 });
7470
7701
  await submit.click();
7471
- await test$1.expect(dialog).toBeHidden({ timeout: 15000 });
7702
+ // One click creates the benchmark and then saves its Q&A; the dialog closes after both.
7703
+ await test$1.expect(dialog).toBeHidden({ timeout: 30000 });
7704
+ // Checked here, right after the dialog closes: the toast is gone within seconds.
7705
+ await test$1.expect(getToast(scope, createdToast)).toBeVisible({ timeout: 10000 });
7706
+ }
7707
+ /**
7708
+ * Create a benchmark from inside the manage dialog: open "New Benchmark", fill
7709
+ * Name and Description, click "Next", fill the Q&A step when `qaPairs` or
7710
+ * `csvPath` is given, click "Create", and wait for the dialog to close, the
7711
+ * toast, and the new row. The Evals tab selects the new benchmark.
7712
+ *
7713
+ * Q&A is optional: with neither `qaPairs` nor `csvPath` the benchmark is
7714
+ * created without any, and "New Evaluation" stays disabled for it until Q&A
7715
+ * are added (see `expectBenchmarkNeedsQa`).
7716
+ */
7717
+ async function createBenchmark(scope, opts) {
7718
+ await openCreateBenchmarkDialog(scope);
7719
+ await submitCreateBenchmark(scope, opts);
7472
7720
  await expectBenchmarkListed(scope, opts.name);
7473
7721
  logger.info(`Created benchmark: ${opts.name}`);
7474
7722
  }
7475
- /** Locator for a benchmark's items dialog (Q&A list). Its title is the benchmark name (dynamic), hence the aria-label hook. */
7723
+ /**
7724
+ * Create an organization's first benchmark from the Evals tab's no-benchmarks
7725
+ * empty state: click its "New Benchmark" button, fill and submit the dialog as
7726
+ * `createBenchmark` does (Q&A optional), and wait for the tab to select the
7727
+ * new benchmark.
7728
+ */
7729
+ async function createBenchmarkFromEmptyState(scope, opts) {
7730
+ await getNoBenchmarksEmptyState(scope)
7731
+ .getByRole('button', { name: EVALS_LABELS.actions.newBenchmark, exact: true })
7732
+ .click();
7733
+ await submitCreateBenchmark(scope, opts);
7734
+ await expectSelectedBenchmark(scope, opts.name);
7735
+ logger.info(`Created benchmark: ${opts.name}`);
7736
+ }
7737
+ // ── Benchmark Q&A dialogs ──────────────────────────────────────────────
7738
+ /** Locator for a benchmark's Q&A dialog. Its title is the benchmark name (dynamic), hence the aria-label hook. */
7476
7739
  function getBenchmarkItemsDialog(scope) {
7477
7740
  return dialogByName(scope, EVALS_LABELS.benchmarkItemsDialog.dialogName);
7478
7741
  }
7479
7742
  /**
7480
- * Open a benchmark's Q&A items dialog from its row's eye button
7481
- * (`aria-label="View items in <name>"`). Returns the scoped items dialog.
7743
+ * Open a benchmark's Q&A dialog from its row's eye button
7744
+ * (`aria-label="View Q&A in <name>"`). Returns the scoped Q&A dialog.
7482
7745
  */
7483
7746
  async function openBenchmarkItems(scope, benchmarkName) {
7484
7747
  await getManageBenchmarksDialog(scope)
7485
- .getByRole('button', { name: `View items in ${benchmarkName}`, exact: true })
7748
+ .getByRole('button', { name: `View Q&A in ${benchmarkName}`, exact: true })
7486
7749
  .click();
7487
7750
  const dialog = getBenchmarkItemsDialog(scope);
7488
- await test$1.expect(dialog.getByRole('button', { name: EVALS_LABELS.benchmarkItemsDialog.addItems })).toBeVisible({ timeout: 10000 });
7751
+ await test$1.expect(dialog.getByRole('button', { name: EVALS_LABELS.benchmarkItemsDialog.addItems, exact: true })).toBeVisible({ timeout: 10000 });
7489
7752
  return dialog;
7490
7753
  }
7491
- /** Assert a Q&A item (matched by its question text) is listed in the items dialog. */
7754
+ /** Assert a Q&A pair (matched by its question text) is listed in the Q&A dialog. */
7492
7755
  async function expectQaItemListed(scope, questionText) {
7493
7756
  await test$1.expect(getBenchmarkItemsDialog(scope).getByText(questionText, { exact: false }).first()).toBeVisible({ timeout: 15000 });
7494
7757
  }
7758
+ /** Assert the Q&A dialog says the benchmark has no Q&A and offers "Add Q&A" as the next step. */
7759
+ async function expectBenchmarkItemsEmpty(scope) {
7760
+ const dialog = getBenchmarkItemsDialog(scope);
7761
+ await test$1.expect(dialog.getByText(EVALS_LABELS.benchmarkItemsDialog.empty, { exact: true })).toBeVisible({ timeout: 15000 });
7762
+ await test$1.expect(dialog.getByRole('button', { name: EVALS_LABELS.benchmarkItemsDialog.addItems, exact: true })).toBeVisible();
7763
+ }
7495
7764
  /** Locator for the "Add Q&A" dialog (Manual / CSV Upload sub-tabs). */
7496
7765
  function getAddItemsDialog(scope) {
7497
7766
  return dialogByName(scope, EVALS_LABELS.addItemsDialog.dialogName);
7498
7767
  }
7499
- /** Open the "Add Q&A" dialog from the items dialog. Returns the scoped add dialog. */
7768
+ /** Open the "Add Q&A" dialog from a benchmark's Q&A dialog. Returns the scoped add dialog. */
7500
7769
  async function openAddItemsDialog(scope) {
7501
7770
  await getBenchmarkItemsDialog(scope)
7502
- .getByRole('button', { name: EVALS_LABELS.benchmarkItemsDialog.addItems })
7771
+ .getByRole('button', { name: EVALS_LABELS.benchmarkItemsDialog.addItems, exact: true })
7503
7772
  .click();
7504
7773
  const dialog = getAddItemsDialog(scope);
7505
7774
  // Both sub-tab triggers are unique to this dialog — a reliable ready signal.
@@ -7509,61 +7778,35 @@ async function openAddItemsDialog(scope) {
7509
7778
  /**
7510
7779
  * Switch to a sub-tab INSIDE the Add Q&A dialog. The tab query must stay
7511
7780
  * dialog-scoped: the edit-mentor modal behind it has its own `role="tab"`
7512
- * strip, and an unscoped `getByRole('tab')` can cross-match. Returns the
7513
- * active tabpanel so callers interact only with that sub-tab's controls
7514
- * (each panel has its own footer with its own Cancel/submit buttons).
7781
+ * strip, and an unscoped `getByRole('tab')` can cross-match. Returns that
7782
+ * sub-tab's tabpanel, which holds its fields; Cancel and the submit
7783
+ * button ("Add" or "Upload") are in the dialog's one footer, outside it.
7515
7784
  */
7516
7785
  async function switchToAddItemsSubTab(scope, subTab) {
7517
- const dialog = getAddItemsDialog(scope);
7518
- const tabName = subTab === 'manual'
7519
- ? EVALS_LABELS.addItemsDialog.manualTab
7520
- : EVALS_LABELS.addItemsDialog.csvTab;
7521
- const tab = dialog.getByRole('tab', { name: tabName, exact: true });
7522
- await tab.click();
7523
- await test$1.expect(tab).toHaveAttribute('data-state', 'active', { timeout: 5000 });
7524
- const panel = dialog.getByRole('tabpanel');
7525
- await test$1.expect(panel).toBeVisible({ timeout: 5000 });
7526
- return panel;
7786
+ return showQaFormTab(getAddItemsDialog(scope), subTab);
7527
7787
  }
7528
7788
  /**
7529
- * Add Q&A pairs via the Manual sub-tab. Fills one row per pair (clicking
7530
- * "Add row" as needed), submits, and waits for the dialog to close. Row
7531
- * inputs are matched by label WITHIN each row container so the Question /
7532
- * Answer labels of sibling rows can't collide.
7789
+ * Add Q&A pairs via the Manual sub-tab of the open Add Q&A dialog. Fills one
7790
+ * row per pair (clicking "Add Row" as needed), submits, and waits for the
7791
+ * dialog to close.
7533
7792
  */
7534
7793
  async function addQaPairsManually(scope, pairs) {
7535
7794
  const dialog = getAddItemsDialog(scope);
7536
- const panel = await switchToAddItemsSubTab(scope, 'manual');
7537
- for (let i = 0; i < pairs.length; i++) {
7538
- if (i > 0) {
7539
- await panel
7540
- .getByRole('button', { name: EVALS_LABELS.addItemsDialog.addRow, exact: true })
7541
- .click();
7542
- }
7543
- const question = panel.getByLabel(EVALS_LABELS.addItemsDialog.questionLabel).nth(i);
7544
- await test$1.expect(question).toBeVisible({ timeout: 5000 });
7545
- await question.fill(pairs[i].question);
7546
- if (pairs[i].answer !== undefined) {
7547
- await panel
7548
- .getByLabel(EVALS_LABELS.addItemsDialog.answerLabel)
7549
- .nth(i)
7550
- .fill(pairs[i].answer);
7551
- }
7552
- }
7553
- await panel.getByRole('button', { name: EVALS_LABELS.addItemsDialog.add, exact: true }).click();
7795
+ await fillQaRows(dialog, pairs);
7796
+ await dialog.getByRole('button', { name: EVALS_LABELS.addItemsDialog.add, exact: true }).click();
7554
7797
  await test$1.expect(dialog).toBeHidden({ timeout: 15000 });
7555
7798
  logger.info(`Added ${pairs.length} Q&A pair(s) manually`);
7556
7799
  }
7557
7800
  /**
7558
- * Upload Q&A pairs via the CSV Upload sub-tab. `csvPath` is a path on the
7559
- * test machine; the file needs `input` (required) and `expected_output`
7560
- * (optional) columns. Waits for the dialog to close on success.
7801
+ * Upload Q&A pairs via the CSV Upload sub-tab of the open Add Q&A dialog.
7802
+ * `csvPath` is a path on the test machine; the file needs `input` (required)
7803
+ * and `expected_output` (optional) columns. Waits for the dialog to close on
7804
+ * success.
7561
7805
  */
7562
7806
  async function uploadQaCsv(scope, csvPath) {
7563
7807
  const dialog = getAddItemsDialog(scope);
7564
- const panel = await switchToAddItemsSubTab(scope, 'csv');
7565
- await panel.getByLabel(EVALS_LABELS.addItemsDialog.csvFileLabel).setInputFiles(csvPath);
7566
- await panel
7808
+ await chooseQaCsv(dialog, csvPath);
7809
+ await dialog
7567
7810
  .getByRole('button', { name: EVALS_LABELS.addItemsDialog.upload, exact: true })
7568
7811
  .click();
7569
7812
  await test$1.expect(dialog).toBeHidden({ timeout: 30000 });
@@ -7574,16 +7817,19 @@ function getDeleteQaItemDialog(scope) {
7574
7817
  return dialogByName(scope, EVALS_LABELS.deleteItemDialog.dialogName);
7575
7818
  }
7576
7819
  /**
7577
- * Delete a Q&A item by its question text: click the row's trash button
7820
+ * Delete a Q&A pair by its question text: click the row's bin button
7578
7821
  * (`aria-label="Delete Q&A"`) and confirm. The confirm "Delete" button must
7579
- * stay scoped to the confirm dialog — the items dialog's rows keep their
7580
- * own delete buttons mounted behind it.
7822
+ * stay scoped to the confirm dialog — the Q&A dialog's rows keep their own
7823
+ * delete buttons mounted behind it.
7581
7824
  */
7582
7825
  async function deleteQaItem(scope, questionText) {
7583
7826
  const itemsDialog = getBenchmarkItemsDialog(scope);
7584
7827
  const row = itemsDialog.getByRole('row').filter({ hasText: questionText }).first();
7585
7828
  await row
7586
- .getByRole('button', { name: EVALS_LABELS.benchmarkItemsDialog.deleteItemAriaLabel })
7829
+ .getByRole('button', {
7830
+ name: EVALS_LABELS.benchmarkItemsDialog.deleteItemAriaLabel,
7831
+ exact: true,
7832
+ })
7587
7833
  .click();
7588
7834
  const confirmDialog = getDeleteQaItemDialog(scope);
7589
7835
  const confirm = confirmDialog.getByRole('button', {
@@ -7595,17 +7841,13 @@ async function deleteQaItem(scope, questionText) {
7595
7841
  await test$1.expect(confirmDialog).toBeHidden({ timeout: 15000 });
7596
7842
  logger.info(`Deleted Q&A item: ${questionText}`);
7597
7843
  }
7598
- /** Close the benchmark items dialog via Escape and wait for it to be gone. */
7844
+ /** Close a benchmark's Q&A dialog with its Close button and wait for it to be gone. */
7599
7845
  async function closeBenchmarkItemsDialog(scope) {
7600
- const dialog = getBenchmarkItemsDialog(scope);
7601
- await asPage$3(scope).keyboard.press('Escape');
7602
- await test$1.expect(dialog).toBeHidden({ timeout: 10000 });
7846
+ await closeDialogByButton(getBenchmarkItemsDialog(scope));
7603
7847
  }
7604
- /** Close the Manage benchmarks dialog via Escape and wait for it to be gone. */
7848
+ /** Close the Manage Benchmarks dialog with its Close button and wait for it to be gone. */
7605
7849
  async function closeManageBenchmarksDialog(scope) {
7606
- const dialog = getManageBenchmarksDialog(scope);
7607
- await asPage$3(scope).keyboard.press('Escape');
7608
- await test$1.expect(dialog).toBeHidden({ timeout: 10000 });
7850
+ await closeDialogByButton(getManageBenchmarksDialog(scope));
7609
7851
  }
7610
7852
 
7611
7853
  /**
@@ -9227,6 +9469,7 @@ exports.copyEndpoint = copyEndpoint;
9227
9469
  exports.createAgentSpendLimitViaFilter = createAgentSpendLimitViaFilter;
9228
9470
  exports.createAuthSetup = createAuthSetup;
9229
9471
  exports.createBenchmark = createBenchmark;
9472
+ exports.createBenchmarkFromEmptyState = createBenchmarkFromEmptyState;
9230
9473
  exports.createEnvConfig = createEnvConfig;
9231
9474
  exports.createInstance = createInstance;
9232
9475
  exports.createKey = createKey;
@@ -9275,7 +9518,9 @@ exports.expandReview = expandReview;
9275
9518
  exports.expandTrace = expandTrace;
9276
9519
  exports.expectAgentLimitsRowContent = expectAgentLimitsRowContent;
9277
9520
  exports.expectAllEndpointsVisible = expectAllEndpointsVisible;
9521
+ exports.expectBenchmarkItemsEmpty = expectBenchmarkItemsEmpty;
9278
9522
  exports.expectBenchmarkListed = expectBenchmarkListed;
9523
+ exports.expectBenchmarkNeedsQa = expectBenchmarkNeedsQa;
9279
9524
  exports.expectBillingAutoRechargeSection = expectBillingAutoRechargeSection;
9280
9525
  exports.expectBillingCreditsSection = expectBillingCreditsSection;
9281
9526
  exports.expectBillingPlanSection = expectBillingPlanSection;
@@ -9450,6 +9695,8 @@ exports.getManageBenchmarksDialog = getManageBenchmarksDialog;
9450
9695
  exports.getMemoryCount = getMemoryCount;
9451
9696
  exports.getMentorIdFromUrl = getMentorIdFromUrl;
9452
9697
  exports.getNewEvaluationButton = getNewEvaluationButton;
9698
+ exports.getNoBenchmarksEmptyState = getNoBenchmarksEmptyState;
9699
+ exports.getNoQaPrompt = getNoQaPrompt;
9453
9700
  exports.getOutputFilterSwitch = getOutputFilterSwitch;
9454
9701
  exports.getPaginationInfo = getPaginationInfo;
9455
9702
  exports.getPlanPickerKeys = getPlanPickerKeys;
@@ -9484,6 +9731,7 @@ exports.getTraceRow = getTraceRow;
9484
9731
  exports.getUserFilter = getUserFilter;
9485
9732
  exports.getVoiceProviderCard = getVoiceProviderCard;
9486
9733
  exports.getVoiceRow = getVoiceRow;
9734
+ exports.goToBenchmarkQaStep = goToBenchmarkQaStep;
9487
9735
  exports.goToFirstPage = goToFirstPage;
9488
9736
  exports.goToLastPage = goToLastPage;
9489
9737
  exports.goToNextPage = goToNextPage;
@@ -9529,11 +9777,13 @@ exports.navigateToReportDownload = navigateToReportDownload;
9529
9777
  exports.newUserDefaultSection = newUserDefaultSection;
9530
9778
  exports.openAddItemsDialog = openAddItemsDialog;
9531
9779
  exports.openAddMemoryDialog = openAddMemoryDialog;
9780
+ exports.openAddQaFromEvalsTab = openAddQaFromEvalsTab;
9532
9781
  exports.openAgentLimitsManage = openAgentLimitsManage;
9533
9782
  exports.openAgentMemoriesPopup = openAgentMemoriesPopup;
9534
9783
  exports.openAgentPromptEditModal = openAgentPromptEditModal;
9535
9784
  exports.openBenchmarkItems = openBenchmarkItems;
9536
9785
  exports.openCallConfigVoicePicker = openCallConfigVoicePicker;
9786
+ exports.openCreateBenchmarkDialog = openCreateBenchmarkDialog;
9537
9787
  exports.openCreateKeyModal = openCreateKeyModal;
9538
9788
  exports.openCreateLinkModal = openCreateLinkModal;
9539
9789
  exports.openCreateToolModal = openCreateToolModal;