bdd: Do better cleanup/separation for downloads
This commit is contained in:
parent
ca7361a8a2
commit
06190a0488
@ -1,8 +1,8 @@
|
|||||||
Feature: Downloading things from a website.
|
Feature: Downloading things from a website.
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given I set storage -> prompt-download-directory to false
|
Given I set up a temporary download dir
|
||||||
And I run :download-clear
|
And I clean old downloads
|
||||||
|
|
||||||
Scenario: Downloading which redirects with closed tab (issue 889)
|
Scenario: Downloading which redirects with closed tab (issue 889)
|
||||||
When I set tabs -> last-close to blank
|
When I set tabs -> last-close to blank
|
||||||
|
@ -21,6 +21,19 @@ import pytest_bdd as bdd
|
|||||||
bdd.scenarios('downloads.feature')
|
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")
|
@bdd.when("I wait until the download is finished")
|
||||||
def wait_for_download_finished(quteproc):
|
def wait_for_download_finished(quteproc):
|
||||||
quteproc.wait_for(category='downloads', message='Download finished')
|
quteproc.wait_for(category='downloads', message='Download finished')
|
||||||
|
Loading…
Reference in New Issue
Block a user