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

Blank video recording #1304

Closed
rgavinc opened this issue Feb 13, 2018 · 30 comments
Closed

Blank video recording #1304

rgavinc opened this issue Feb 13, 2018 · 30 comments

Comments

@rgavinc
Copy link

rgavinc commented Feb 13, 2018

Current behavior:

Recorded video is returned blank.

Desired behavior:

Video to record normally.

How to reproduce:

When I run cypress I get both a video and snapshot returned to me but they are both blank. When I run cypress in headed mode I get a correct snapshot back but no video (since video recording isn't supported in headed mode).

Additional Info (images, stack traces, etc)

In headless mode:
image
image
In headed mode:
image

  • Operating System: Windows 10
  • Cypress Version: 1.4.2
  • Browser Version: Electron 53.0.2785.143
@fdaryaee
Copy link

I am facing the same issue. In the headless mode I get the video but it is blank.
Below are the details of my configuration.
Cypress version: 2.1.0
OS: Win7 Professional (x64)

@jennifer-shehane jennifer-shehane added type: bug stage: needs investigating Someone from Cypress needs to look at this OS: windows labels Apr 12, 2018
@ValerieThoma
Copy link

@rgavinc, I cannot reproduce this bug with 1.4.2
nor @fdaryaee, can I reproduce with 2.1.0
Can either of you provide a little more information about your tests?

  • Do you experience this behavior when running all of your test suites or projects?
  • Can you provide the steps and/or commands you issued to run your tests?
  • Are either of you behind a corporate proxy?

@jennifer-shehane jennifer-shehane added stage: needs information Not enough info to reproduce the issue and removed OS: windows stage: needs investigating Someone from Cypress needs to look at this labels Apr 13, 2018
@fdaryaee
Copy link

fdaryaee commented Apr 23, 2018

I am using following command to run the tests in a headless mode. I see this issue in both cases i.e. if I run a single test or all the tests in a suite.

To run all the tests I use following command

npx cypress run --env configFile=test

To run a single test I use following command

npx cypress run --env configFile=test --spec cypress\integration\matchmaker_spec.js

In both the cases, video is recorded but its bank (See screenshots attached)
Size of Video file for all tests is 203 KB (2.41 min video)
Size of Video file for single test is 2.4 KB ( less than a sec video)

Also, we are not behind a corporate proxy.

all_tests

single_test

@jennifer-shehane
Copy link
Member

Unfortunately, we will have to have a reproducible repo that we can run to reproduce this. We have tried running some of our example repos - also in Windows, but have been unable to reproduce it.

Can someone provide a repo/code to reproduce?

@fdaryaee
Copy link

The repo is private and something which I cannot share unfortunately. I can help with any other information that can help you reproduce this. Please let me know what all you need. Thanks!

@GAO8A
Copy link

GAO8A commented Apr 25, 2018

@ValerieThoma & @jennifer-shehane Can replicate this problem with my project, and yes we are behind a company proxy where https://api.cypress.io/is blocked.

In headed mode, screenshots work per expected, they issue arises in headless mode where they are blank.

A simple test like this will produce a blank screenshot in headless:

describe('Sanity', function() {
    it('True is true', function() {
      cy.visit('https://news.ycombinator.com/'); // or any url
      cy.screenshot('HN')
      expect(true).to.equal(true)
    })
  })
  • Operating System: Windows 7
  • Cypress Version: 2.0.3
  • Electron Version: 59

BTW, Thank you for a great product and support!

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Apr 26, 2018

Can you try to set HTTP_PROXY and/or HTTPS_PROXY to your corporate proxy as environment variables? I detailed some of this fix here: #1469 (comment)

But for Windows, it should be something like

set HTTP_PROXY "http://my-corporate-proxy-address"

@JoaoPachecoSmartMed
Copy link

JoaoPachecoSmartMed commented May 22, 2018

I'm having the same issue. I tried run the project I'm working on Ubuntu VM and it worked, I got video and images, but on Windows 10 the video is blank and the images are black.

Perhaps a Xvfb library is missing for Windows or something like that?

@dbourse
Copy link

dbourse commented Jun 5, 2018

I have the same issue

@sj4nes
Copy link

sj4nes commented Jun 15, 2018

I'm seeing blank videos as well. This is with:

  • Cypress 3.0.1
  • Electron 59 (headless)
  • Windows 8.1

Screenshots are also blank.

@brian-mann
Copy link
Member

Xvfb is not used or needed in Windows. It's linux only.

@brian-mann
Copy link
Member

Can you all try Chrome instead of Electron to see if the screenshots aren't blank?

@sj4nes
Copy link

sj4nes commented Jun 15, 2018

Screenshots are working when I use -b chrome, will check this with video capture next.

Edit: Of course, I forgot that video capture is not available with Chrome.

@brian-mann
Copy link
Member

Can you update to 3.0.2 and see if this issue is resolved?

We updated ffmpeg to 4.x.x there and added many more debugging logs.

Also please be sure that you use DEBUG=cypress:* cypress run when running so that we can get the debug logs to understand what is happening.

@JoaoPachecoSmartMed
Copy link

For me is working now with version 3.0.1

@4z5lz
Copy link

4z5lz commented Jul 4, 2018

I am facing the same issue with video recording. In the headless mode the video is blank.
Cypress version: 3.0.1 (btw, can't upgrade to 3.0.2 - #2097)
OS: Win7 Professional (x64)

@SanderMeester
Copy link

We had the same problem, but it went away after two changes; we went from running the TFS-agent as an app to running it as a service and we changed the user. So it might a permission-issue. It might not be related to both of the changes, but this might give you something to try.

@kyle-villegas
Copy link

Hi, I encountered this issue yesterday and managed to resolve it.
What I did was install cypress as an administrator. (I was running it on my local machine as non admin since I didn't have any issues with it before).

Once I installed node, angular, & cypress using an admin profile and ran it using the same admin profile it was able to render both videos and screenshots in headless mode.

Hopefully this helps debugging!

Version: Cypress 3.1
System: Windows 7

@bpmOnl
Copy link

bpmOnl commented Dec 20, 2018

I have the same problem
Version: Cypress 3.1.3
System: Windows server 2012

@lightzane
Copy link

Hi, I encountered this issue yesterday and managed to resolve it.
What I did was install cypress as an administrator. (I was running it on my local machine as non admin since I didn't have any issues with it before).

Once I installed node, angular, & cypress using an admin profile and ran it using the same admin profile it was able to render both videos and screenshots in headless mode.

Hopefully this helps debugging!

Version: Cypress 3.1
System: Windows 7

@kvillega how to run or install cypress in admin mode?

This is my first time using cypress and encountering the same issue.
cypress run --spec "cypress/integration/sample_spec.js"

The content is to go to google.com and just search any keyword then click on images.
The code includes cy.screenshot("Step n")

When running via cypress desktop the snapshots/screenshots are good! (but no video)
On cypress run the screenshots are all black while video is just white but have duration.

@h01d3r
Copy link

h01d3r commented Mar 6, 2019

I have the same issue. Test running on TeamCity build agent. Only -b chrome solve this issue

@jennifer-shehane
Copy link
Member

Can you try to add this code to the pluginsFile at cypress/plugins/index.js? Let us know if it changes anything.

Try --disable-d3d11 and --disable-gpu flags independently also. Some combination of this may help things.

module.exports = (on, config) => {
  on('before:browser:launch', (browser = {}, args) => {
    if (browser.name === 'electron') {
      args['disable-gpu']
      args['disable-d3d11']

      return args
    }
  })
}

@h01d3r
Copy link

h01d3r commented Mar 7, 2019

No, nothing has changed:( Video and screenshots is empty
And one more. when I run cypress with -b chrome option on build agent from TeamCity UI it's say that "A video will not be recorded when using this browser." , but when I run it from build agent from cmd video record is fine

@jaterlwj
Copy link

jaterlwj commented Mar 28, 2019

Hi team,

Is there any update to this issue? I am running into the exact same problem as @rgavinc where screenshots and video in headless electron returns blank but screenshot works in headed electron.

  • I am experiencing this on all test suites and projects. Even the simplest of test - opening a page and taking a screenshot) would result in the same error.
  • Commands issued in the test are cy.visit('www.google.com') and cy.screenshot()

I am behind a corporate proxy and have tried the following to no avail:

  1. Setting HTTP_PROXY and HTTPS_PROXY.
  2. Disabling the disable-d3d11 and disable-gpu as per recommended by @jennifer-shehane

My logs from DEBUG=cypress:* are uploaded here.

*Edited to include versions used:
Cypress 3.1.4
Electron 59 (headless)
Windows 7 - 64 Bit

@divslinger
Copy link

Is this issue also resolved with PR #3531?

@jennifer-shehane
Copy link
Member

@GlitchPerfect Oh, I really hope so! Can anyone run Cypress against the develop branch that is experiencing this issue to verify if this fixes the issue?

@flotwig Thoughts on this issue being resolved for proxy support? Would you be able to replicate this issue and verify?

@flotwig
Copy link
Contributor

flotwig commented Apr 24, 2019

@jennifer-shehane Is this a network-related issue? I tried running Cypress with api.cypress.io blocked, but it still successfully takes screenshots and videos in run mode on the latest develop branch (even with no Internet access at all).

This comment says they are experiencing the issue but are not behind a corporate proxy, so it might not be related.

@jennifer-shehane
Copy link
Member

@flotwig We've never been able to reproduce this, so we're unsure of the core issue. I just know some people mentioned proxy, so was hoping this may have been the issue.

@divslinger
Copy link

Just to close this old issue. The bug has been resolved for me.

@jennifer-shehane
Copy link
Member

Yes, I am considering this to be resolved since there have not been really any mentions of this in nearly a year.

If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests