* Captures screenshots (png format) & dumpts into root directory (only on CI). * If there's a failure, it will be logged (errors are swallowed).
(contextOrFileName: string | Mocha.Context)
| 16 | * If there's a failure, it will be logged (errors are swallowed). |
| 17 | */ |
| 18 | async function captureScreenShot(contextOrFileName: string | Mocha.Context) { |
| 19 | if (!isCI) { |
| 20 | return; |
| 21 | } |
| 22 | const filename = await generateScreenShotFileName(contextOrFileName); |
| 23 | try { |
| 24 | await ClientAPI.captureScreenShot(filename); |
| 25 | console.info(`Screenshot captured into ${filename}`); |
| 26 | } catch (ex) { |
| 27 | console.error(`Failed to capture screenshot into ${filename}`, ex); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | export function initializeCommonWebApi() { |
| 32 | initializeCommonApi({ |
nothing calls this directly
no test coverage detected