From 2e8e97f313683bdf8a7448f3d1ba1f1c27f6ad50 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 17 May 2018 16:33:20 +0200 Subject: [PATCH] Add compatibility with browser stack --- README.md | 4 +++- client/e2e/protractor.conf.js | 19 ++++++++++--------- client/e2e/src/po/video-upload.po.ts | 3 +++ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 51c3747e8..88eac088a 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,9 @@ donating to them](https://soutenir.framasoft.org/en/).** devDependency Status - Browser Stack + + +

diff --git a/client/e2e/protractor.conf.js b/client/e2e/protractor.conf.js index 932eaed51..82daa435e 100644 --- a/client/e2e/protractor.conf.js +++ b/client/e2e/protractor.conf.js @@ -8,16 +8,17 @@ exports.config = { specs: [ './src/**/*.e2e-spec.ts' ], - multiCapabilities: [ - { - 'browserName': 'firefox', - 'moz:firefoxOptions': { - binary: 'firefox-developer' - } - } - ], + + seleniumAddress: 'http://hub-cloud.browserstack.com/wd/hub', + capabilities: { + 'browserstack.user': process.env.BROWSERSTACK_USER, + 'browserstack.key': process.env.BROWSERSTACK_KEY, + 'browserName': 'chrome', + 'browserstack.local': true, + 'project': 'PeerTube' + }, + maxSessions: 1, - directConnect: true, baseUrl: 'http://localhost:4200/', framework: 'jasmine', jasmineNodeOpts: { diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts index 4f09bb2fa..741914d2d 100644 --- a/client/e2e/src/po/video-upload.po.ts +++ b/client/e2e/src/po/video-upload.po.ts @@ -1,5 +1,6 @@ import { browser, element, by } from 'protractor' import { join } from 'path' +import { FileDetector } from 'selenium-webdriver/remote' export class VideoUploadPage { navigateTo () { @@ -7,6 +8,8 @@ export class VideoUploadPage { } async uploadVideo () { + browser.setFileDetector(new FileDetector()) + const fileToUpload = join(__dirname, '../../fixtures/video.mp4') await element(by.css('.upload-video-container input[type=file]')).sendKeys(fileToUpload)