Integration test: create torrents

This commit is contained in:
DC
2016-09-14 06:52:49 -07:00
parent 051c1516a0
commit 75a4655a0f
17 changed files with 151 additions and 66 deletions

View File

@@ -1,10 +1,11 @@
const test = require('tape')
const fs = require('fs-extra')
const setup = require('./setup')
const config = require('./config')
test('torrent-list: show download path missing', function (t) {
setup.wipeTestDataDir()
fs.removeSync(setup.TEST_DOWNLOAD_DIR)
setup.resetTestDataDir()
fs.removeSync(config.TEST_DIR_DOWNLOAD)
t.timeoutAfter(10e3)
const app = setup.createApp()
@@ -24,7 +25,7 @@ test('torrent-list: show download path missing', function (t) {
})
test('torrent-list: start, stop, and delete torrents', function (t) {
setup.wipeTestDataDir()
setup.resetTestDataDir()
const app = setup.createApp()
setup.waitForLoad(app, t, {offline: true})
@@ -35,7 +36,7 @@ test('torrent-list: start, stop, and delete torrents', function (t) {
.then(() => setup.screenshotCreateOrCompare(app, t, 'torrent-list-hover'))
// Click download on the first torrent, start downloading
.then(() => app.client.click('.icon.download'))
.then(() => app.client.waitUntilTextExists('.torrent-list', '276 MB'))
.then(() => app.client.waitUntilTextExists('.torrent-list', 'peer'))
.then(() => setup.screenshotCreateOrCompare(app, t, 'torrent-list-start-download'))
// Click download on the first torrent again, stop downloading
.then(() => app.client.click('.icon.download'))
@@ -62,7 +63,7 @@ test('torrent-list: start, stop, and delete torrents', function (t) {
})
test('torrent-list: expand torrent, unselect file', function (t) {
setup.wipeTestDataDir()
setup.resetTestDataDir()
const app = setup.createApp()
setup.waitForLoad(app, t, {offline: true})