MCPcopy Create free account
hub / github.com/angular/components / storeScreenshot

Method storeScreenshot

docs/scenes/e2e/screenshot.ts:43–52  ·  view source on GitHub ↗

Replaces the existing screenshot with the newly generated one.

(png: string)

Source from the content-addressed store, hash-verified

41
42 /** Replaces the existing screenshot with the newly generated one. */
43 storeScreenshot(png: string) {
44 try {
45 if (!fs.existsSync(OUTPUT_DIR)) {
46 fs.mkdirSync(OUTPUT_DIR, {recursive: true});
47 }
48 fs.writeFileSync(this.fullPath, png, {encoding: 'base64'});
49 } catch {
50 // In read-only test sandbox environments, writing to source tree is not permitted.
51 }
52 }
53}
54
55export function screenshot(id: string, wd: webdriver.WebDriver): Promise<void> {

Callers 1

takeScreenshotMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected