2017-03-31 17:16:31 +02:00
# vim: ft=cucumber fileencoding=utf-8 sts=4 sw=4 et:
2015-11-09 07:49:11 +01:00
Feature : Downloading things from a website.
Background :
2016-03-14 19:06:16 +01:00
Given I s e t u p a t e m p o r a r y d o w n l o a d d i r
And I c l e a n o l d d o w n l o a d s
2016-09-10 15:50:18 +02:00
And I s e t u i - > r e m o v e - f i n i s h e d - d o w n l o a d s t o - 1
2015-11-09 07:49:11 +01:00
2016-09-09 16:17:59 +02:00
## starting downloads
Scenario : Clicking an unknown link
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d s . h t m l
And I r u n : c l i c k - e l e m e n t i d d o w n l o a d
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e d o w n l o a d . b i n s h o u l d e x i s t
Scenario : Using :download
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d . b i n
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e d o w n l o a d . b i n s h o u l d e x i s t
Scenario : Using hints
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d s . h t m l
And I h i n t w i t h a r g s " l i n k s d o w n l o a d " a n d f o l l o w a
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e d o w n l o a d . b i n s h o u l d e x i s t
Scenario : Using rapid hints
# We don't expect any prompts with rapid hinting even if this is true
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d s . h t m l
And I h i n t w i t h a r g s " - - r a p i d l i n k s d o w n l o a d " a n d f o l l o w a
And I r u n : f o l l o w - h i n t s
And I w a i t u n t i l t h e d o w n l o a d d o w n l o a d . b i n i s f i n i s h e d
And I w a i t u n t i l t h e d o w n l o a d d o w n l o a d 2. b i n i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e d o w n l o a d . b i n s h o u l d e x i s t
Then t h e d o w n l o a d e d f i l e d o w n l o a d 2. b i n s h o u l d e x i s t
## Regression tests
2015-11-09 07:49:11 +01:00
Scenario : Downloading which redirects with closed tab (issue 889)
When I s e t t a b s - > l a s t - c l o s e t o b l a n k
And I o p e n d a t a / d o w n l o a d s / i s s u e 889. h t m l
2016-08-18 17:21:50 +02:00
And I h i n t w i t h a r g s " l i n k s d o w n l o a d " a n d f o l l o w a
2015-11-09 07:49:11 +01:00
And I r u n : t a b - c l o s e
And I w a i t f o r " * H a n d l i n g r e d i r e c t " i n t h e l o g
Then n o c r a s h s h o u l d h a p p e n
Scenario : Downloading with error in closed tab (issue 889)
When I s e t t a b s - > l a s t - c l o s e t o b l a n k
And I o p e n d a t a / d o w n l o a d s / i s s u e 889. h t m l
2016-08-18 17:21:50 +02:00
And I h i n t w i t h a r g s " l i n k s d o w n l o a d " a n d f o l l o w s
2015-11-09 07:49:11 +01:00
And I r u n : t a b - c l o s e
And I w a i t f o r t h e e r r o r " D o w n l o a d e r r o r : * - s e r v e r r e p l i e d : N O T F O U N D "
And I r u n : d o w n l o a d - r e t r y
And I w a i t f o r t h e e r r o r " D o w n l o a d e r r o r : * - s e r v e r r e p l i e d : N O T F O U N D "
Then n o c r a s h s h o u l d h a p p e n
2016-01-26 22:37:46 +01:00
Scenario : Downloading a link without path information (issue 1243)
When I s e t c o m p l e t i o n - > d o w n l o a d - p a t h - s u g g e s t i o n t o f i l e n a m e
And I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I o p e n d a t a / d o w n l o a d s / i s s u e 1243. h t m l
2016-08-18 17:21:50 +02:00
And I h i n t w i t h a r g s " l i n k s d o w n l o a d " a n d f o l l o w a
2016-10-28 18:40:55 +02:00
And I w a i t f o r " A s k i n g q u e s t i o n <qutebrowser.utils.usertypes.Question default='qutebrowser-download' mode=<PromptMode.download: 5> t e x t = * t i t l e = ' S a v e f i l e t o : ' > , * " i n t h e l o g
tests: fix tests for downloads bdd test
The test was failing because of two reasons:
First, the old code had filename questions in DownloadManager.get and
DownloadManager.fetch which were almost identical, thus the part in
DownloadManager.get was removed in an earlier commit. All filename
asking is now done by DownloadManager.fetch. The good part is code
deduplication, the bad part is slightly modified behavior: The new code
doesn't wait for a filename to start the download, instead it tries to
fill the buffer immediately. This made the test fail because qute:// has
no registered handler, so in order for the test to pass now, the "no
crash" part is not enough, we also need to expect the "No handler"
error.
Secondly, and a rather rare (race) condition was the handling of errors
in the DownloadItem. If an error occured after the registration of
self.on_reply_error as error handler and before the check
reply.error() != QNetworkReply.NoError
at the end of the function, the error signal would be emitted twice:
Once by _die() (called by on_reply_error), and once by the init_reply
function directly (in the last if block). This lead to duplicated error
messages. This is also explained in a comment in the file (with small
"stack traces").
2016-07-07 00:08:13 +02:00
Then t h e e r r o r " D o w n l o a d e r r o r : N o h a n d l e r f o u n d f o r q u t e : / / ! " s h o u l d b e s h o w n
2016-02-18 16:17:35 +01:00
Scenario : Downloading a data: link (issue 1214)
When I s e t c o m p l e t i o n - > d o w n l o a d - p a t h - s u g g e s t i o n t o f i l e n a m e
And I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
2017-05-15 09:04:16 +02:00
And I o p e n d a t a / d a t a _ l i n k . h t m l
2016-08-18 17:21:50 +02:00
And I h i n t w i t h a r g s " l i n k s d o w n l o a d " a n d f o l l o w a
2016-10-28 18:40:55 +02:00
And I w a i t f o r " A s k i n g q u e s t i o n <qutebrowser.utils.usertypes.Question default='binary blob' mode=<PromptMode.download: 5> t e x t = * t i t l e = ' S a v e f i l e t o : ' > , * " i n t h e l o g
2016-02-18 16:17:35 +01:00
And I r u n : l e a v e - m o d e
Then n o c r a s h s h o u l d h a p p e n
2015-11-09 07:49:11 +01:00
2016-05-05 00:04:58 +02:00
Scenario : Downloading with SSL errors (issue 1413)
2016-11-10 21:20:43 +01:00
When I c l e a r S S L e r r o r s
2016-05-05 00:04:58 +02:00
And I s e t n e t w o r k - > s s l - s t r i c t t o a s k
2017-03-28 21:18:32 +02:00
And I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
2016-07-05 08:34:03 +02:00
And I d o w n l o a d a n S S L p a g e
2016-05-05 00:04:58 +02:00
And I w a i t f o r " E n t e r i n g m o d e K e y M o d e . * ( r e a s o n : q u e s t i o n a s k e d ) " i n t h e l o g
And I r u n : p r o m p t - a c c e p t
Then t h e e r r o r " D o w n l o a d e r r o r : S S L h a n d s h a k e f a i l e d " s h o u l d b e s h o w n
2016-09-09 16:17:59 +02:00
Scenario : Closing window with remove-finished-downloads timeout (issue 1242)
When I s e t u i - > r e m o v e - f i n i s h e d - d o w n l o a d s t o 500
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n i n a n e w w i n d o w w i t h o u t w a i t i n g
2016-09-09 16:17:59 +02:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : c l o s e
And I w a i t 0.5 s
Then n o c r a s h s h o u l d h a p p e n
Scenario : Quitting with finished downloads and confirm-quit=downloads (issue 846)
Given I h a v e a f r e s h i n s t a n c e
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I s e t u i - > c o n f i r m - q u i t t o d o w n l o a d s
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2016-09-09 16:17:59 +02:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : c l o s e
Then q u t e b r o w s e r s h o u l d q u i t
2017-02-05 00:13:11 +01:00
# https://github.com/qutebrowser/qutebrowser/issues/2134
2016-11-22 11:10:37 +01:00
@qtwebengine_skip
Scenario : Downloading, then closing a tab
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I o p e n a b o u t : b l a n k
And I o p e n d a t a / d o w n l o a d s / i s s u e 2134. h t m l i n a n e w t a b
# This needs to be a download connected to the tabs QNAM
And I h i n t w i t h a r g s " l i n k s n o r m a l " a n d f o l l o w a
And I w a i t f o r " f e t c h : * - > d r i p " i n t h e l o g
And I r u n : t a b - c l o s e
And I w a i t f o r " D o w n l o a d d r i p f i n i s h e d " i n t h e l o g
2017-02-07 22:27:32 +01:00
Then t h e d o w n l o a d e d f i l e d r i p s h o u l d b e 128 b y t e s b i g
2016-11-22 11:10:37 +01:00
2016-12-09 07:08:51 +01:00
Scenario : Downloading a file with spaces
When I o p e n d a t a / d o w n l o a d s / d o w n l o a d w i t h s p a c e s . b i n w i t h o u t w a i t i n g
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e d o w n l o a d w i t h s p a c e s . b i n s h o u l d e x i s t
2017-04-08 19:22:00 +02:00
@qtwebkit_skip @qt<5.9
Scenario : Downloading a file with evil content-disposition header (Qt 5.8 or older)
2017-01-13 18:04:04 +01:00
# Content-Disposition: download; filename=..%2Ffoo
When I o p e n r e s p o n s e - h e a d e r s ? C o n t e n t - D i s p o s i t i o n = d o w n l o a d ; % 20 f i l e n a m e % 3 D . . % 252 F f o o w i t h o u t w a i t i n g
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e . . / f o o s h o u l d n o t e x i s t
And t h e d o w n l o a d e d f i l e f o o s h o u l d e x i s t
2017-04-08 19:22:00 +02:00
@qtwebkit_skip @qt>=5.9
Scenario : Downloading a file with evil content-disposition header (Qt 5.9 or newer)
# Content-Disposition: download; filename=..%2Ffoo
When I o p e n r e s p o n s e - h e a d e r s ? C o n t e n t - D i s p o s i t i o n = d o w n l o a d ; % 20 f i l e n a m e % 3 D . . % 252 F f o o w i t h o u t w a i t i n g
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e . . / f o o s h o u l d n o t e x i s t
And t h e d o w n l o a d e d f i l e . . % 2 F f o o s h o u l d e x i s t
2017-03-24 11:55:17 +01:00
@windows
Scenario : Downloading a file to a reserved path
2017-03-24 12:57:53 +01:00
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
2017-03-31 14:46:29 +02:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2017-03-24 12:57:53 +01:00
And I w a i t f o r " A s k i n g q u e s t i o n <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> t e x t = ' P l e a s e e n t e r a l o c a t i o n f o r <b> h t t p : / / l o c a l h o s t : * / d a t a / d o w n l o a d s / d o w n l o a d . b i n </b> ' t i t l e = ' S a v e f i l e t o : ' > , * " i n t h e l o g
2017-03-24 11:55:17 +01:00
And I r u n : p r o m p t - a c c e p t C O M 1
2017-03-24 12:57:53 +01:00
And I r u n : l e a v e - m o d e
2017-03-29 17:07:53 +02:00
Then t h e e r r o r " I n v a l i d f i l e n a m e " s h o u l d b e s h o w n
2017-03-24 11:55:17 +01:00
@windows
Scenario : Downloading a file to a drive-relative working directory
2017-03-24 12:57:53 +01:00
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
2017-03-31 14:46:29 +02:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2017-03-24 12:57:53 +01:00
And I w a i t f o r " A s k i n g q u e s t i o n <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> t e x t = ' P l e a s e e n t e r a l o c a t i o n f o r <b> h t t p : / / l o c a l h o s t : * / d a t a / d o w n l o a d s / d o w n l o a d . b i n </b> ' t i t l e = ' S a v e f i l e t o : ' > , * " i n t h e l o g
2017-03-24 11:55:17 +01:00
And I r u n : p r o m p t - a c c e p t C : f o o b a r
2017-03-24 12:57:53 +01:00
And I r u n : l e a v e - m o d e
2017-03-29 17:07:53 +02:00
Then t h e e r r o r " I n v a l i d f i l e n a m e " s h o u l d b e s h o w n
2017-03-24 11:55:17 +01:00
2017-03-24 12:30:29 +01:00
@windows
Scenario : Downloading a file to a reserved path with :download
When I r u n : d o w n l o a d d a t a / d o w n l o a d s / d o w n l o a d . b i n - - d e s t = C O M 1
Then t h e e r r o r " I n v a l i d t a r g e t f i l e n a m e " s h o u l d b e s h o w n
@windows
Scenario : Download a file to a drive-relative working directory with :download
When I r u n : d o w n l o a d d a t a / d o w n l o a d s / d o w n l o a d . b i n - - d e s t = C : f o o b a r
Then t h e e r r o r " I n v a l i d t a r g e t f i l e n a m e " s h o u l d b e s h o w n
2016-09-09 16:17:59 +02:00
## :download-retry
2015-11-09 07:49:11 +01:00
Scenario : Retrying a failed download
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d o e s - n o t - e x i s t
And I w a i t f o r t h e e r r o r " D o w n l o a d e r r o r : * - s e r v e r r e p l i e d : N O T F O U N D "
And I r u n : d o w n l o a d - r e t r y
And I w a i t f o r t h e e r r o r " D o w n l o a d e r r o r : * - s e r v e r r e p l i e d : N O T F O U N D "
Then t h e r e q u e s t s s h o u l d b e :
d o e s - n o t - e x i s t
d o e s - n o t - e x i s t
2017-03-20 09:32:44 +01:00
@qtwebkit_skip
Scenario : Retrying a failed download with QtWebEngine
When I o p e n d a t a / d o w n l o a d s / i s s u e 2298. h t m l
And I r u n : c l i c k - e l e m e n t i d d o w n l o a d
And I w a i t f o r " D o w n l o a d e r r o r : * " i n t h e l o g
And I r u n : d o w n l o a d - r e t r y
Then t h e e r r o r " R e t r y i n g d o w n l o a d s i s u n s u p p o r t e d w i t h Q t W e b E n g i n e " s h o u l d b e s h o w n
2016-09-10 15:51:49 +02:00
Scenario : Retrying with count
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d . b i n
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d o e s - n o t - e x i s t
And I w a i t f o r t h e e r r o r " D o w n l o a d e r r o r : * - s e r v e r r e p l i e d : N O T F O U N D "
And I r u n : d o w n l o a d - r e t r y w i t h c o u n t 2
And I w a i t f o r t h e e r r o r " D o w n l o a d e r r o r : * - s e r v e r r e p l i e d : N O T F O U N D "
Then t h e r e q u e s t s s h o u l d b e :
d a t a / d o w n l o a d s / d o w n l o a d . b i n
d o e s - n o t - e x i s t
d o e s - n o t - e x i s t
Scenario : Retrying with two failed downloads
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d o e s - n o t - e x i s t
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d o e s - n o t - e x i s t - 2
And I w a i t f o r t h e e r r o r " D o w n l o a d e r r o r : * - s e r v e r r e p l i e d : N O T F O U N D "
And I w a i t f o r t h e e r r o r " D o w n l o a d e r r o r : * - s e r v e r r e p l i e d : N O T F O U N D "
2015-11-09 07:49:11 +01:00
And I r u n : d o w n l o a d - r e t r y
2016-09-10 15:51:49 +02:00
And I w a i t f o r t h e e r r o r " D o w n l o a d e r r o r : * - s e r v e r r e p l i e d : N O T F O U N D "
Then t h e r e q u e s t s s h o u l d b e :
d o e s - n o t - e x i s t
d o e s - n o t - e x i s t - 2
d o e s - n o t - e x i s t
Scenario : Retrying a download which does not exist
When I r u n : d o w n l o a d - r e t r y w i t h c o u n t 42
Then t h e e r r o r " T h e r e ' s n o d o w n l o a d 4 2 ! " s h o u l d b e s h o w n
Scenario : Retrying a download which did not fail
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d . b i n
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : d o w n l o a d - r e t r y w i t h c o u n t 1
Then t h e e r r o r " D o w n l o a d 1 d i d n o t f a i l ! " s h o u l d b e s h o w n
2015-11-09 07:49:11 +01:00
2016-09-10 15:51:49 +02:00
Scenario : Retrying a download with no failed ones
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d . b i n
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : d o w n l o a d - r e t r y
2015-11-26 17:50:39 +01:00
Then t h e e r r o r " N o f a i l e d d o w n l o a d s ! " s h o u l d b e s h o w n
2015-11-20 18:31:39 +01:00
2016-09-09 16:17:59 +02:00
## Wrong invocations
2015-11-20 18:31:39 +01:00
Scenario : :download with deprecated dest-old argument
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d e p r e c a t e d - a r g u m e n t
2016-09-15 12:40:47 +02:00
Then t h e w a r n i n g " : d o w n l o a d [ u r l ] [ d e s t ] i s d e p r e c a t e d - u s e : d o w n l o a d - - d e s t [ d e s t ] [ u r l ] " s h o u l d b e s h o w n
2015-11-20 18:31:39 +01:00
Scenario : Two destinations given
When I r u n : d o w n l o a d - - d e s t d e s t i n a t i o n 2 h t t p : / / l o c a l h o s t : ( p o r t ) / d e s t i n a t i o n 1
2016-09-15 12:40:47 +02:00
Then t h e w a r n i n g " : d o w n l o a d [ u r l ] [ d e s t ] i s d e p r e c a t e d - u s e : d o w n l o a d - - d e s t [ d e s t ] [ u r l ] " s h o u l d b e s h o w n
2015-11-26 17:50:39 +01:00
And t h e e r r o r " C a n ' t g i v e t w o d e s t i n a t i o n s f o r t h e d o w n l o a d . " s h o u l d b e s h o w n
2015-11-20 18:31:39 +01:00
2016-07-05 08:34:03 +02:00
Scenario : :download --mhtml with a URL given
2015-11-20 18:31:39 +01:00
When I r u n : d o w n l o a d - - m h t m l h t t p : / / f o o b a r /
2015-11-26 17:50:39 +01:00
Then t h e e r r o r " C a n o n l y d o w n l o a d t h e c u r r e n t p a g e a s m h t m l . " s h o u l d b e s h o w n
2015-11-20 18:31:39 +01:00
2016-09-09 17:52:20 +02:00
Scenario : :download with a directory which doesn't exist
2017-01-13 17:59:03 +01:00
When I r u n : d o w n l o a d - - d e s t ( t m p d i r ) / d o w n l o a d s / s o m e d i r / f i l e n a m e h t t p : / / l o c a l h o s t : ( p o r t ) /
2016-09-09 17:52:20 +02:00
Then t h e e r r o r " D o w n l o a d e r r o r : N o s u c h f i l e o r d i r e c t o r y " s h o u l d b e s h o w n
2016-09-09 16:17:59 +02:00
## mhtml downloads
2015-11-20 18:31:39 +01:00
Scenario : Downloading as mhtml is available
2017-02-07 00:15:39 +01:00
When I o p e n d a t a / t i t l e . h t m l
2015-11-20 18:31:39 +01:00
And I r u n : d o w n l o a d - - m h t m l
2015-11-21 12:45:57 +01:00
And I w a i t f o r " F i l e s u c c e s s f u l l y w r i t t e n . " i n t h e l o g
2017-02-07 00:15:39 +01:00
Then t h e d o w n l o a d e d f i l e T e s t t i t l e . m h t m l s h o u l d e x i s t
2015-11-20 18:31:39 +01:00
2017-02-07 00:15:39 +01:00
@qtwebengine_skip: Q t W e b E n g i n e r e f u s e s t o l o a d t h i s
2015-11-20 18:31:39 +01:00
Scenario : Downloading as mhtml with non-ASCII headers
When I o p e n r e s p o n s e - h e a d e r s ? C o n t e n t - T y p e = t e x t % 2 F p l % C 3 % A 4 i n
2017-02-07 00:15:39 +01:00
And I r u n : d o w n l o a d - - m h t m l - - d e s t m h t m l - r e s p o n s e - h e a d e r s . m h t m l
2015-11-21 12:45:57 +01:00
And I w a i t f o r " F i l e s u c c e s s f u l l y w r i t t e n . " i n t h e l o g
2017-02-07 00:15:39 +01:00
Then t h e d o w n l o a d e d f i l e m h t m l - r e s p o n s e - h e a d e r s . m h t m l s h o u l d e x i s t
2016-03-14 19:06:42 +01:00
2017-02-07 22:23:35 +01:00
@qtwebengine_skip: h t t p s : / / g i t h u b . c o m / q u t e b r o w s e r / q u t e b r o w s e r / i s s u e s / 2288
2016-11-08 23:23:53 +01:00
Scenario : Overwriting existing mhtml file
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
2017-02-07 00:15:39 +01:00
And I o p e n d a t a / t i t l e . h t m l
2016-11-08 23:23:53 +01:00
And I r u n : d o w n l o a d - - m h t m l
2017-02-07 00:15:39 +01:00
And I w a i t f o r " A s k i n g q u e s t i o n <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> t e x t = ' P l e a s e e n t e r a l o c a t i o n f o r <b> h t t p : / / l o c a l h o s t : * / d a t a / t i t l e . h t m l </b> ' t i t l e = ' S a v e f i l e t o : ' > , * " i n t h e l o g
2016-11-08 23:23:53 +01:00
And I r u n : p r o m p t - a c c e p t
And I w a i t f o r " F i l e s u c c e s s f u l l y w r i t t e n . " i n t h e l o g
And I r u n : d o w n l o a d - - m h t m l
2017-02-07 00:15:39 +01:00
And I w a i t f o r " A s k i n g q u e s t i o n <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> t e x t = ' P l e a s e e n t e r a l o c a t i o n f o r <b> h t t p : / / l o c a l h o s t : * / d a t a / t i t l e . h t m l </b> ' t i t l e = ' S a v e f i l e t o : ' > , * " i n t h e l o g
2016-11-08 23:23:53 +01:00
And I r u n : p r o m p t - a c c e p t
And I w a i t f o r " A s k i n g q u e s t i o n <qutebrowser.utils.usertypes.Question default=None mode=<PromptMode.yesno: 1> t e x t = ' <b> * </b> a l r e a d y e x i s t s . O v e r w r i t e ? ' t i t l e = ' O v e r w r i t e e x i s t i n g f i l e ? ' > , * " i n t h e l o g
And I r u n : p r o m p t - a c c e p t y e s
And I w a i t f o r " F i l e s u c c e s s f u l l y w r i t t e n . " i n t h e l o g
2017-02-07 00:15:39 +01:00
Then t h e d o w n l o a d e d f i l e T e s t t i t l e . m h t m l s h o u l d e x i s t
2016-11-08 23:23:53 +01:00
2017-01-05 19:02:28 +01:00
Scenario : Opening a mhtml download directly
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I o p e n h t m l
And I r u n : d o w n l o a d - - m h t m l
And I w a i t f o r t h e d o w n l o a d p r o m p t f o r " * "
And I d i r e c t l y o p e n t h e d o w n l o a d
2017-02-07 00:15:39 +01:00
Then " O p e n i n g * . m h t m l * w i t h [ * p y t h o n * ] " s h o u l d b e l o g g e d
2017-01-05 19:02:28 +01:00
2016-03-14 19:06:42 +01:00
## :download-cancel
Scenario : Cancelling a download
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d r i p ? n u m b y t e s = 128 & d u r a t i o n = 5
And I r u n : d o w n l o a d - c a n c e l
Then " c a n c e l l e d " s h o u l d b e l o g g e d
2016-09-10 15:51:49 +02:00
Scenario : Cancelling with no download and no ID
When I r u n : d o w n l o a d - c a n c e l
Then t h e e r r o r " T h e r e ' s n o d o w n l o a d ! " s h o u l d b e s h o w n
2016-03-14 19:06:42 +01:00
Scenario : Cancelling a download which does not exist
When I r u n : d o w n l o a d - c a n c e l w i t h c o u n t 42
Then t h e e r r o r " T h e r e ' s n o d o w n l o a d 4 2 ! " s h o u l d b e s h o w n
Scenario : Cancelling a download which is already done
2016-11-07 11:42:02 +01:00
When I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2016-03-14 19:06:42 +01:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : d o w n l o a d - c a n c e l
Then t h e e r r o r " D o w n l o a d 1 i s a l r e a d y d o n e ! " s h o u l d b e s h o w n
Scenario : Cancelling a download which is already done (with count)
2016-11-07 11:42:02 +01:00
When I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2016-03-14 19:06:42 +01:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : d o w n l o a d - c a n c e l w i t h c o u n t 1
Then t h e e r r o r " D o w n l o a d 1 i s a l r e a d y d o n e ! " s h o u l d b e s h o w n
Scenario : Cancelling all downloads
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d r i p ? n u m b y t e s = 128 & d u r a t i o n = 5
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d r i p ? n u m b y t e s = 128 & d u r a t i o n = 5
And I r u n : d o w n l o a d - c a n c e l - - a l l
Then " c a n c e l l e d " s h o u l d b e l o g g e d
And " c a n c e l l e d " s h o u l d b e l o g g e d
2017-02-05 00:13:11 +01:00
# https://github.com/qutebrowser/qutebrowser/issues/1535
2016-11-07 11:42:02 +01:00
@qtwebengine_todo: : d o w n l o a d - - m h t m l i s n o t i m p l e m e n t e d y e t
2016-07-05 08:34:03 +02:00
Scenario : Cancelling an MHTML download (issue 1535)
2016-06-02 23:07:03 +02:00
When I o p e n d a t a / d o w n l o a d s / i s s u e 1535. h t m l
And I r u n : d o w n l o a d - - m h t m l
2016-06-04 13:15:22 +02:00
And I w a i t f o r " f e t c h : P y Q t 5 . Q t C o r e . Q U r l ( ' h t t p : / / l o c a l h o s t : * / d r i p ? n u m b y t e s = 1 2 8 & d u r a t i o n = 2 ' ) - > d r i p " i n t h e l o g
2016-06-02 23:07:03 +02:00
And I r u n : d o w n l o a d - c a n c e l
Then n o c r a s h s h o u l d h a p p e n
2016-09-10 15:51:49 +02:00
## :download-remove / :download-clear
Scenario : Removing a download
2016-11-07 11:42:02 +01:00
When I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2016-09-10 15:51:49 +02:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : d o w n l o a d - r e m o v e
Then " R e m o v e d d o w n l o a d * " s h o u l d b e l o g g e d
Scenario : Removing a download which does not exist
When I r u n : d o w n l o a d - r e m o v e w i t h c o u n t 42
Then t h e e r r o r " T h e r e ' s n o d o w n l o a d 4 2 ! " s h o u l d b e s h o w n
Scenario : Removing a download which is not done yet
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d r i p ? n u m b y t e s = 128 & d u r a t i o n = 5
And I r u n : d o w n l o a d - r e m o v e
Then t h e e r r o r " D o w n l o a d 1 i s n o t d o n e ! " s h o u l d b e s h o w n
Scenario : Removing a download which is not done yet (with count)
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d r i p ? n u m b y t e s = 128 & d u r a t i o n = 5
And I r u n : d o w n l o a d - r e m o v e w i t h c o u n t 1
Then t h e e r r o r " D o w n l o a d 1 i s n o t d o n e ! " s h o u l d b e s h o w n
Scenario : Removing all downloads via :download-remove
2016-11-07 11:42:02 +01:00
When I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2016-09-10 15:51:49 +02:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d 2. b i n w i t h o u t w a i t i n g
2016-09-10 15:51:49 +02:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : d o w n l o a d - r e m o v e - - a l l
Then " R e m o v e d d o w n l o a d * " s h o u l d b e l o g g e d
Scenario : Removing all downloads via :download-clear
2016-11-07 11:42:02 +01:00
When I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2016-09-10 15:51:49 +02:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d 2. b i n w i t h o u t w a i t i n g
2016-09-10 15:51:49 +02:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : d o w n l o a d - c l e a r
Then " R e m o v e d d o w n l o a d * " s h o u l d b e l o g g e d
2016-03-14 19:06:42 +01:00
## :download-delete
Scenario : Deleting a download
2016-11-07 11:42:02 +01:00
When I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2016-03-14 19:06:42 +01:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : d o w n l o a d - d e l e t e
2016-04-26 22:56:06 +02:00
And I w a i t f o r " d e l e t e d d o w n l o a d * " i n t h e l o g
2016-03-14 19:06:42 +01:00
Then t h e d o w n l o a d e d f i l e d o w n l o a d . b i n s h o u l d n o t e x i s t
Scenario : Deleting a download which does not exist
When I r u n : d o w n l o a d - d e l e t e w i t h c o u n t 42
Then t h e e r r o r " T h e r e ' s n o d o w n l o a d 4 2 ! " s h o u l d b e s h o w n
Scenario : Deleting a download which is not done yet
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d r i p ? n u m b y t e s = 128 & d u r a t i o n = 5
And I r u n : d o w n l o a d - d e l e t e
Then t h e e r r o r " D o w n l o a d 1 i s n o t d o n e ! " s h o u l d b e s h o w n
Scenario : Deleting a download which is not done yet (with count)
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d r i p ? n u m b y t e s = 128 & d u r a t i o n = 5
And I r u n : d o w n l o a d - d e l e t e w i t h c o u n t 1
Then t h e e r r o r " D o w n l o a d 1 i s n o t d o n e ! " s h o u l d b e s h o w n
## :download-open
2016-08-03 17:55:52 +02:00
Scenario : Opening a download
2016-11-07 11:42:02 +01:00
When I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2016-08-03 17:55:52 +02:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I o p e n t h e d o w n l o a d
Then " O p e n i n g * d o w n l o a d . b i n * w i t h [ * p y t h o n * ] " s h o u l d b e l o g g e d
2016-03-14 19:06:42 +01:00
2016-09-09 18:42:55 +02:00
Scenario : Opening a download with a placeholder
2016-11-07 11:42:02 +01:00
When I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2016-09-09 18:42:55 +02:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I o p e n t h e d o w n l o a d w i t h a p l a c e h o l d e r
Then " O p e n i n g * d o w n l o a d . b i n * w i t h [ * p y t h o n * ] " s h o u l d b e l o g g e d
2016-12-20 02:39:30 +01:00
Scenario : Opening a download with default-open-dispatcher set
2016-12-20 10:43:22 +01:00
When I s e t a t e s t p y t h o n d e f a u l t - o p e n - d i s p a t c h e r
2016-12-20 02:39:30 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
2016-12-20 10:43:22 +01:00
And I r u n : d o w n l o a d - o p e n
2016-12-20 02:39:30 +01:00
Then " O p e n i n g * d o w n l o a d . b i n * w i t h [ * p y t h o n * ] " s h o u l d b e l o g g e d
2016-12-20 10:43:22 +01:00
Scenario : Opening a download with default-open-dispatcher set and override
When I s e t g e n e r a l - > d e f a u l t - o p e n - d i s p a t c h e r t o c a t
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I o p e n t h e d o w n l o a d
Then " O p e n i n g * d o w n l o a d . b i n * w i t h [ * p y t h o n * ] " s h o u l d b e l o g g e d
2016-09-09 18:42:55 +02:00
2016-03-14 19:06:42 +01:00
Scenario : Opening a download which does not exist
When I r u n : d o w n l o a d - o p e n w i t h c o u n t 42
Then t h e e r r o r " T h e r e ' s n o d o w n l o a d 4 2 ! " s h o u l d b e s h o w n
Scenario : Opening a download which is not done yet
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d r i p ? n u m b y t e s = 128 & d u r a t i o n = 5
And I r u n : d o w n l o a d - o p e n
Then t h e e r r o r " D o w n l o a d 1 i s n o t d o n e ! " s h o u l d b e s h o w n
Scenario : Opening a download which is not done yet (with count)
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d r i p ? n u m b y t e s = 128 & d u r a t i o n = 5
And I r u n : d o w n l o a d - o p e n w i t h c o u n t 1
Then t h e e r r o r " D o w n l o a d 1 i s n o t d o n e ! " s h o u l d b e s h o w n
2016-05-05 00:04:58 +02:00
2016-08-03 17:55:52 +02:00
## opening a file directly (prompt-open-download)
Scenario : Opening a download directly
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
And I w a i t f o r t h e d o w n l o a d p r o m p t f o r " * "
2016-08-03 17:55:52 +02:00
And I d i r e c t l y o p e n t h e d o w n l o a d
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then " O p e n i n g * d o w n l o a d . b i n * w i t h [ * p y t h o n * ] " s h o u l d b e l o g g e d
2017-02-05 00:13:11 +01:00
# https://github.com/qutebrowser/qutebrowser/issues/1728
2016-08-03 17:55:52 +02:00
Scenario : Cancelling a download that should be opened
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d r i p ? n u m b y t e s = 128 & d u r a t i o n = 5
2016-11-07 11:42:02 +01:00
And I w a i t f o r t h e d o w n l o a d p r o m p t f o r " * "
2016-08-03 17:55:52 +02:00
And I d i r e c t l y o p e n t h e d o w n l o a d
And I r u n : d o w n l o a d - c a n c e l
Then " * f i n i s h e d b u t n o t s u c c e s s f u l , n o t o p e n i n g ! " s h o u l d b e l o g g e d
2017-02-05 00:13:11 +01:00
# https://github.com/qutebrowser/qutebrowser/issues/1725
2016-08-04 01:06:42 +02:00
Scenario : Directly open a download with a very long filename
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I o p e n d a t a / d o w n l o a d s / i s s u e 1725. h t m l
2016-08-18 16:13:38 +02:00
And I r u n : c l i c k - e l e m e n t i d l o n g - l i n k
2016-11-07 11:42:02 +01:00
And I w a i t f o r t h e d o w n l o a d p r o m p t f o r " * "
2016-08-04 01:06:42 +02:00
And I d i r e c t l y o p e n t h e d o w n l o a d
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then " O p e n i n g * w i t h [ * p y t h o n * ] " s h o u l d b e l o g g e d
2016-04-05 11:42:42 +02:00
## completion -> download-path-suggestion
Scenario : completion -> download-path-suggestion = path
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I s e t c o m p l e t i o n - > d o w n l o a d - p a t h - s u g g e s t i o n t o p a t h
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2017-01-13 17:59:03 +01:00
Then t h e d o w n l o a d p r o m p t s h o u l d b e s h o w n w i t h " ( t m p d i r ) / d o w n l o a d s / "
2016-04-05 11:42:42 +02:00
Scenario : completion -> download-path-suggestion = filename
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I s e t c o m p l e t i o n - > d o w n l o a d - p a t h - s u g g e s t i o n t o f i l e n a m e
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2016-04-05 11:42:42 +02:00
Then t h e d o w n l o a d p r o m p t s h o u l d b e s h o w n w i t h " d o w n l o a d . b i n "
Scenario : completion -> download-path-suggestion = both
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I s e t c o m p l e t i o n - > d o w n l o a d - p a t h - s u g g e s t i o n t o b o t h
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2017-01-13 17:59:03 +01:00
Then t h e d o w n l o a d p r o m p t s h o u l d b e s h o w n w i t h " ( t m p d i r ) / d o w n l o a d s / d o w n l o a d . b i n "
2016-04-05 11:42:42 +02:00
2016-09-09 16:17:59 +02:00
## storage -> remember-download-directory
2016-03-31 19:09:43 +02:00
2016-09-09 16:17:59 +02:00
Scenario : Remembering the last download directory
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I s e t c o m p l e t i o n - > d o w n l o a d - p a t h - s u g g e s t i o n t o b o t h
And I s e t s t o r a g e - > r e m e m b e r - d o w n l o a d - d i r e c t o r y t o t r u e
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2016-09-09 16:17:59 +02:00
And I w a i t f o r t h e d o w n l o a d p r o m p t f o r " * / d o w n l o a d . b i n "
2017-01-13 17:59:03 +01:00
And I r u n : p r o m p t - a c c e p t ( t m p d i r ) ( d i r s e p ) d o w n l o a d s ( d i r s e p ) s u b d i r
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d 2. b i n w i t h o u t w a i t i n g
2017-01-13 17:59:03 +01:00
Then t h e d o w n l o a d p r o m p t s h o u l d b e s h o w n w i t h " ( t m p d i r ) / d o w n l o a d s / s u b d i r / d o w n l o a d 2 . b i n "
2016-05-09 07:06:58 +02:00
2016-09-09 16:17:59 +02:00
Scenario : Not remembering the last download directory
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I s e t c o m p l e t i o n - > d o w n l o a d - p a t h - s u g g e s t i o n t o b o t h
And I s e t s t o r a g e - > r e m e m b e r - d o w n l o a d - d i r e c t o r y t o f a l s e
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2017-01-13 17:59:03 +01:00
And I w a i t f o r t h e d o w n l o a d p r o m p t f o r " ( t m p d i r ) / d o w n l o a d s / d o w n l o a d . b i n "
And I r u n : p r o m p t - a c c e p t ( t m p d i r ) ( d i r s e p ) d o w n l o a d s ( d i r s e p ) s u b d i r
2016-11-07 11:42:02 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d 2. b i n w i t h o u t w a i t i n g
2017-01-13 17:59:03 +01:00
Then t h e d o w n l o a d p r o m p t s h o u l d b e s h o w n w i t h " ( t m p d i r ) / d o w n l o a d s / d o w n l o a d 2 . b i n "
2016-09-09 16:58:39 +02:00
2017-02-05 00:13:11 +01:00
# https://github.com/qutebrowser/qutebrowser/issues/2173
2016-12-20 15:57:00 +01:00
Scenario : Remembering the temporary download directory (issue 2173)
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
2016-12-22 14:22:37 +01:00
And I s e t c o m p l e t i o n - > d o w n l o a d - p a t h - s u g g e s t i o n t o b o t h
2016-12-20 15:57:00 +01:00
And I s e t s t o r a g e - > r e m e m b e r - d o w n l o a d - d i r e c t o r y t o t r u e
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
And I w a i t f o r t h e d o w n l o a d p r o m p t f o r " * "
2017-01-18 08:51:03 +01:00
And I r u n : p r o m p t - a c c e p t ( t m p d i r ) ( d i r s e p ) d o w n l o a d s
2016-12-20 15:57:00 +01:00
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
And I w a i t f o r t h e d o w n l o a d p r o m p t f o r " * "
And I d i r e c t l y o p e n t h e d o w n l o a d
And I o p e n d a t a / d o w n l o a d s / d o w n l o a d . b i n w i t h o u t w a i t i n g
2017-01-13 17:59:03 +01:00
Then t h e d o w n l o a d p r o m p t s h o u l d b e s h o w n w i t h " ( t m p d i r ) / d o w n l o a d s / d o w n l o a d . b i n "
2016-12-20 15:57:00 +01:00
2016-09-10 15:51:49 +02:00
# Overwriting files
Scenario : Not overwriting an existing file
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d . b i n
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d 2. b i n - - d e s t d o w n l o a d . b i n
And I w a i t f o r " E n t e r i n g m o d e K e y M o d e . y e s n o * " i n t h e l o g
And I r u n : p r o m p t - a c c e p t n o
2017-02-07 22:27:32 +01:00
Then t h e d o w n l o a d e d f i l e d o w n l o a d . b i n s h o u l d b e 1 b y t e s b i g
2016-09-10 15:51:49 +02:00
Scenario : Overwriting an existing file
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d . b i n
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d 2. b i n - - d e s t d o w n l o a d . b i n
And I w a i t f o r " E n t e r i n g m o d e K e y M o d e . y e s n o * " i n t h e l o g
And I r u n : p r o m p t - a c c e p t y e s
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
2017-02-07 22:27:32 +01:00
Then t h e d o w n l o a d e d f i l e d o w n l o a d . b i n s h o u l d b e 2 b y t e s b i g
2016-09-10 15:51:49 +02:00
@linux
Scenario : Not overwriting a special file
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d . b i n - - d e s t f i f o
And I w a i t f o r " E n t e r i n g m o d e K e y M o d e . y e s n o * " i n t h e l o g
And I r u n : p r o m p t - a c c e p t n o
Then t h e F I F O s h o u l d s t i l l b e a F I F O
## Redirects
Scenario : Downloading with infinite redirect
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / r e d i r e c t / 12 - - d e s t r e d i r e c t i o n
Then t h e e r r o r " D o w n l o a d e r r o r : M a x i m u m r e d i r e c t i o n c o u n t r e a c h e d ! " s h o u l d b e s h o w n
2016-09-11 15:53:46 +02:00
And " D e l e t e d * r e d i r e c t i o n " s h o u l d b e l o g g e d
2016-09-10 15:51:49 +02:00
And t h e d o w n l o a d e d f i l e r e d i r e c t i o n s h o u l d n o t e x i s t
Scenario : Downloading with redirect to itself
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / c u s t o m / r e d i r e c t - s e l f
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e r e d i r e c t - s e l f s h o u l d e x i s t
Scenario : Downloading with absolute redirect
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / a b s o l u t e - r e d i r e c t / 1
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e 1 s h o u l d e x i s t
Scenario : Downloading with relative redirect
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / r e l a t i v e - r e d i r e c t / 1
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e 1 s h o u l d e x i s t
2016-09-09 16:58:39 +02:00
## Other
Scenario : Download without a content-size
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
When I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / c u s t o m / c o n t e n t - s i z e
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e c o n t e n t - s i z e s h o u l d e x i s t
2016-09-10 15:51:49 +02:00
@posix
Scenario : Downloading to unwritable destination
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
2017-01-13 17:59:03 +01:00
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d . b i n - - d e s t ( t m p d i r ) / d o w n l o a d s / u n w r i t a b l e
2016-09-10 15:51:49 +02:00
Then t h e e r r o r " D o w n l o a d e r r o r : P e r m i s s i o n d e n i e d " s h o u l d b e s h o w n
Scenario : Downloading 20MB file
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / c u s t o m / t w e n t y - m b
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
2017-02-07 22:27:32 +01:00
Then t h e d o w n l o a d e d f i l e t w e n t y - m b s h o u l d b e 20971520 b y t e s b i g
2016-09-10 15:51:49 +02:00
Scenario : Downloading 20MB file with late prompt confirmation
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / c u s t o m / t w e n t y - m b
And I w a i t 1 s
And I r u n : p r o m p t - a c c e p t
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
2017-02-07 22:27:32 +01:00
Then t h e d o w n l o a d e d f i l e t w e n t y - m b s h o u l d b e 20971520 b y t e s b i g
2016-09-10 15:51:49 +02:00
Scenario : Downloading invalid URL
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I s e t g e n e r a l - > a u t o - s e a r c h t o f a l s e
And I r u n : d o w n l o a d f o o !
Then t h e e r r o r " I n v a l i d U R L " s h o u l d b e s h o w n
2017-06-09 10:28:41 +02:00
@qtwebengine_todo: p d f j s i s n o t i m p l e m e n t e d y e t
2016-09-10 15:51:49 +02:00
Scenario : Downloading via pdfjs
Given p d f j s i s a v a i l a b l e
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I s e t c o n t e n t - > e n a b l e - p d f j s t o t r u e
And I o p e n d a t a / m i s c / t e s t . p d f
And I w a i t f o r t h e j a v a s c r i p t m e s s a g e " P D F * [ * ] ( P D F . j s : * ) "
And I r u n : c l i c k - e l e m e n t i d d o w n l o a d
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e t e s t . p d f s h o u l d e x i s t
2016-10-27 09:16:19 +02:00
Scenario : Answering a question for a cancelled download (#415)
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o t r u e
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d . b i n
2016-10-28 18:40:55 +02:00
And I w a i t f o r " A s k i n g q u e s t i o n <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> t e x t = * t i t l e = ' S a v e f i l e t o : ' > , * " i n t h e l o g
2016-10-27 09:16:19 +02:00
And I r u n : d o w n l o a d h t t p : / / l o c a l h o s t : ( p o r t ) / d a t a / d o w n l o a d s / d o w n l o a d 2. b i n
2016-10-28 18:40:55 +02:00
And I w a i t f o r " A s k i n g q u e s t i o n <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> t e x t = * t i t l e = ' S a v e f i l e t o : ' > , * " i n t h e l o g
2016-10-27 09:16:19 +02:00
And I r u n : d o w n l o a d - c a n c e l w i t h c o u n t 2
And I r u n : p r o m p t - a c c e p t
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e d o w n l o a d . b i n s h o u l d e x i s t
And t h e d o w n l o a d e d f i l e d o w n l o a d 2. b i n s h o u l d n o t e x i s t
2016-11-08 09:05:46 +01:00
Scenario : Downloading a file with unknown size
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I o p e n s t r e a m - b y t e s / 1024 w i t h o u t w a i t i n g
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e 1024 s h o u l d e x i s t
2017-02-07 21:59:21 +01:00
@qtwebengine_skip: W e c a n ' t g e t t h e U A f r o m t h e p a g e t h e r e
Scenario : user-agent when using :download
When I o p e n u s e r - a g e n t
And I r u n : d o w n l o a d
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e u s e r - a g e n t s h o u l d c o n t a i n S a f a r i /
@qtwebengine_skip: W e c a n ' t g e t t h e U A f r o m t h e p a g e t h e r e
Scenario : user-agent when using hints
2017-02-07 23:23:59 +01:00
When I s e t h i n t s - > m o d e t o n u m b e r
And I o p e n /
2017-02-07 21:59:21 +01:00
And I r u n : h i n t l i n k s d o w n l o a d
2017-02-07 23:33:37 +01:00
And I p r e s s t h e k e y s " u s " # user-agent
And I r u n : f o l l o w - h i n t 0
2017-02-07 21:59:21 +01:00
And I w a i t u n t i l t h e d o w n l o a d i s f i n i s h e d
Then t h e d o w n l o a d e d f i l e u s e r - a g e n t s h o u l d c o n t a i n S a f a r i /
2017-03-22 13:38:03 +01:00
@qtwebengine_skip: H a n d l e d b y Q t W e b E n g i n e , n o t b y u s
Scenario : Downloading a "Internal server error" with disposition: inline (#2304)
When I s e t s t o r a g e - > p r o m p t - d o w n l o a d - d i r e c t o r y t o f a l s e
And I o p e n c u s t o m / 500 - i n l i n e
Then t h e e r r o r " D o w n l o a d e r r o r : * I N T E R N A L S E R V E R E R R O R " s h o u l d b e s h o w n