(context, name)
| 4834 | return fileName |
| 4835 | } |
| 4836 | async function saveTraceForContext(context, name) { |
| 4837 | if (!context) return |
| 4838 | if (!context.tracing) return |
| 4839 | try { |
| 4840 | const fileName = `${`${store.outputDir}${pathSeparator}trace${pathSeparator}${uuidv4()}_${clearString(name)}`.slice(0, 245)}.zip` |
| 4841 | await context.tracing.stop({ path: fileName }) |
| 4842 | return fileName |
| 4843 | } catch (err) { |
| 4844 | // Handle the case where tracing was not started or context is invalid |
| 4845 | if (err.message && err.message.includes('Must start tracing before stopping')) { |
| 4846 | // Tracing was never started on this context, silently skip |
| 4847 | return null |
| 4848 | } |
| 4849 | throw err |
| 4850 | } |
| 4851 | } |
| 4852 | |
| 4853 | async function highlightActiveElement(element) { |
| 4854 | if ((this.options.highlightElement || store.onPause) && store.debugMode) { |
no test coverage detected