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