From 1ec4835dcac769d0711bbfeaa63b4e1743fde265 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Feb 2023 16:25:52 +0100 Subject: Create screenshots directory when needed --- client/e2e/src/utils/files.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 client/e2e/src/utils/files.ts (limited to 'client/e2e/src/utils/files.ts') diff --git a/client/e2e/src/utils/files.ts b/client/e2e/src/utils/files.ts new file mode 100644 index 000000000..c532c987e --- /dev/null +++ b/client/e2e/src/utils/files.ts @@ -0,0 +1,17 @@ +import { mkdirSync } from 'fs' +import { join } from 'path' + +const SCREENSHOTS_DIRECTORY = 'screenshots' + +function createScreenshotsDirectory () { + mkdirSync(SCREENSHOTS_DIRECTORY, { recursive: true }) +} + +function getScreenshotPath (filename: string) { + return join(SCREENSHOTS_DIRECTORY, filename) +} + +export { + createScreenshotsDirectory, + getScreenshotPath +} -- cgit v1.2.3