1 import { onBrowserStackComplete, onBrowserStackPrepare } from './src/utils'
2 import { config as mainConfig } from './wdio.main.conf'
4 const user = process.env.BROWSERSTACK_USER
5 const key = process.env.BROWSERSTACK_KEY
7 if (!user) throw new Error('Miss browser stack user')
8 if (!key) throw new Error('Miss browser stack key')
10 function buildMainOptions (sessionName: string) {
12 projectName: 'PeerTube',
13 buildName: 'Main E2E - ' + new Date().toISOString().split('T')[0],
20 function buildBStackDesktopOptions (sessionName: string, resolution?: string) {
23 ...buildMainOptions(sessionName),
30 function buildBStackMobileOptions (sessionName: string, deviceName: string, osVersion: string, appiumVersion?: string) {
33 ...buildMainOptions(sessionName),
55 browserName: 'Chrome',
57 ...buildBStackDesktopOptions('Latest Chrome Desktop', '1280x1024')
60 browserName: 'Firefox',
61 browserVersion: '68', // ESR
63 ...buildBStackDesktopOptions('Firefox ESR Desktop', '1280x1024')
66 browserName: 'Safari',
67 browserVersion: '11.1',
69 ...buildBStackDesktopOptions('Safari Desktop', '1280x1024')
72 browserName: 'Firefox',
74 ...buildBStackDesktopOptions('Firefox Latest', '1280x1024')
79 ...buildBStackDesktopOptions('Edge Latest', '1280x1024')
83 browserName: 'Chrome',
85 ...buildBStackMobileOptions('Latest Chrome Android', 'Samsung Galaxy S6', '5.0')
88 browserName: 'Safari',
90 ...buildBStackMobileOptions('Safari iPhone', 'iPhone SE', '11')
93 browserName: 'Safari',
95 ...buildBStackMobileOptions('Safari iPad', 'iPad 7th', '13')
99 host: 'hub-cloud.browserstack.com',
100 connectionRetryTimeout: 240000,
101 waitforTimeout: 20000,
104 // We don't want to test "local" tests
105 './src/suites-all/*.e2e-spec.ts'
110 'browserstack', { browserstackLocal: true }
114 onWorkerStart: function (_cid, capabilities) {
115 if (capabilities['bstack:options'].realMobile === true) {
116 capabilities['bstack:options'].local = false
120 onPrepare: onBrowserStackPrepare,
121 onComplete: onBrowserStackComplete
123 } as WebdriverIO.Config