Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
741ae589
Unverified
Commit
741ae589
authored
8 months ago
by
Uladzimir Havenchyk
Committed by
GitHub
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
ci: enable video recordings for failing cypress tests (#46281)
parent
d5601723
Branches
test-flakiness
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
e2e/support/config.js
+19
-0
19 additions, 0 deletions
e2e/support/config.js
with
19 additions
and
0 deletions
e2e/support/config.js
+
19
−
0
View file @
741ae589
import
fs
from
"
node:fs
"
;
import
path
from
"
node:path
"
;
import
{
...
...
@@ -95,6 +96,21 @@ const defaultConfig = {
removeDirectory
,
});
// this is an official workaround to keep recordings of the failed specs only
// https://docs.cypress.io/guides/guides/screenshots-and-videos#Delete-videos-for-specs-without-failing-or-retried-tests
on
(
"
after:spec
"
,
(
spec
,
results
)
=>
{
if
(
results
&&
results
.
video
)
{
// Do we have failures for any retry attempts?
const
failures
=
results
.
tests
.
some
(
test
=>
test
.
attempts
.
some
(
attempt
=>
attempt
.
state
===
"
failed
"
),
);
if
(
!
failures
)
{
// delete the video if the spec passed and no tests retried
fs
.
unlinkSync
(
results
.
video
);
}
}
});
/********************************************************************
** CONFIG **
********************************************************************/
...
...
@@ -134,6 +150,9 @@ const defaultConfig = {
specPattern
:
"
e2e/test/**/*.cy.spec.{js,ts}
"
,
viewportHeight
:
800
,
viewportWidth
:
1280
,
// enable video recording in run mode
video
:
true
,
videoCompression
:
true
,
};
const
mainConfig
=
{
...
...
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