cypress: Failed to enter full screen of video player

  • 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.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 15
  • Comments: 19 (2 by maintainers)

Most upvoted comments

any update on this. I am stuck with my player testing in fullscreen. Thank you!

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

+1

Hi all, I just came across this discussion, and I found one temporary solution till cypress comes up with something https://github.com/dmtrKovalenko/cypress-real-events

Using .realHover() and .realClick() on the element, you can still go in full screen, Works for me!