MCPcopy
hub / github.com/codeceptjs/CodeceptJS / saveElementScreenshot

Method saveElementScreenshot

lib/helper/WebDriver.js:1984–1993  ·  view source on GitHub ↗

* {{> saveElementScreenshot }} *

(locator, fileName)

Source from the content-addressed store, hash-verified

1982 *
1983 */
1984 async saveElementScreenshot(locator, fileName) {
1985 const outputFile = screenshotOutputFolder(fileName)
1986
1987 const res = await this._locate(withStrictLocator(locator), true)
1988 assertElementExists(res, locator)
1989 const elem = usingFirstElement(res)
1990
1991 this.debug(`Screenshot of ${new Locator(locator)} element has been saved to ${outputFile}`)
1992 return elem.saveScreenshot(outputFile)
1993 }
1994
1995 /**
1996 * {{> saveScreenshot }}

Callers

nothing calls this directly

Calls 7

_locateMethod · 0.95
screenshotOutputFolderFunction · 0.90
withStrictLocatorFunction · 0.85
usingFirstElementFunction · 0.85
debugMethod · 0.80
assertElementExistsFunction · 0.70
saveScreenshotMethod · 0.45

Tested by

no test coverage detected