Cypress: Failed to enter full screen of video player

Created on 22 Jan 2018  路  5Comments  路  Source: cypress-io/cypress

  • Operating System: mac OS High Sierra 10.13.2 (17C88)
  • Cypress Version: 1.4.1
  • Browser Version: Google Chrome 63.0.3239.132 (Official Build) (64-bit)

Is this a Feature or Bug?

bug

Current behavior:

Given a html video player
When I press the full screen button
Then the video player DOES NOT GO to full screen
...and then I can see the message in the console:
Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture.

Desired behavior:

Given a html video player
When I press the full screen button
Then the video player SHOULD GO to full screen

How to reproduce:

1. open https://plyr.io/ or any other html video player
2. press full screen button

Test code:

describe('having video player in in-site mode', () => {
  it('should go to full screen after pressing full screen button', () => {
    cy.visit('https://plyr.io/');
    cy.get('[data-plyr="fullscreen"]').click();
  });
});

Additional Info (images, stack traces, etc)

I know the user gesture problem is really common, and this is the default browser behaviour, but it would be great to make it working correctly in Cypress as it should simulate user journey on tested page/application.

native events bug

Most helpful comment

This is something that definitely requires our support of native browser events, as this cannot be done programatically: https://github.com/cypress-io/cypress/issues/311

All 5 comments

+1

This is something that definitely requires our support of native browser events, as this cannot be done programatically: https://github.com/cypress-io/cypress/issues/311

Doesn't chromium have a CLI switch to bypass "API can only be initiated by a user gesture"?

I'm not fluent in C++. I've looked into Chromium code and I didn't find a way to bypass this check.

Does anyone have fix this issue ? or do you need help to investigate on this

Was this page helpful?
0 / 5 - 0 ratings