1 import { config as mainConfig } from './wdio.main.conf'
3 const user = process.env.BROWSERSTACK_USER
4 const key = process.env.BROWSERSTACK_KEY
6 if (!user) throw new Error('Miss browser stack user')
7 if (!key) throw new Error('Miss browser stack key')
9 function buildMainOptions (sessionName: string) {
11 projectName: 'PeerTube',
12 buildName: 'Main E2E - ' + new Date().toISOString().split('T')[0],
19 function buildBStackDesktopOptions (sessionName: string, resolution?: string) {
22 ...buildMainOptions(sessionName),
29 function buildBStackMobileOptions (sessionName: string, deviceName: string, osVersion: string) {
32 ...buildMainOptions(sessionName),
52 browserName: 'Chrome',
54 ...buildBStackDesktopOptions('Latest Chrome Desktop', '1280x1024')
57 browserName: 'Firefox',
58 browserVersion: '68', // ESR
60 ...buildBStackDesktopOptions('Firefox ESR Desktop', '1280x1024')
63 browserName: 'Safari',
64 browserVersion: '11.1',
66 ...buildBStackDesktopOptions('Safari Desktop', '1280x1024')
69 browserName: 'Firefox',
71 ...buildBStackDesktopOptions('Firefox Latest', '1280x1024')
76 ...buildBStackDesktopOptions('Edge Latest', '1280x1024')
80 browserName: 'Chrome',
82 ...buildBStackMobileOptions('Latest Chrome Android', 'Samsung Galaxy S6', '5.0')
85 browserName: 'Safari',
87 ...buildBStackMobileOptions('Safari iPhone', 'iPhone 8 Plus', '11')
90 browserName: 'Safari',
92 ...buildBStackMobileOptions('Safari iPad', 'iPad 7th', '13')
96 host: 'hub-cloud.browserstack.com',
97 connectionRetryTimeout: 240000,
98 waitforTimeout: 20000,
102 'browserstack', { browserstackLocal: true }
106 after: function (result) {
108 browser.executeScript('browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"passed","reason": ""}}', [])
110 browser.executeScript('browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"failed","reason": ""}}', [])
113 } as WebdriverIO.Config