Fix first bunch of download tests
This commit is contained in:
parent
ce1b675a1e
commit
bc1e4385e0
@ -50,11 +50,13 @@ class DownloadItem(downloads.AbstractDownloadItem):
|
|||||||
state_name = debug.qenum_key(QWebEngineDownloadItem, state)
|
state_name = debug.qenum_key(QWebEngineDownloadItem, state)
|
||||||
log.downloads.debug("State for {!r} changed to {}".format(
|
log.downloads.debug("State for {!r} changed to {}".format(
|
||||||
self, state_name))
|
self, state_name))
|
||||||
|
|
||||||
if state == QWebEngineDownloadItem.DownloadRequested:
|
if state == QWebEngineDownloadItem.DownloadRequested:
|
||||||
pass
|
pass
|
||||||
elif state == QWebEngineDownloadItem.DownloadInProgress:
|
elif state == QWebEngineDownloadItem.DownloadInProgress:
|
||||||
pass
|
pass
|
||||||
elif state == QWebEngineDownloadItem.DownloadCompleted:
|
elif state == QWebEngineDownloadItem.DownloadCompleted:
|
||||||
|
log.downloads.debug("Download {} finished".format(self.basename))
|
||||||
self.successful = True
|
self.successful = True
|
||||||
self.done = True
|
self.done = True
|
||||||
self.finished.emit()
|
self.finished.emit()
|
||||||
|
@ -75,6 +75,7 @@ Feature: Downloading things from a website.
|
|||||||
And I run :leave-mode
|
And I run :leave-mode
|
||||||
Then no crash should happen
|
Then no crash should happen
|
||||||
|
|
||||||
|
@qtwebengine_todo: ssl-strict is not implemented yet
|
||||||
Scenario: Downloading with SSL errors (issue 1413)
|
Scenario: Downloading with SSL errors (issue 1413)
|
||||||
When I run :debug-clear-ssl-errors
|
When I run :debug-clear-ssl-errors
|
||||||
And I set network -> ssl-strict to ask
|
And I set network -> ssl-strict to ask
|
||||||
@ -85,7 +86,7 @@ Feature: Downloading things from a website.
|
|||||||
|
|
||||||
Scenario: Closing window with remove-finished-downloads timeout (issue 1242)
|
Scenario: Closing window with remove-finished-downloads timeout (issue 1242)
|
||||||
When I set ui -> remove-finished-downloads to 500
|
When I set ui -> remove-finished-downloads to 500
|
||||||
And I open data/downloads/download.bin in a new window
|
And I open data/downloads/download.bin in a new window without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I run :close
|
And I run :close
|
||||||
And I wait 0.5s
|
And I wait 0.5s
|
||||||
@ -95,7 +96,7 @@ Feature: Downloading things from a website.
|
|||||||
Given I have a fresh instance
|
Given I have a fresh instance
|
||||||
When I set storage -> prompt-download-directory to false
|
When I set storage -> prompt-download-directory to false
|
||||||
And I set ui -> confirm-quit to downloads
|
And I set ui -> confirm-quit to downloads
|
||||||
And I open data/downloads/download.bin
|
And I open data/downloads/download.bin without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I run :close
|
And I run :close
|
||||||
Then qutebrowser should quit
|
Then qutebrowser should quit
|
||||||
@ -171,12 +172,14 @@ Feature: Downloading things from a website.
|
|||||||
|
|
||||||
## mhtml downloads
|
## mhtml downloads
|
||||||
|
|
||||||
|
@qtwebengine_todo: :download --mhtml is not implemented yet
|
||||||
Scenario: Downloading as mhtml is available
|
Scenario: Downloading as mhtml is available
|
||||||
When I open html
|
When I open html
|
||||||
And I run :download --mhtml
|
And I run :download --mhtml
|
||||||
And I wait for "File successfully written." in the log
|
And I wait for "File successfully written." in the log
|
||||||
Then no crash should happen
|
Then no crash should happen
|
||||||
|
|
||||||
|
@qtwebengine_todo: :download --mhtml is not implemented yet
|
||||||
Scenario: Downloading as mhtml with non-ASCII headers
|
Scenario: Downloading as mhtml with non-ASCII headers
|
||||||
When I open response-headers?Content-Type=text%2Fpl%C3%A4in
|
When I open response-headers?Content-Type=text%2Fpl%C3%A4in
|
||||||
And I run :download --mhtml --dest mhtml-response-headers.mht
|
And I run :download --mhtml --dest mhtml-response-headers.mht
|
||||||
@ -199,13 +202,13 @@ Feature: Downloading things from a website.
|
|||||||
Then the error "There's no download 42!" should be shown
|
Then the error "There's no download 42!" should be shown
|
||||||
|
|
||||||
Scenario: Cancelling a download which is already done
|
Scenario: Cancelling a download which is already done
|
||||||
When I open data/downloads/download.bin
|
When I open data/downloads/download.bin without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I run :download-cancel
|
And I run :download-cancel
|
||||||
Then the error "Download 1 is already done!" should be shown
|
Then the error "Download 1 is already done!" should be shown
|
||||||
|
|
||||||
Scenario: Cancelling a download which is already done (with count)
|
Scenario: Cancelling a download which is already done (with count)
|
||||||
When I open data/downloads/download.bin
|
When I open data/downloads/download.bin without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I run :download-cancel with count 1
|
And I run :download-cancel with count 1
|
||||||
Then the error "Download 1 is already done!" should be shown
|
Then the error "Download 1 is already done!" should be shown
|
||||||
@ -218,6 +221,7 @@ Feature: Downloading things from a website.
|
|||||||
And "cancelled" should be logged
|
And "cancelled" should be logged
|
||||||
|
|
||||||
# https://github.com/The-Compiler/qutebrowser/issues/1535
|
# https://github.com/The-Compiler/qutebrowser/issues/1535
|
||||||
|
@qtwebengine_todo: :download --mhtml is not implemented yet
|
||||||
Scenario: Cancelling an MHTML download (issue 1535)
|
Scenario: Cancelling an MHTML download (issue 1535)
|
||||||
When I open data/downloads/issue1535.html
|
When I open data/downloads/issue1535.html
|
||||||
And I run :download --mhtml
|
And I run :download --mhtml
|
||||||
@ -228,7 +232,7 @@ Feature: Downloading things from a website.
|
|||||||
## :download-remove / :download-clear
|
## :download-remove / :download-clear
|
||||||
|
|
||||||
Scenario: Removing a download
|
Scenario: Removing a download
|
||||||
When I open data/downloads/download.bin
|
When I open data/downloads/download.bin without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I run :download-remove
|
And I run :download-remove
|
||||||
Then "Removed download *" should be logged
|
Then "Removed download *" should be logged
|
||||||
@ -248,17 +252,17 @@ Feature: Downloading things from a website.
|
|||||||
Then the error "Download 1 is not done!" should be shown
|
Then the error "Download 1 is not done!" should be shown
|
||||||
|
|
||||||
Scenario: Removing all downloads via :download-remove
|
Scenario: Removing all downloads via :download-remove
|
||||||
When I open data/downloads/download.bin
|
When I open data/downloads/download.bin without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I open data/downloads/download2.bin
|
And I open data/downloads/download2.bin without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I run :download-remove --all
|
And I run :download-remove --all
|
||||||
Then "Removed download *" should be logged
|
Then "Removed download *" should be logged
|
||||||
|
|
||||||
Scenario: Removing all downloads via :download-clear
|
Scenario: Removing all downloads via :download-clear
|
||||||
When I open data/downloads/download.bin
|
When I open data/downloads/download.bin without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I open data/downloads/download2.bin
|
And I open data/downloads/download2.bin without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I run :download-clear
|
And I run :download-clear
|
||||||
Then "Removed download *" should be logged
|
Then "Removed download *" should be logged
|
||||||
@ -266,7 +270,7 @@ Feature: Downloading things from a website.
|
|||||||
## :download-delete
|
## :download-delete
|
||||||
|
|
||||||
Scenario: Deleting a download
|
Scenario: Deleting a download
|
||||||
When I open data/downloads/download.bin
|
When I open data/downloads/download.bin without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I run :download-delete
|
And I run :download-delete
|
||||||
And I wait for "deleted download *" in the log
|
And I wait for "deleted download *" in the log
|
||||||
@ -289,13 +293,13 @@ Feature: Downloading things from a website.
|
|||||||
## :download-open
|
## :download-open
|
||||||
|
|
||||||
Scenario: Opening a download
|
Scenario: Opening a download
|
||||||
When I open data/downloads/download.bin
|
When I open data/downloads/download.bin without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I open the download
|
And I open the download
|
||||||
Then "Opening *download.bin* with [*python*]" should be logged
|
Then "Opening *download.bin* with [*python*]" should be logged
|
||||||
|
|
||||||
Scenario: Opening a download with a placeholder
|
Scenario: Opening a download with a placeholder
|
||||||
When I open data/downloads/download.bin
|
When I open data/downloads/download.bin without waiting
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
And I open the download with a placeholder
|
And I open the download with a placeholder
|
||||||
Then "Opening *download.bin* with [*python*]" should be logged
|
Then "Opening *download.bin* with [*python*]" should be logged
|
||||||
@ -318,7 +322,8 @@ Feature: Downloading things from a website.
|
|||||||
|
|
||||||
Scenario: Opening a download directly
|
Scenario: Opening a download directly
|
||||||
When I set storage -> prompt-download-directory to true
|
When I set storage -> prompt-download-directory to true
|
||||||
And I open data/downloads/download.bin
|
And I open data/downloads/download.bin without waiting
|
||||||
|
And I wait for the download prompt for "*"
|
||||||
And I directly open the download
|
And I directly open the download
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
Then "Opening *download.bin* with [*python*]" should be logged
|
Then "Opening *download.bin* with [*python*]" should be logged
|
||||||
@ -328,6 +333,7 @@ Feature: Downloading things from a website.
|
|||||||
Scenario: Cancelling a download that should be opened
|
Scenario: Cancelling a download that should be opened
|
||||||
When I set storage -> prompt-download-directory to true
|
When I set storage -> prompt-download-directory to true
|
||||||
And I run :download http://localhost:(port)/drip?numbytes=128&duration=5
|
And I run :download http://localhost:(port)/drip?numbytes=128&duration=5
|
||||||
|
And I wait for the download prompt for "*"
|
||||||
And I directly open the download
|
And I directly open the download
|
||||||
And I run :download-cancel
|
And I run :download-cancel
|
||||||
Then "* finished but not successful, not opening!" should be logged
|
Then "* finished but not successful, not opening!" should be logged
|
||||||
@ -338,7 +344,7 @@ Feature: Downloading things from a website.
|
|||||||
When I set storage -> prompt-download-directory to true
|
When I set storage -> prompt-download-directory to true
|
||||||
And I open data/downloads/issue1725.html
|
And I open data/downloads/issue1725.html
|
||||||
And I run :click-element id long-link
|
And I run :click-element id long-link
|
||||||
And I wait for "Asking question <qutebrowser.utils.usertypes.Question default=* mode=<PromptMode.download: 5> text=* title='Save file to:'>, *" in the log
|
And I wait for the download prompt for "*"
|
||||||
And I directly open the download
|
And I directly open the download
|
||||||
And I wait until the download is finished
|
And I wait until the download is finished
|
||||||
Then "Opening * with [*python*]" should be logged
|
Then "Opening * with [*python*]" should be logged
|
||||||
@ -348,19 +354,19 @@ Feature: Downloading things from a website.
|
|||||||
Scenario: completion -> download-path-suggestion = path
|
Scenario: completion -> download-path-suggestion = path
|
||||||
When I set storage -> prompt-download-directory to true
|
When I set storage -> prompt-download-directory to true
|
||||||
And I set completion -> download-path-suggestion to path
|
And I set completion -> download-path-suggestion to path
|
||||||
And I open data/downloads/download.bin
|
And I open data/downloads/download.bin without waiting
|
||||||
Then the download prompt should be shown with "(tmpdir)/"
|
Then the download prompt should be shown with "(tmpdir)/"
|
||||||
|
|
||||||
Scenario: completion -> download-path-suggestion = filename
|
Scenario: completion -> download-path-suggestion = filename
|
||||||
When I set storage -> prompt-download-directory to true
|
When I set storage -> prompt-download-directory to true
|
||||||
And I set completion -> download-path-suggestion to filename
|
And I set completion -> download-path-suggestion to filename
|
||||||
And I open data/downloads/download.bin
|
And I open data/downloads/download.bin without waiting
|
||||||
Then the download prompt should be shown with "download.bin"
|
Then the download prompt should be shown with "download.bin"
|
||||||
|
|
||||||
Scenario: completion -> download-path-suggestion = both
|
Scenario: completion -> download-path-suggestion = both
|
||||||
When I set storage -> prompt-download-directory to true
|
When I set storage -> prompt-download-directory to true
|
||||||
And I set completion -> download-path-suggestion to both
|
And I set completion -> download-path-suggestion to both
|
||||||
And I open data/downloads/download.bin
|
And I open data/downloads/download.bin without waiting
|
||||||
Then the download prompt should be shown with "(tmpdir)/download.bin"
|
Then the download prompt should be shown with "(tmpdir)/download.bin"
|
||||||
|
|
||||||
## storage -> remember-download-directory
|
## storage -> remember-download-directory
|
||||||
@ -369,20 +375,20 @@ Feature: Downloading things from a website.
|
|||||||
When I set storage -> prompt-download-directory to true
|
When I set storage -> prompt-download-directory to true
|
||||||
And I set completion -> download-path-suggestion to both
|
And I set completion -> download-path-suggestion to both
|
||||||
And I set storage -> remember-download-directory to true
|
And I set storage -> remember-download-directory to true
|
||||||
And I open data/downloads/download.bin
|
And I open data/downloads/download.bin without waiting
|
||||||
And I wait for the download prompt for "*/download.bin"
|
And I wait for the download prompt for "*/download.bin"
|
||||||
And I run :prompt-accept (tmpdir)(dirsep)subdir
|
And I run :prompt-accept (tmpdir)(dirsep)subdir
|
||||||
And I open data/downloads/download2.bin
|
And I open data/downloads/download2.bin without waiting
|
||||||
Then the download prompt should be shown with "(tmpdir)/subdir/download2.bin"
|
Then the download prompt should be shown with "(tmpdir)/subdir/download2.bin"
|
||||||
|
|
||||||
Scenario: Not remembering the last download directory
|
Scenario: Not remembering the last download directory
|
||||||
When I set storage -> prompt-download-directory to true
|
When I set storage -> prompt-download-directory to true
|
||||||
And I set completion -> download-path-suggestion to both
|
And I set completion -> download-path-suggestion to both
|
||||||
And I set storage -> remember-download-directory to false
|
And I set storage -> remember-download-directory to false
|
||||||
And I open data/downloads/download.bin
|
And I open data/downloads/download.bin without waiting
|
||||||
And I wait for the download prompt for "(tmpdir)/download.bin"
|
And I wait for the download prompt for "(tmpdir)/download.bin"
|
||||||
And I run :prompt-accept (tmpdir)(dirsep)subdir
|
And I run :prompt-accept (tmpdir)(dirsep)subdir
|
||||||
And I open data/downloads/download2.bin
|
And I open data/downloads/download2.bin without waiting
|
||||||
Then the download prompt should be shown with "(tmpdir)/download2.bin"
|
Then the download prompt should be shown with "(tmpdir)/download2.bin"
|
||||||
|
|
||||||
# Overwriting files
|
# Overwriting files
|
||||||
@ -475,6 +481,7 @@ Feature: Downloading things from a website.
|
|||||||
And I run :download foo!
|
And I run :download foo!
|
||||||
Then the error "Invalid URL" should be shown
|
Then the error "Invalid URL" should be shown
|
||||||
|
|
||||||
|
@qtwebengine_todo: pdfjs is not implemented yet
|
||||||
Scenario: Downloading via pdfjs
|
Scenario: Downloading via pdfjs
|
||||||
Given pdfjs is available
|
Given pdfjs is available
|
||||||
When I set storage -> prompt-download-directory to false
|
When I set storage -> prompt-download-directory to false
|
||||||
|
Loading…
Reference in New Issue
Block a user