X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fe2e%2Fwdio.browserstack.conf.ts;h=944df8bdd3c77adb3228cc7dc0de5aa1bf8fa4d5;hb=b105ea604286092b4e5fd5667f2957d113278dde;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..944df8bdd 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 } } } @@ -79,12 +82,12 @@ module.exports = { { browserName: 'Chrome', - ...buildBStackMobileOptions('Latest Chrome Android', 'Samsung Galaxy S6', '5.0') + ...buildBStackMobileOptions('Latest Chrome Android', 'Samsung Galaxy S8', '7.0') }, { 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 }