-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(webkit): add video recording #23579
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
0375b0a
to
7886a3d
Compare
@@ -1024,7 +1024,6 @@ describe('lib/cypress', () => { | |||
browser: 'electron', | |||
foo: 'bar', | |||
onNewWindow: sinon.match.func, | |||
writeVideoFrame: sinon.match.func, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this unit assertion since it's complex to mock now and is covered by other Electron tests that record video.
export type VideoRecording = { | ||
api: RunModeVideoApi | ||
controller?: BrowserVideoController | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm super open to input on these APIs, especially around naming and structure. I know it's currently not the smoothest experience. They're structured the way they are to avoid a complete refactor of this part of run.ts
, where two complex, asynchronous code paths that are interdependent require different parts of the BrowserVideoController
at different times:
cypress/packages/server/lib/modes/run.ts
Lines 848 to 879 in 4ad2279
const [results] = await Promise.all([ | |
waitForTestsToFinishRunning({ | |
spec, | |
config, | |
project, | |
estimated, | |
screenshots, | |
videoRecording, | |
exit: options.exit, | |
testingType: options.testingType, | |
videoCompression: options.videoCompression, | |
videoUploadOnPasses: options.videoUploadOnPasses, | |
quiet: options.quiet, | |
shouldKeepTabOpen: !isLastSpec, | |
}), | |
waitForBrowserToConnect({ | |
spec, | |
project, | |
browser, | |
screenshots, | |
onError, | |
videoRecording, | |
socketId: options.socketId, | |
webSecurity: options.webSecurity, | |
projectRoot: options.projectRoot, | |
testingType: options.testingType, | |
isFirstSpec, | |
experimentalSingleTabRunMode: config.experimentalSingleTabRunMode, | |
shouldLaunchNewTab: !isFirstSpec, | |
}), | |
]) |
Nice, great job, that’s a nice approach to add video capturing for Webkit :) |
a1efcbf
to
a8c42cf
Compare
a8c42cf
to
47adf21
Compare
@flotwig can you update the PR description with Steps to Test? 🙏 |
@rachelruderman done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried and tested!! Great job!!
I did not review this one yet (was not assigned, but can take a look this week) - but I did test it out as part of #23662 and the recording feature is working as expected, at least based on a few tests. I did not do more in depth testing yet. Should we be able to see recordings in the dashboard from WK with this PR @flotwig? My understanding is WK is only installed during local dev, so I guess not? |
@@ -529,7 +536,7 @@ export async function open (browser: Browser, url: string, options: BrowserLaunc | |||
// user can overwrite this default with these env vars or --height, --width arguments | |||
MOZ_HEADLESS_WIDTH: '1280', | |||
MOZ_HEADLESS_HEIGHT: '721', | |||
}) as LaunchedBrowser & { browserCriClient: BrowserCriClient} | |||
}) as unknown as BrowserInstance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen this before, tricky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... I don't know the "right" way to change the type of an object, type-safely, without using class ... extends ...
. If there even is a way without as unknown
. Would be nice to eventually remove the need for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one seems a quick fix #23693
I think what you are referring to is something like
function foo<T extends SomeBaseClass>(arg: T): T {
//
}
Now as long as arg
extends SomeBaseClass
you should get type safety (error if you don't extend the base class).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe like this?
Also works with interface
and plain objects ... not just limited to class
.
@lmiller1990 in the monorepo, it's a |
User facing changelog
n/a
Additional details
run.ts
and in to thebrowsers/*
drivers.run.ts
(start/end/restart control)webkit-system-tests
job. 60.it
s are skipped in this PR since they don't work yet. It breaks down like this:video_compression
system-test spec is unskipped and passing in WebKitSteps to test
Run a test project that records video in WebKit, for example:
(the project needs to have
playwright-webkit
installed)Video should be recorded to the videosFolder after doing this. No guarantee that the project won't fail for other reasons since WebKit is WIP.
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?