diff options
Diffstat (limited to 'client/e2e/src/utils/hooks.ts')
-rw-r--r-- | client/e2e/src/utils/hooks.ts | 24 |
1 files changed, 19 insertions, 5 deletions
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 @@ | |||
1 | import { ChildProcessWithoutNullStreams } from 'child_process' | 1 | import { ChildProcessWithoutNullStreams } from 'child_process' |
2 | import { basename } from 'path' | 2 | import { basename } from 'path' |
3 | import { runCommand, runServer } from './server' | 3 | import { runCommand, runServer } from './server' |
4 | import { setValue } from '@wdio/shared-store-service' | ||
4 | 5 | ||
5 | let appInstance: string | 6 | let appInstance: number |
6 | let app: ChildProcessWithoutNullStreams | 7 | let app: ChildProcessWithoutNullStreams |
7 | 8 | ||
9 | let emailPort: number | ||
10 | |||
8 | async function beforeLocalSuite (suite: any) { | 11 | async function beforeLocalSuite (suite: any) { |
9 | const config = buildConfig(suite.file) | 12 | const config = buildConfig(suite.file) |
10 | 13 | ||
@@ -17,13 +20,20 @@ function afterLocalSuite () { | |||
17 | app = undefined | 20 | app = undefined |
18 | } | 21 | } |
19 | 22 | ||
20 | function beforeLocalSession (config: { baseUrl: string }, capabilities: { browserName: string }) { | 23 | async function beforeLocalSession (config: { baseUrl: string }, capabilities: { browserName: string }) { |
21 | appInstance = capabilities['browserName'] === 'chrome' ? '1' : '2' | 24 | appInstance = capabilities['browserName'] === 'chrome' |
25 | ? 1 | ||
26 | : 2 | ||
27 | |||
28 | emailPort = 1025 + appInstance | ||
29 | |||
22 | config.baseUrl = 'http://localhost:900' + appInstance | 30 | config.baseUrl = 'http://localhost:900' + appInstance |
31 | |||
32 | await setValue('emailPort', emailPort) | ||
23 | } | 33 | } |
24 | 34 | ||
25 | async function onBrowserStackPrepare () { | 35 | async function onBrowserStackPrepare () { |
26 | const appInstance = '1' | 36 | const appInstance = 1 |
27 | 37 | ||
28 | await runCommand('npm run clean:server:test -- ' + appInstance) | 38 | await runCommand('npm run clean:server:test -- ' + appInstance) |
29 | app = runServer(appInstance) | 39 | app = runServer(appInstance) |
@@ -71,7 +81,11 @@ function buildConfig (suiteFile: string = undefined) { | |||
71 | if (filename === 'signup.e2e-spec.ts') { | 81 | if (filename === 'signup.e2e-spec.ts') { |
72 | return { | 82 | return { |
73 | signup: { | 83 | signup: { |
74 | enabled: true | 84 | limit: -1 |
85 | }, | ||
86 | smtp: { | ||
87 | hostname: '127.0.0.1', | ||
88 | port: emailPort | ||
75 | } | 89 | } |
76 | } | 90 | } |
77 | } | 91 | } |