From 5bdfa604f102a5e51b5152457cd1a16d79177e26 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 19 Jan 2023 09:30:05 +0100 Subject: Add E2E client tests for signup approval --- client/e2e/src/utils/hooks.ts | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'client/e2e/src/utils/hooks.ts') diff --git a/client/e2e/src/utils/hooks.ts b/client/e2e/src/utils/hooks.ts index 889cf1d86..7fe247681 100644 --- a/client/e2e/src/utils/hooks.ts +++ b/client/e2e/src/utils/hooks.ts @@ -1,10 +1,13 @@ import { ChildProcessWithoutNullStreams } from 'child_process' import { basename } from 'path' import { runCommand, runServer } from './server' +import { setValue } from '@wdio/shared-store-service' -let appInstance: string +let appInstance: number let app: ChildProcessWithoutNullStreams +let emailPort: number + async function beforeLocalSuite (suite: any) { const config = buildConfig(suite.file) @@ -17,13 +20,20 @@ function afterLocalSuite () { app = undefined } -function beforeLocalSession (config: { baseUrl: string }, capabilities: { browserName: string }) { - appInstance = capabilities['browserName'] === 'chrome' ? '1' : '2' +async function beforeLocalSession (config: { baseUrl: string }, capabilities: { browserName: string }) { + appInstance = capabilities['browserName'] === 'chrome' + ? 1 + : 2 + + emailPort = 1025 + appInstance + config.baseUrl = 'http://localhost:900' + appInstance + + await setValue('emailPort', emailPort) } async function onBrowserStackPrepare () { - const appInstance = '1' + const appInstance = 1 await runCommand('npm run clean:server:test -- ' + appInstance) app = runServer(appInstance) @@ -71,7 +81,11 @@ function buildConfig (suiteFile: string = undefined) { if (filename === 'signup.e2e-spec.ts') { return { signup: { - enabled: true + limit: -1 + }, + smtp: { + hostname: '127.0.0.1', + port: emailPort } } } -- cgit v1.2.3