aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/utils/hooks.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/e2e/src/utils/hooks.ts')
-rw-r--r--client/e2e/src/utils/hooks.ts24
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 @@
1import { ChildProcessWithoutNullStreams } from 'child_process' 1import { ChildProcessWithoutNullStreams } from 'child_process'
2import { basename } from 'path' 2import { basename } from 'path'
3import { runCommand, runServer } from './server' 3import { runCommand, runServer } from './server'
4import { setValue } from '@wdio/shared-store-service'
4 5
5let appInstance: string 6let appInstance: number
6let app: ChildProcessWithoutNullStreams 7let app: ChildProcessWithoutNullStreams
7 8
9let emailPort: number
10
8async function beforeLocalSuite (suite: any) { 11async 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
20function beforeLocalSession (config: { baseUrl: string }, capabilities: { browserName: string }) { 23async 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
25async function onBrowserStackPrepare () { 35async 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 }