]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/e2e/wdio.browserstack.conf.ts
Translated using Weblate (Persian)
[github/Chocobozzz/PeerTube.git] / client / e2e / wdio.browserstack.conf.ts
index af3a454fc6f008ee270e5d391c2f4d3fbdabc20c..b89cdbc2e240a839a7ea178a77045ff05242a5cf 100644 (file)
@@ -1,3 +1,4 @@
+import { onBrowserStackComplete, onBrowserStackPrepare } from './src/utils'
 import { config as mainConfig } from './wdio.main.conf'
 
 const user = process.env.BROWSERSTACK_USER
@@ -26,14 +27,16 @@ function buildBStackDesktopOptions (sessionName: string, resolution?: string) {
   }
 }
 
-function buildBStackMobileOptions (sessionName: string, deviceName: string, osVersion: string) {
+function buildBStackMobileOptions (sessionName: string, deviceName: string, osVersion: string, appiumVersion?: string) {
   return {
     'bstack:options': {
       ...buildMainOptions(sessionName),
 
       realMobile: true,
       osVersion,
-      deviceName
+      deviceName,
+
+      appiumVersion
     }
   }
 }
@@ -84,7 +87,7 @@ module.exports = {
       {
         browserName: 'Safari',
 
-        ...buildBStackMobileOptions('Safari iPhone', 'iPhone 8 Plus', '11')
+        ...buildBStackMobileOptions('Safari iPhone', 'iPhone SE', '11')
       },
       {
         browserName: 'Safari',
@@ -97,18 +100,25 @@ module.exports = {
     connectionRetryTimeout: 240000,
     waitforTimeout: 20000,
 
+    specs: [
+      // We don't want to test "local" tests
+      './src/suites-all/*.e2e-spec.ts'
+    ],
+
     services: [
       [
         'browserstack', { browserstackLocal: true }
       ]
     ],
 
-    after: function (result) {
-      if (result === 0) {
-        browser.executeScript('browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"passed","reason": ""}}', [])
-      } else {
-        browser.executeScript('browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"failed","reason": ""}}', [])
+    onWorkerStart: function (_cid, capabilities) {
+      if (capabilities['bstack:options'].realMobile === true) {
+        capabilities['bstack:options'].local = false
       }
-    }
+    },
+
+    onPrepare: onBrowserStackPrepare,
+    onComplete: onBrowserStackComplete
+
   } as WebdriverIO.Config
 }