MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / saveElementScreenshot

Method saveElementScreenshot

lib/helper/Playwright.js:2948–2955  ·  view source on GitHub ↗

* {{> saveElementScreenshot }} *

(locator, fileName)

Source from the content-addressed store, hash-verified

2946 *
2947 */
2948 async saveElementScreenshot(locator, fileName) {
2949 const outputFile = screenshotOutputFolder(fileName)
2950
2951 const res = await this._locateElement(locator)
2952 assertElementExists(res, locator)
2953 const elem = res
2954 return elem.screenshot({ path: outputFile, type: 'png' })
2955 }
2956
2957 /**
2958 * {{> saveScreenshot }}

Callers

nothing calls this directly

Calls 3

_locateElementMethod · 0.95
screenshotOutputFolderFunction · 0.90
assertElementExistsFunction · 0.70

Tested by

no test coverage detected