(path, method = 'GET', body)
| 33 | attachPageIssueListeners(page, issues); |
| 34 | |
| 35 | const api = (path, method = 'GET', body) => page.evaluate(async ({path, method, body}) => { |
| 36 | const response = await fetch(OC.generateUrl('apps/analytics/' + path), { |
| 37 | method, |
| 38 | headers: OCA.Analytics.headers(), |
| 39 | body: body === undefined ? undefined : JSON.stringify(body), |
| 40 | }); |
| 41 | const data = await response.json().catch(() => null); |
| 42 | if (!response.ok) { |
| 43 | throw new Error(data?.error?.message || data?.message || `HTTP ${response.status}`); |
| 44 | } |
| 45 | return {status: response.status, data}; |
| 46 | }, {path, method, body}); |
| 47 | |
| 48 | try { |
| 49 | steps.push('open analytics and create a classic dataset alongside the flexible one'); |
no test coverage detected