]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/e2e/wdio.browserstack.conf.ts
Prevent video import on non unicast ips
[github/Chocobozzz/PeerTube.git] / client / e2e / wdio.browserstack.conf.ts
CommitLineData
3419e0e1
C
1import { config as mainConfig } from './wdio.main.conf'
2
3const user = process.env.BROWSERSTACK_USER
4const key = process.env.BROWSERSTACK_KEY
5
6if (!user) throw new Error('Miss browser stack user')
7if (!key) throw new Error('Miss browser stack key')
8
9function buildMainOptions (sessionName: string) {
10 return {
11 projectName: 'PeerTube',
12 buildName: 'Main E2E - ' + new Date().toISOString().split('T')[0],
13 sessionName,
14 consoleLogs: 'info',
15 networkLogs: true
16 }
17}
18
19function buildBStackDesktopOptions (sessionName: string, resolution?: string) {
20 return {
21 'bstack:options': {
22 ...buildMainOptions(sessionName),
23
24 resolution
25 }
26 }
27}
28
6d210220 29function buildBStackMobileOptions (sessionName: string, deviceName: string, osVersion: string, appiumVersion?: string) {
3419e0e1
C
30 return {
31 'bstack:options': {
32 ...buildMainOptions(sessionName),
33
34 realMobile: true,
35 osVersion,
6d210220
C
36 deviceName,
37
38 appiumVersion
3419e0e1
C
39 }
40 }
41}
42
43module.exports = {
44 config: {
45 ...mainConfig,
46
47 user,
48 key,
49
50 maxInstances: 5,
51
52 capabilities: [
53 {
54 browserName: 'Chrome',
55
56 ...buildBStackDesktopOptions('Latest Chrome Desktop', '1280x1024')
57 },
58 {
59 browserName: 'Firefox',
60 browserVersion: '68', // ESR
61
62 ...buildBStackDesktopOptions('Firefox ESR Desktop', '1280x1024')
63 },
64 {
65 browserName: 'Safari',
66 browserVersion: '11.1',
67
68 ...buildBStackDesktopOptions('Safari Desktop', '1280x1024')
69 },
70 {
71 browserName: 'Firefox',
72
73 ...buildBStackDesktopOptions('Firefox Latest', '1280x1024')
74 },
75 {
76 browserName: 'Edge',
77
78 ...buildBStackDesktopOptions('Edge Latest', '1280x1024')
79 },
80
81 {
82 browserName: 'Chrome',
83
84 ...buildBStackMobileOptions('Latest Chrome Android', 'Samsung Galaxy S6', '5.0')
85 },
86 {
87 browserName: 'Safari',
88
6d210220 89 ...buildBStackMobileOptions('Safari iPhone', 'iPhone SE', '11')
3419e0e1
C
90 },
91 {
92 browserName: 'Safari',
93
94 ...buildBStackMobileOptions('Safari iPad', 'iPad 7th', '13')
95 }
96 ],
97
98 host: 'hub-cloud.browserstack.com',
99 connectionRetryTimeout: 240000,
100 waitforTimeout: 20000,
101
6d210220
C
102 specs: [
103 // We don't want to test "local" tests
104 './src/suites-all/*.e2e-spec.ts'
105 ],
106
3419e0e1
C
107 services: [
108 [
109 'browserstack', { browserstackLocal: true }
110 ]
111 ],
112
6d210220
C
113 onWorkerStart: function (_cid, capabilities) {
114 if (capabilities['bstack:options'].realMobile === true) {
115 capabilities['bstack:options'].local = false
3419e0e1
C
116 }
117 }
118 } as WebdriverIO.Config
119}