Skip to content
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

fix: everyNthFrame should only be applied for Chrome 89+ #18392

Merged
merged 5 commits into from
Oct 8, 2021

Conversation

davidmunechika
Copy link
Contributor

@davidmunechika davidmunechika commented Oct 7, 2021

User facing changelog

Capturing videos in Chrome versions earlier than 89 will no longer result in choppy video and skipped frames.

Additional details

We introduced capturing everyNthFrame to reduce the number of frames captured since Chrome began capturing more frames in Chrome 89+ (to help with performance). But the fix was applied broadly across all Chrome versions so that when running Cypress in Chrome 87, for example, the video will have a lot less frames and look choppy.

This PR removes using everyNthFrame if the Chrome version is less than 89, so the videos will have the correct number of frames and no longer be choppy.

Previous behavior (everyNthFrame applied to older Chrome versions, frames are skipped so the user cannot even see the end of the test):

spec.js.mp4

Current behavior (everyNthFrame not applied for older Chrome versions, frames are not skipped):

spec.js.mp4

PR Tasks

  • [n/a] Have tests been added/updated?
  • Has the original issue or this PR been tagged with a release in ZenHub?
  • [n/a] Has a PR for user-facing changes been opened in cypress-documentation?
  • [n/a] Have API changes been updated in the type definitions?
  • [n/a] Have new configuration options been added to the cypress.schema.json?

@davidmunechika davidmunechika self-assigned this Oct 7, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 7, 2021

Thanks for taking the time to open a PR!

@davidmunechika davidmunechika marked this pull request as ready for review October 7, 2021 13:55
@davidmunechika davidmunechika requested a review from a team as a code owner October 7, 2021 13:55
@davidmunechika davidmunechika requested review from flotwig and BlueWinds and removed request for a team October 7, 2021 13:55
flotwig
flotwig previously approved these changes Oct 7, 2021
packages/server/lib/browsers/chrome.ts Outdated Show resolved Hide resolved
packages/server/lib/browsers/chrome.ts Outdated Show resolved Hide resolved
@@ -273,7 +274,7 @@ const _maybeRecordVideo = async function (client, options) {
client.send('Page.screencastFrameAck', { sessionId: meta.sessionId })
})

await client.send('Page.startScreencast', screencastOpts)
await client.send('Page.startScreencast', browserMajorVersion >= CHROME_VERSION_WITH_FPS_INCREASE ? screencastOpts() : screencastOpts(1))
Copy link
Contributor

@flotwig flotwig Oct 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: In general, I try to avoid creating function overloads for stuff like this or doing boolean logic in the function declaration (like in screencastOpts()). But I get why you wrote it the way you did, and it passes lint, so I won't nit-pick too hard.

@cypress
Copy link

cypress bot commented Oct 7, 2021



Test summary

18540 0 214 7Flakiness 2


Run details

Project cypress
Status Passed
Commit 6f96575
Started Oct 8, 2021 1:33 PM
Ended Oct 8, 2021 1:48 PM
Duration 14:16 💡
OS Linux Debian - 10.9
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/proxy-logging-spec.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code
e2e/redirects_spec.js Flakiness
1 redirection > meta > binds to the new page after a timeout

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

