bdd: Do better cleanup/separation for downloads

This commit is contained in:
Florian Bruhin 2016-03-14 19:06:16 +01:00
parent ca7361a8a2
commit 06190a0488
2 changed files with 15 additions and 2 deletions

View File

@ -1,8 +1,8 @@
Feature: Downloading things from a website.
Background:
Given I set storage -> prompt-download-directory to false
And I run :download-clear
Given I set up a temporary download dir
And I clean old downloads
Scenario: Downloading which redirects with closed tab (issue 889)
When I set tabs -> last-close to blank

View File

@ -21,6 +21,19 @@ import pytest_bdd as bdd
bdd.scenarios('downloads.feature')
@bdd.given("I set up a temporary download dir")
def temporary_download_dir(quteproc, tmpdir):
quteproc.set_setting('storage', 'prompt-download-directory', 'false')
quteproc.set_setting('storage', 'remember-download-directory', 'false')
quteproc.set_setting('storage', 'download-directory', str(tmpdir))
@bdd.given("I clean old downloads")
def clean_old_downloads(quteproc):
quteproc.send_cmd(':download-cancel --all')
quteproc.send_cmd(':download-clear')
@bdd.when("I wait until the download is finished")
def wait_for_download_finished(quteproc):
quteproc.wait_for(category='downloads', message='Download finished')