X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=inline;f=client%2Fe2e%2Fwdio.browserstack.conf.ts;h=b89cdbc2e240a839a7ea178a77045ff05242a5cf;hb=24730a53c9e264d2b8a7a503022607678e923a1d;hp=af3a454fc6f008ee270e5d391c2f4d3fbdabc20c;hpb=3419e0e1fe8e48a08b63ca0ded31087f913eb2b6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/e2e/wdio.browserstack.conf.ts b/client/e2e/wdio.browserstack.conf.ts index af3a454fc..b89cdbc2e 100644 --- a/client/e2e/wdio.browserstack.conf.ts +++ b/client/e2e/wdio.browserstack.conf.ts @@ -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 }