@davidmunechika davidmunechika merged commit 9265669 into develop Oct 8, 2021
@davidmunechika davidmunechika deleted the issue-18021-every-nth-frame branch October 8, 2021 14:28
tgriesser added a commit that referenced this pull request Oct 8, 2021
* develop: (31 commits)
  fix: `everyNthFrame` should only be applied for Chrome 89+ (#18392)
  docs: General updates to contributing guide (#18283)
  chore: Update Chrome (beta) to 95.0.4638.40 (#18389)
  chore: use circleci timings split for e2e tests (#18367)
  fix: fixed title (#18370)
  chore(deps): update dependency electron to v14 🌟 (#18384)
  chore(server): share client route (#18215)
  fix: Prevent Cypress from crashing when argument parsing "spec: {}" (#18312)
  chore: update husky dev dependency to v7 (#18345)
  feat: add defineConfig function to help type config (#18302)
  chore: Update Chrome (stable) to 94.0.4606.71 (#18324)
  feat: allow to use TypeScript in the config file (#18300)
  allow select to be called with empty array (#18329)
  fix(vite-dev-server): windows `supportFile` + preserve optimize entries (#18286)
  chore: fix semantic-release dry run (#18332)
  fix(driver): improve status_code_flags_invalid error message (#18316)
  chore(deps): update dependency electron to v13.5.0 🌟 (#18318)
  chore: Update Chrome (stable) to 94.0.4606.61 and Chrome (beta) to 95.0.4638.32 (#18229)
  fix(proxy-logging): use constant consoleProps object (#18207)
  feat(driver): Add "overwrite" option to cy.screenshot() (#18280)
  ...
tgriesser added a commit that referenced this pull request Oct 8, 2021
* develop: (33 commits)
  fix: remove .json check from require_async, prevent child_process spawn (#18416)
  percy snapshot the tooltip visually, prevent it from being hidden
  fix: `everyNthFrame` should only be applied for Chrome 89+ (#18392)
  docs: General updates to contributing guide (#18283)
  chore: Update Chrome (beta) to 95.0.4638.40 (#18389)
  chore: use circleci timings split for e2e tests (#18367)
  fix: fixed title (#18370)
  chore(deps): update dependency electron to v14 🌟 (#18384)
  chore(server): share client route (#18215)
  fix: Prevent Cypress from crashing when argument parsing "spec: {}" (#18312)
  chore: update husky dev dependency to v7 (#18345)
  feat: add defineConfig function to help type config (#18302)
  chore: Update Chrome (stable) to 94.0.4606.71 (#18324)
  feat: allow to use TypeScript in the config file (#18300)
  allow select to be called with empty array (#18329)
  fix(vite-dev-server): windows `supportFile` + preserve optimize entries (#18286)
  chore: fix semantic-release dry run (#18332)
  fix(driver): improve status_code_flags_invalid error message (#18316)
  chore(deps): update dependency electron to v13.5.0 🌟 (#18318)
  chore: Update Chrome (stable) to 94.0.4606.61 and Chrome (beta) to 95.0.4638.32 (#18229)
  ...
tgriesser added a commit that referenced this pull request Oct 10, 2021
* unified-desktop-gui: (40 commits)
  feat: index.html configurability and storybook support (#18242)
  fix: remove .json check from require_async, prevent child_process spawn (#18416)
  percy snapshot the tooltip visually, prevent it from being hidden
  fix: failing tests from #18372 (#18414)
  fix: `everyNthFrame` should only be applied for Chrome 89+ (#18392)
  feat(app): render spec list, command log, iframe (#18372)
  fix: drag and drop to be correct directory (#18400)
  refactor: Add GitDataSource, FileDataSource, toast for errors (#18385)
  docs: General updates to contributing guide (#18283)
  Add shorter --ct alias for --component
  Add --e2e and --component CLI options
  chore: Update Chrome (beta) to 95.0.4638.40 (#18389)
  chore: use circleci timings split for e2e tests (#18367)
  fix: fixed title (#18370)
  chore(deps): update dependency electron to v14 🌟 (#18384)
  chore(server): share client route (#18215)
  fix: Prevent Cypress from crashing when argument parsing "spec: {}" (#18312)
  chore: update husky dev dependency to v7 (#18345)
  feat: add defineConfig function to help type config (#18302)
  chore: Update Chrome (stable) to 94.0.4606.71 (#18324)
  ...
mjhenkes pushed a commit that referenced this pull request Jul 28, 2022
Co-authored-by: Zach Bloomquist <github@chary.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

everyNthFrame should only be applied for Chrome 89+
2 participants