Integration test: audio
@@ -17,8 +17,4 @@ test('app runs', function (t) {
|
||||
require('./test-torrent-list')
|
||||
require('./test-add-torrent')
|
||||
require('./test-video')
|
||||
|
||||
// TODO:
|
||||
// require('./test-audio')
|
||||
// require('./test-cast')
|
||||
// require('./test-prefs')
|
||||
require('./test-audio')
|
||||
|
||||
BIN
test/screenshots/darwin/play-torrent-wired-2.png
Normal file
|
After Width: | Height: | Size: 694 KiB |
BIN
test/screenshots/darwin/play-torrent-wired-3.png
Normal file
|
After Width: | Height: | Size: 699 KiB |
BIN
test/screenshots/darwin/play-torrent-wired-4.png
Normal file
|
After Width: | Height: | Size: 700 KiB |
BIN
test/screenshots/darwin/play-torrent-wired-5.png
Normal file
|
After Width: | Height: | Size: 698 KiB |
BIN
test/screenshots/darwin/play-torrent-wired-fullscreen.png
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
test/screenshots/darwin/play-torrent-wired-list.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
test/screenshots/darwin/play-torrent-wired.png
Normal file
|
After Width: | Height: | Size: 700 KiB |
57
test/test-audio.js
Normal file
@@ -0,0 +1,57 @@
|
||||
const test = require('tape')
|
||||
const setup = require('./setup')
|
||||
|
||||
test('audio-streaming', function (t) {
|
||||
setup.resetTestDataDir()
|
||||
|
||||
t.timeoutAfter(40e3)
|
||||
const app = setup.createApp()
|
||||
setup.waitForLoad(app, t, {online: true})
|
||||
.then(() => app.client.waitUntilTextExists('.torrent-list', 'Big Buck Bunny'))
|
||||
// Play Wired CD. Wait for it to start streaming.
|
||||
.then(() => app.client.moveToObject('#torrent-wired'))
|
||||
.then(() => setup.wait())
|
||||
.then(() => app.client.click('#torrent-wired .icon.play'))
|
||||
.then(() => setup.wait(5e3))
|
||||
// Pause. Skip to two seconds in. Wait another two seconds for it to load.
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("playPause")'))
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("skipTo", 2)'))
|
||||
.then(() => setup.wait())
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'play-torrent-wired'))
|
||||
// Click next
|
||||
.then(() => app.client.click('.skip-next'))
|
||||
.then(() => setup.wait())
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("playPause")'))
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("skipTo", 2)'))
|
||||
.then(() => setup.wait())
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'play-torrent-wired-2'))
|
||||
// Play from end of song, let it advance on its own
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("skipTo", 206)'))
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("playPause")'))
|
||||
.then(() => setup.wait(5e3))
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("playPause")'))
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("skipTo", 2)'))
|
||||
.then(() => setup.wait())
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'play-torrent-wired-3'))
|
||||
// Fullscreen
|
||||
.then(() => app.client.click('.fullscreen'))
|
||||
.then(() => setup.wait())
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'play-torrent-wired-fullscreen'))
|
||||
// Back to normal audio view. Give the player controls have had time to disappear.
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("escapeBack")'))
|
||||
.then(() => setup.wait(5e3))
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'play-torrent-wired-4'))
|
||||
// Back. Return to torrent list
|
||||
.then(() => app.client.click('.back'))
|
||||
.then(() => setup.wait())
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'play-torrent-wired-list'))
|
||||
// Forward. Should play again where we left off (should not stay paused)
|
||||
.then(() => app.client.click('.forward'))
|
||||
.then(() => setup.wait())
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("playPause")'))
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("skipTo", 2)'))
|
||||
.then(() => setup.wait())
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'play-torrent-wired-5'))
|
||||
.then(() => setup.endTest(app, t),
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
})
|
||||
@@ -1,7 +1,7 @@
|
||||
const test = require('tape')
|
||||
const setup = require('./setup')
|
||||
|
||||
test('basic-streaming', function (t) {
|
||||
test('video-streaming', function (t) {
|
||||
setup.resetTestDataDir()
|
||||
|
||||
t.timeoutAfter(30e3)
|
||||
|
||||