Add compatibility with browser stack

pull/581/head
Chocobozzz 2018-05-17 16:33:20 +02:00
parent 4b4f22fc30
commit 2e8e97f313
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 16 additions and 10 deletions

View File

@ -25,7 +25,9 @@ donating to them](https://soutenir.framasoft.org/en/).**
<img src="https://david-dm.org/Chocobozzz/PeerTube/dev-status.svg?path=client" alt="devDependency Status" /> <img src="https://david-dm.org/Chocobozzz/PeerTube/dev-status.svg?path=client" alt="devDependency Status" />
</a> </a>
<img src="http://lutim.cpy.re/js3rkfIc.png" alt="Browser Stack" /> <a href="https://www.browserstack.com/automate/public-build/VXBPc0szNjUvRUNsREJQRFF6RkEvSjJBclZ4VUJBUm1hcS9RZGpUbitRST0tLWFWbjNEdVN6eEZpYTk4dGVpMkVlQWc9PQ==--644e755052bf7fe2346eb6e868be8e706718a17c%">
<img src='https://www.browserstack.com/automate/badge.svg?badge_key=VXBPc0szNjUvRUNsREJQRFF6RkEvSjJBclZ4VUJBUm1hcS9RZGpUbitRST0tLWFWbjNEdVN6eEZpYTk4dGVpMkVlQWc9PQ==--644e755052bf7fe2346eb6e868be8e706718a17c%'/>
</a>
</p> </p>
<p align="center"> <p align="center">

View File

@ -8,16 +8,17 @@ exports.config = {
specs: [ specs: [
'./src/**/*.e2e-spec.ts' './src/**/*.e2e-spec.ts'
], ],
multiCapabilities: [
{ seleniumAddress: 'http://hub-cloud.browserstack.com/wd/hub',
'browserName': 'firefox', capabilities: {
'moz:firefoxOptions': { 'browserstack.user': process.env.BROWSERSTACK_USER,
binary: 'firefox-developer' 'browserstack.key': process.env.BROWSERSTACK_KEY,
} 'browserName': 'chrome',
} 'browserstack.local': true,
], 'project': 'PeerTube'
},
maxSessions: 1, maxSessions: 1,
directConnect: true,
baseUrl: 'http://localhost:4200/', baseUrl: 'http://localhost:4200/',
framework: 'jasmine', framework: 'jasmine',
jasmineNodeOpts: { jasmineNodeOpts: {

View File

@ -1,5 +1,6 @@
import { browser, element, by } from 'protractor' import { browser, element, by } from 'protractor'
import { join } from 'path' import { join } from 'path'
import { FileDetector } from 'selenium-webdriver/remote'
export class VideoUploadPage { export class VideoUploadPage {
navigateTo () { navigateTo () {
@ -7,6 +8,8 @@ export class VideoUploadPage {
} }
async uploadVideo () { async uploadVideo () {
browser.setFileDetector(new FileDetector())
const fileToUpload = join(__dirname, '../../fixtures/video.mp4') const fileToUpload = join(__dirname, '../../fixtures/video.mp4')
await element(by.css('.upload-video-container input[type=file]')).sendKeys(fileToUpload) await element(by.css('.upload-video-container input[type=file]')).sendKeys(fileToUpload)