MCPcopy Create free account
hub / github.com/TanStack/ai / getMetadata

Function getMetadata

testing/e2e/tests/tools-test/helpers.ts:245–269  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

243 * Read all data-* attributes from #test-metadata.
244 */
245export async function getMetadata(page: Page): Promise<Record<string, string>> {
246 return page.evaluate(() => {
247 const el = document.getElementById('test-metadata')
248 if (!el) return {}
249 return {
250 scenario: el.getAttribute('data-scenario') || '',
251 isLoading: el.getAttribute('data-is-loading') || '',
252 testComplete: el.getAttribute('data-test-complete') || '',
253 toolCallCount: el.getAttribute('data-tool-call-count') || '',
254 pendingApprovalCount:
255 el.getAttribute('data-pending-approval-count') || '',
256 completeToolCount: el.getAttribute('data-complete-tool-count') || '',
257 eventCount: el.getAttribute('data-event-count') || '',
258 executionStartCount: el.getAttribute('data-execution-start-count') || '',
259 executionCompleteCount:
260 el.getAttribute('data-execution-complete-count') || '',
261 approvalGrantedCount:
262 el.getAttribute('data-approval-granted-count') || '',
263 approvalDeniedCount: el.getAttribute('data-approval-denied-count') || '',
264 hasError: el.getAttribute('data-has-error') || '',
265 errorMessage: el.getAttribute('data-error-message') || '',
266 errorRawEvent: el.getAttribute('data-error-raw-event') || '',
267 }
268 })
269}
270
271/**
272 * Parse the JSON event log from #event-log-json.

Calls 1

getAttributeMethod · 0.80

Tested by

no test coverage detected