Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9344750
home.spec.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
home.spec.js
View Options
/**
* Copyright (C) 2019 The Software Heritage developers
* See the AUTHORS file at the top-level directory of this distribution
* License: GNU Affero General Public License version 3, or any later version
* See top-level LICENSE file for more information
*/
const
$
=
Cypress
.
$
;
const
url
=
'/'
;
describe
(
'Home Page Tests'
,
function
()
{
it
(
'should display positive stats for each category'
,
function
()
{
cy
.
server
();
cy
.
route
({
method
:
'GET'
,
url
:
this
.
Urls
.
stat_counters
()
}).
as
(
'getStatCounters'
);
cy
.
visit
(
url
)
.
wait
(
'@getStatCounters'
)
.
wait
(
500
)
.
get
(
'.swh-counter'
)
.
then
((
counters
)
=>
{
for
(
let
counter
of
counters
)
{
let
innerText
=
$
(
counter
).
text
();
const
value
=
parseInt
(
innerText
.
replace
(
/,/g
,
''
));
assert
.
isAbove
(
value
,
0
);
}
});
});
it
(
'should display null counters when storage is empty'
,
function
()
{
cy
.
server
();
cy
.
route
({
method
:
'GET'
,
url
:
this
.
Urls
.
stat_counters
(),
response
:
{
'stat_counters'
:
{},
'stat_counters_history'
:
{}
}
}).
as
(
'getStatCounters'
);
cy
.
visit
(
url
)
.
wait
(
'@getStatCounters'
)
.
wait
(
500
)
.
get
(
'.swh-counter'
)
.
then
((
counters
)
=>
{
for
(
let
counter
of
counters
)
{
const
value
=
parseInt
(
$
(
counter
).
text
());
assert
.
equal
(
value
,
0
);
}
});
});
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 4, 2:45 PM (3 d, 14 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3357808
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment