ActivityPub-federated video streaming platform using P2P directly in your web browser
Create screenshots directory when needed
Chocobozzz1ec4835dcac7
diff --git a/client/e2e/src/suites-local/signup.e2e-spec.ts b/client/e2e/src/suites-local/signup.e2e-spec.tsindex b6f7ad1a78..7c822a6e67 100644--- a/client/e2e/src/suites-local/signup.e2e-spec.ts+++ b/client/e2e/src/suites-local/signup.e2e-spec.ts@@ -2,7 +2,16 @@ import { AdminConfigPage } from '../po/admin-config.po'import { AdminRegistrationPage } from '../po/admin-registration.po'import { LoginPage } from '../po/login.po'import { SignupPage } from '../po/signup.po'-import { browserSleep, getVerificationLink, go, findEmailTo, isMobileDevice, MockSMTPServer, waitServerUp } from '../utils'+import {+ browserSleep,+ findEmailTo,+ getScreenshotPath,+ getVerificationLink,+ go,+ isMobileDevice,+ MockSMTPServer,+ waitServerUp+} from '../utils'function checkEndMessage (options: {message: string@@ -155,7 +164,7 @@ describe('Signup', () => {afterEmailVerification: false})- await browser.saveScreenshot('./screenshots/direct-without-email.png')+ await browser.saveScreenshot(getScreenshotPath('direct-without-email.png'))await loginPage.logout()})@@ -203,7 +212,7 @@ describe('Signup', () => {afterEmailVerification: false})- await browser.saveScreenshot('./screenshots/request-without-email.png')+ await browser.saveScreenshot(getScreenshotPath('request-without-email.png'))})it('Should display a message when trying to login with this account', async function () {@@ -283,7 +292,7 @@ describe('Signup', () => {afterEmailVerification: false})- await browser.saveScreenshot('./screenshots/direct-with-email.png')+ await browser.saveScreenshot(getScreenshotPath('direct-with-email.png'))})it('Should validate the email', async function () {@@ -304,7 +313,7 @@ describe('Signup', () => {afterEmailVerification: true})- await browser.saveScreenshot('./screenshots/direct-after-email.png')+ await browser.saveScreenshot(getScreenshotPath('direct-after-email.png'))})})@@ -355,7 +364,7 @@ describe('Signup', () => {afterEmailVerification: false})- await browser.saveScreenshot('./screenshots/request-with-email.png')+ await browser.saveScreenshot(getScreenshotPath('request-with-email.png'))})it('Should display a message when trying to login with this account', async function () {@@ -391,7 +400,7 @@ describe('Signup', () => {afterEmailVerification: true})- await browser.saveScreenshot('./screenshots/request-after-email.png')+ await browser.saveScreenshot(getScreenshotPath('request-after-email.png'))})})diff --git a/client/e2e/src/utils/files.ts b/client/e2e/src/utils/files.tsnew file mode 100644index 0000000000..c532c987e4--- /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+}diff --git a/client/e2e/src/utils/hooks.ts b/client/e2e/src/utils/hooks.tsindex 7fe2476810..8baf9fb441 100644--- a/client/e2e/src/utils/hooks.ts+++ b/client/e2e/src/utils/hooks.ts@@ -1,7 +1,8 @@import { ChildProcessWithoutNullStreams } from 'child_process'import { basename } from 'path'-import { runCommand, runServer } from './server'import { setValue } from '@wdio/shared-store-service'+import { createScreenshotsDirectory } from './files'+import { runCommand, runServer } from './server'let appInstance: numberlet app: ChildProcessWithoutNullStreams@@ -21,6 +22,8 @@ function afterLocalSuite () {}async function beforeLocalSession (config: { baseUrl: string }, capabilities: { browserName: string }) {+ await createScreenshotsDirectory()+appInstance = capabilities['browserName'] === 'chrome'? 1: 2diff --git a/client/e2e/src/utils/index.ts b/client/e2e/src/utils/index.tsindex 420fd239eb..0770cb0f45 100644--- a/client/e2e/src/utils/index.ts+++ b/client/e2e/src/utils/index.ts@@ -1,6 +1,7 @@export * from './common'export * from './elements'export * from './email'+export * from './files'export * from './hooks'export * from './mock-smtp'export * from './server'