Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mat2-quasar-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jfriedli
mat2-quasar-frontend
Commits
ba275eaf
Verified
Commit
ba275eaf
authored
4 years ago
by
jfriedli
Browse files
Options
Downloads
Patches
Plain Diff
added download timer tests
parent
448b1d0b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!376
Time Remaining & updates
,
!375
Resolve "show remaining download time"
Pipeline
#45355
passed
4 years ago
Stage: test
Stage: renovate
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pages/Download.vue
+11
-1
11 additions, 1 deletion
src/pages/Download.vue
test/cypress/integration/download/downloadTimer.spec.js
+71
-0
71 additions, 0 deletions
test/cypress/integration/download/downloadTimer.spec.js
with
82 additions
and
1 deletion
src/pages/Download.vue
+
11
−
1
View file @
ba275eaf
...
...
@@ -189,6 +189,10 @@ export default {
}
this
.
initRemainingDownloadTimer
()
},
beforeRouteLeave
(
to
,
from
,
next
)
{
this
.
resetDownloadTimer
()
next
()
},
methods
:
{
deactivate
(
key
)
{
this
.
$set
(
this
.
deactivatedMap
,
key
,
true
)
...
...
@@ -224,10 +228,16 @@ export default {
}
}
},
resetDownloadTimer
()
{
if
(
this
.
downloadTimer
)
{
clearInterval
(
this
.
downloadTimer
)
}
this
.
downloadTimer
=
null
},
incrementSeconds
()
{
this
.
downloadTimeSeconds
+=
1
if
(
this
.
downloadTimeSeconds
>
this
.
maxDownloadTimeSeconds
)
{
clearInterval
(
this
.
d
ownloadTimer
)
this
.
resetD
ownloadTimer
(
)
this
.
$q
.
notify
({
color
:
'
warning
'
,
position
:
'
top
'
,
...
...
This diff is collapsed.
Click to expand it.
test/cypress/integration/download/downloadTimer.spec.js
0 → 100755
+
71
−
0
View file @
ba275eaf
import
'
cypress-file-upload
'
describe
(
'
Upload page download timer
'
,
()
=>
{
beforeEach
(()
=>
{
cy
.
unregisterServiceWorkers
()
})
it
(
'
should redirect to start page after expiring
'
,
()
=>
{
cy
.
server
()
cy
.
route
({
method
:
'
GET
'
,
url
:
'
/api/extension
'
,
response
:
[
'
.png
'
,
'
.txt
'
]
}).
as
(
'
supportedExtensions
'
)
cy
.
visit
(
'
/
'
)
cy
.
route
({
method
:
'
POST
'
,
url
:
'
/api/upload
'
,
status
:
201
,
response
:
{
inactive_after_sec
:
2
,
output_filename
:
'
txt0.cleaned.txt
'
,
mime
:
'
text/plain
'
,
key
:
'
cb2d44b5f75b98cf3ff9b6bdc8ee673f244983387491db3b18cf20514217cfe9
'
,
secret
:
'
e4701206f4821993f0d54f9c6f2531aaa307e4f89c97a8679ba455e26aa3fc74
'
,
meta
:
{},
meta_after
:
{},
download_link
:
'
https://api.matweb.info/api/download/cb2d44b5f75b98cf3ff9b6bdc8ee673f244983387491db3b18cf20514217cfe9/e4701206f4821993f0d54f9c6f2531aaa307e4f89c97a8679ba455e26aa3fc74/txt0.cleaned.txt
'
}
}).
as
(
'
postFile
'
)
cy
.
get
(
'
.uppy-Dashboard-input
'
).
attachFile
(
'
a-very-long-name-for-a-very-small-text-file-to-truncate.txt
'
)
cy
.
get
(
'
.uppy-StatusBar-actions > button
'
).
click
()
cy
.
wait
(
'
@postFile
'
)
cy
.
wait
(
3000
)
cy
.
location
().
should
((
loc
)
=>
{
expect
(
loc
.
pathname
).
to
.
eq
(
'
/
'
)
})
})
it
(
'
should not redirect after leaving the page
'
,
()
=>
{
cy
.
server
()
cy
.
route
({
method
:
'
GET
'
,
url
:
'
/api/extension
'
,
response
:
[
'
.png
'
,
'
.txt
'
]
}).
as
(
'
supportedExtensions
'
)
cy
.
visit
(
'
/
'
)
cy
.
route
({
method
:
'
POST
'
,
url
:
'
/api/upload
'
,
status
:
201
,
response
:
{
inactive_after_sec
:
2
,
output_filename
:
'
txt0.cleaned.txt
'
,
mime
:
'
text/plain
'
,
key
:
'
cb2d44b5f75b98cf3ff9b6bdc8ee673f244983387491db3b18cf20514217cfe9
'
,
secret
:
'
e4701206f4821993f0d54f9c6f2531aaa307e4f89c97a8679ba455e26aa3fc74
'
,
meta
:
{},
meta_after
:
{},
download_link
:
'
https://api.matweb.info/api/download/cb2d44b5f75b98cf3ff9b6bdc8ee673f244983387491db3b18cf20514217cfe9/e4701206f4821993f0d54f9c6f2531aaa307e4f89c97a8679ba455e26aa3fc74/txt0.cleaned.txt
'
}
}).
as
(
'
postFile
'
)
cy
.
get
(
'
.uppy-Dashboard-input
'
).
attachFile
(
'
a-very-long-name-for-a-very-small-text-file-to-truncate.txt
'
)
cy
.
get
(
'
.uppy-StatusBar-actions > button
'
).
click
()
cy
.
wait
(
'
@postFile
'
)
cy
.
visit
(
'
/info
'
)
cy
.
wait
(
3000
)
cy
.
location
().
should
((
loc
)
=>
{
expect
(
loc
.
pathname
).
to
.
eq
(
'
/info
'
)
})
})
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment